diff options
author | Shawn Willden <swillden@google.com> | 2020-11-24 20:24:01 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-11-24 20:24:01 +0000 |
commit | fdae8b3e6378e897c58c16df63429c3bac5d7cf7 (patch) | |
tree | 29abd83e5d813094960c373b07cb01e4b90b5873 | |
parent | fae3cdc683bc37fe278c52b3cf855f378dd5f37d (diff) | |
parent | fba140d0cf4286e64bed0a18af3a1b68ae90a1c8 (diff) | |
download | libcppbor-fdae8b3e6378e897c58c16df63429c3bac5d7cf7.tar.gz |
Apply clang-format. am: 6ad5732fa5 am: fba140d0cf
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1506865
Change-Id: I09b23e6d8afc616ba7f4b1bb4b66ad7f59664611
l--------- | .clang-format | 1 | ||||
-rw-r--r-- | src/cppbor.cpp | 6 | ||||
-rw-r--r-- | src/cppbor_parse.cpp | 22 |
3 files changed, 15 insertions, 14 deletions
diff --git a/.clang-format b/.clang-format new file mode 120000 index 0000000..ddcf5a2 --- /dev/null +++ b/.clang-format @@ -0,0 +1 @@ +../../build/soong/scripts/system-clang-format
\ No newline at end of file diff --git a/src/cppbor.cpp b/src/cppbor.cpp index 223a445..5a45dd9 100644 --- a/src/cppbor.cpp +++ b/src/cppbor.cpp @@ -17,10 +17,10 @@ #include "cppbor.h" #ifndef __TRUSTY__ - #include <android-base/logging.h> - #define LOG_TAG "CppBor" +#include <android-base/logging.h> +#define LOG_TAG "CppBor" #else - #define CHECK(x) (void)(x) +#define CHECK(x) (void)(x) #endif namespace cppbor { diff --git a/src/cppbor_parse.cpp b/src/cppbor_parse.cpp index 33d2ab6..4715152 100644 --- a/src/cppbor_parse.cpp +++ b/src/cppbor_parse.cpp @@ -19,10 +19,10 @@ #include <stack> #ifndef __TRUSTY__ - #include <android-base/logging.h> - #define LOG_TAG "CppBor" +#include <android-base/logging.h> +#define LOG_TAG "CppBor" #else - #define CHECK(x) (void)(x) +#define CHECK(x) (void)(x) #endif namespace cppbor { @@ -32,8 +32,8 @@ namespace { std::string insufficientLengthString(size_t bytesNeeded, size_t bytesAvail, const std::string& type) { char buf[1024]; - snprintf(buf, sizeof(buf), "Need %zu byte(s) for %s, have %zu", - bytesNeeded, type.c_str(), bytesAvail); + snprintf(buf, sizeof(buf), "Need %zu byte(s) for %s, have %zu", bytesNeeded, type.c_str(), + bytesAvail); return std::string(buf); } @@ -280,9 +280,9 @@ class FullParseClient : public ParseClient { // Starting a new compound data item, i.e. a new parent. Save it on the parent stack. // It's safe to save a raw pointer because the unique_ptr is guaranteed to stay in // existence until the corresponding itemEnd() call. - #if __has_feature(cxx_rtti) - assert(dynamic_cast<CompoundItem*>(item.get())); - #endif +#if __has_feature(cxx_rtti) + assert(dynamic_cast<CompoundItem*>(item.get())); +#endif mParentStack.push(static_cast<CompoundItem*>(item.get())); return this; } else { @@ -321,9 +321,9 @@ class FullParseClient : public ParseClient { private: void appendToLastParent(std::unique_ptr<Item> item) { auto parent = mParentStack.top(); - #if __has_feature(cxx_rtti) - assert(dynamic_cast<IncompleteItem*>(parent)); - #endif +#if __has_feature(cxx_rtti) + assert(dynamic_cast<IncompleteItem*>(parent)); +#endif if (parent->type() == ARRAY) { static_cast<IncompleteArray*>(parent)->add(std::move(item)); } else if (parent->type() == MAP) { |