diff options
author | mark a. foltz <mfoltz@chromium.org> | 2021-07-14 09:45:24 -0700 |
---|---|---|
committer | Openscreen LUCI CQ <openscreen-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2021-07-14 17:37:23 +0000 |
commit | 57a4af262fc51287b9c2f34e3323ce0723647a25 (patch) | |
tree | 2708446159d3d68efedd315d94cc6399cbf9487a | |
parent | 8d0f58e046e362de7ec8079c094a755ae2639779 (diff) | |
download | openscreen-57a4af262fc51287b9c2f34e3323ce0723647a25.tar.gz |
[Open Screen] Fix lint errors in tools/cddl.
Fixes lint errors in tools/cddl.
Change-Id: Ib309e1d1ab99b097399cdb9a9c01bc1931a44573
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/3024944
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: Brandon Tolsch <btolsch@chromium.org>
-rw-r--r-- | tools/cddl/codegen.cc | 14 | ||||
-rw-r--r-- | tools/cddl/parse.cc | 3 |
2 files changed, 10 insertions, 7 deletions
diff --git a/tools/cddl/codegen.cc b/tools/cddl/codegen.cc index ac58eed9..3f9222bd 100644 --- a/tools/cddl/codegen.cc +++ b/tools/cddl/codegen.cc @@ -7,6 +7,7 @@ #include <cinttypes> #include <iostream> #include <limits> +#include <memory> #include <set> #include <sstream> #include <string> @@ -1586,15 +1587,16 @@ namespace openscreen { namespace msgs { namespace { +/* + * Encoder-specific errors, so it's fine to check these even in the + * parser. + */ #define CBOR_RETURN_WHAT_ON_ERROR(stmt, what) \ { \ CborError error = stmt; \ - /* Encoder-specific errors, so it's fine to check these even in the \ - * parser. \ - */ \ - OSP_DCHECK_NE(error, CborErrorTooFewItems); \ - OSP_DCHECK_NE(error, CborErrorTooManyItems); \ - OSP_DCHECK_NE(error, CborErrorDataTooLarge); \ + OSP_DCHECK_NE(error, CborErrorTooFewItems); \ + OSP_DCHECK_NE(error, CborErrorTooManyItems); \ + OSP_DCHECK_NE(error, CborErrorDataTooLarge); \ if (error != CborNoError && error != CborErrorOutOfMemory) \ return what; \ } diff --git a/tools/cddl/parse.cc b/tools/cddl/parse.cc index eef62976..cf4f15a0 100644 --- a/tools/cddl/parse.cc +++ b/tools/cddl/parse.cc @@ -10,6 +10,7 @@ #include <iostream> #include <memory> #include <sstream> +#include <utility> #include <vector> #include "absl/strings/ascii.h" @@ -974,7 +975,7 @@ ParseResult ParseCddl(absl::string_view data) { if (data[0] == 0) { return {nullptr, {}}; } - Parser p{(char*)data.data()}; + Parser p{data.data()}; SkipWhitespace(&p); AstNode* root = nullptr; |