This is an automated email from the ASF dual-hosted git repository. sjanc pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git
commit d186b2d76ee6d5b62ce290d845a825e5cab9d92f Author: Szymon Janc <[email protected]> AuthorDate: Wed May 6 15:17:44 2026 +0200 cborattr/test: Use proper type for addr union Those are long long int and unsigned long long int as defined in struct cbor_attr_t. --- cborattr/test/src/testcases/cborattr_decode_int_array.c | 12 ++++++------ cborattr/test/src/testcases/cborattr_decode_object.c | 12 ++++++------ cborattr/test/src/testcases/cborattr_decode_simple.c | 8 ++++---- cborattr/test/src/testcases/cborattr_decode_unnamed_array.c | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cborattr/test/src/testcases/cborattr_decode_int_array.c b/cborattr/test/src/testcases/cborattr_decode_int_array.c index ae7fff8..fde602c 100644 --- a/cborattr/test/src/testcases/cborattr_decode_int_array.c +++ b/cborattr/test/src/testcases/cborattr_decode_int_array.c @@ -75,15 +75,15 @@ test_encode_int_array(void) TEST_CASE(test_cborattr_decode_int_array) { int rc; - int64_t arr_data[5]; - int64_t b_int; + long long int arr_data[5]; + long long int b_int; int arr_cnt = 0; struct cbor_attr_t test_attrs[] = { [0] = { .attribute = "a", .type = CborAttrArrayType, .addr.array.element_type = CborAttrIntegerType, - .addr.array.arr.integers.store = (long long int *) arr_data, + .addr.array.arr.integers.store = arr_data, .addr.array.count = &arr_cnt, .addr.array.maxlen = sizeof(arr_data) / sizeof(arr_data[0]), .nodefault = true @@ -91,7 +91,7 @@ TEST_CASE(test_cborattr_decode_int_array) [1] = { .attribute = "b", .type = CborAttrIntegerType, - .addr.integer = (long long int *) &b_int, + .addr.integer = &b_int, .dflt.integer = 1 }, [2] = { @@ -103,7 +103,7 @@ TEST_CASE(test_cborattr_decode_int_array) .attribute = "a", .type = CborAttrArrayType, .addr.array.element_type = CborAttrIntegerType, - .addr.array.arr.integers.store = (long long int *) arr_data, + .addr.array.arr.integers.store = arr_data, .addr.array.count = &arr_cnt, .addr.array.maxlen = 1, .nodefault = true @@ -111,7 +111,7 @@ TEST_CASE(test_cborattr_decode_int_array) [1] = { .attribute = "b", .type = CborAttrIntegerType, - .addr.integer = (long long int *) &b_int, + .addr.integer = &b_int, .dflt.integer = 1 }, [2] = { diff --git a/cborattr/test/src/testcases/cborattr_decode_object.c b/cborattr/test/src/testcases/cborattr_decode_object.c index 358d379..81e6f92 100644 --- a/cborattr/test/src/testcases/cborattr_decode_object.c +++ b/cborattr/test/src/testcases/cborattr_decode_object.c @@ -110,12 +110,12 @@ test_encode_data_complex(void) TEST_CASE(test_cborattr_decode_object) { int rc; - int64_t bm_val = 0; + long long int bm_val = 0; struct cbor_attr_t test_sub_attr_bm[] = { [0] = { .attribute = "bm", .type = CborAttrIntegerType, - .addr.integer = (long long int *) &bm_val, + .addr.integer = &bm_val, .nodefault = true }, [1] = { @@ -133,13 +133,13 @@ TEST_CASE(test_cborattr_decode_object) .attribute = NULL } }; - int64_t a_val = 0; - int64_t i_val = 0; + long long int a_val = 0; + long long int i_val = 0; struct cbor_attr_t test_sub_sub_attr[] = { [0] = { .attribute = "i", .type = CborAttrIntegerType, - .addr.integer = (long long int *) &i_val, + .addr.integer = &i_val, .nodefault = true }, [1] = { @@ -167,7 +167,7 @@ TEST_CASE(test_cborattr_decode_object) [1] = { .attribute = "a", .type = CborAttrIntegerType, - .addr.integer = (long long int *) &a_val, + .addr.integer = &a_val, .nodefault = true }, [2] = { diff --git a/cborattr/test/src/testcases/cborattr_decode_simple.c b/cborattr/test/src/testcases/cborattr_decode_simple.c index e899f1e..aef3a80 100644 --- a/cborattr/test/src/testcases/cborattr_decode_simple.c +++ b/cborattr/test/src/testcases/cborattr_decode_simple.c @@ -83,21 +83,21 @@ test_encode_data(void) TEST_CASE(test_cborattr_decode_simple) { int rc; - uint64_t a_val = 0; - int64_t b_val = 0; + long long unsigned int a_val = 0; + long long int b_val = 0; uint8_t c_data[4]; size_t c_len; struct cbor_attr_t test_attrs[] = { [0] = { .attribute = "a", .type = CborAttrIntegerType, - .addr.uinteger = (long long unsigned int *) &a_val, + .addr.uinteger = &a_val, .nodefault = true }, [1] = { .attribute = "b", .type = CborAttrIntegerType, - .addr.integer = (long long int *) &b_val, + .addr.integer = &b_val, .nodefault = true }, [2] = { diff --git a/cborattr/test/src/testcases/cborattr_decode_unnamed_array.c b/cborattr/test/src/testcases/cborattr_decode_unnamed_array.c index 5edb537..0baf4cc 100644 --- a/cborattr/test/src/testcases/cborattr_decode_unnamed_array.c +++ b/cborattr/test/src/testcases/cborattr_decode_unnamed_array.c @@ -71,14 +71,14 @@ test_encode_unnamed_array(void) TEST_CASE(test_cborattr_decode_unnamed_array) { int rc; - int64_t arr_data[5]; + long long int arr_data[5]; int arr_cnt = 0; struct cbor_attr_t test_attrs[] = { [0] = { .attribute = CBORATTR_ATTR_UNNAMED, .type = CborAttrArrayType, .addr.array.element_type = CborAttrIntegerType, - .addr.array.arr.integers.store = (long long int *) arr_data, + .addr.array.arr.integers.store = arr_data, .addr.array.count = &arr_cnt, .addr.array.maxlen = sizeof(arr_data) / sizeof(arr_data[0]), .nodefault = true
