diff options
-rw-r--r-- | Android.bp | 32 | ||||
-rw-r--r-- | METADATA | 19 | ||||
-rw-r--r-- | MODULE_LICENSE_MIT | 0 | ||||
-rw-r--r-- | OWNERS | 3 | ||||
-rw-r--r-- | src/cn-cbor.c | 2 |
5 files changed, 55 insertions, 1 deletions
diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..08a727b --- /dev/null +++ b/Android.bp @@ -0,0 +1,32 @@ + +cc_library { + name: "libcn-cbor", + vendor_available: true, + vndk: { + enabled: true, + }, + srcs: [ + "src/cn-cbor.c", + "src/cn-create.c", + "src/cn-encoder.c", + "src/cn-error.c", + "src/cn-get.c", + ], + local_include_dirs: [ + "include", + ], + export_include_dirs: [ + "include", + ], + unique_host_soname: true, + host_supported: true, +} + +cc_test { + name: "cn-cbor_test", + host_supported: true, + srcs: [ + "test/cbor_test.c", + ], + shared_libs: [ "libcn-cbor", ], +} diff --git a/METADATA b/METADATA new file mode 100644 index 0000000..adbeb30 --- /dev/null +++ b/METADATA @@ -0,0 +1,19 @@ +name: "cn-cbor" +description: "cn-cbor: A constrained node implementation of CBOR in C" +third_party { + url { + type: HOMEPAGE + value: "https://github.com/cabo/cn-cbor" + } + url { + type: GIT + value: "https://github.com/cabo/cn-cbor.git" + } + version: "c2e53733a895587c2910d2b2a1312d4224e5a474" + license_type: NOTICE + last_upgrade_date { + year: 2020 + month: 4 + day: 13 + } +} diff --git a/MODULE_LICENSE_MIT b/MODULE_LICENSE_MIT new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/MODULE_LICENSE_MIT @@ -0,0 +1,3 @@ +# Default code reviewers picked from top 3 or more developers. +# Please update this list if you find better candidates. +jdanis@google.com diff --git a/src/cn-cbor.c b/src/cn-cbor.c index 9093537..2526b92 100644 --- a/src/cn-cbor.c +++ b/src/cn-cbor.c @@ -53,7 +53,7 @@ static double decode_half(int half) { #ifndef CBOR_ALIGN_READS #define ntoh16p(p) (ntohs(*(unsigned short*)(p))) -#define ntoh32p(p) (ntohl(*(unsigned long*)(p))) +#define ntoh32p(p) (ntohl(*(uint32_t*)(p))) #else static uint16_t ntoh16p(unsigned char *p) { uint16_t tmp; |