/nanopb-3.4.0/tests/common/ |
D | malloc_wrappers.c | 35 static size_t round_blocksize(size_t size) in round_blocksize() argument 37 if (size < 256) in round_blocksize() 39 return size; in round_blocksize() 43 return (size + 1023) / 1024 * 1024; in round_blocksize() 47 static size_t round_blocksize(size_t size) in round_blocksize() argument 49 return size; in round_blocksize() 54 void* malloc_with_check(size_t size) in malloc_with_check() argument 58 if (size <= g_max_alloc_bytes - g_alloc_bytes) in malloc_with_check() 60 buf = malloc(round_blocksize(size + GUARD_SIZE)); in malloc_with_check() 65 ((size_t*)buf)[0] = size; in malloc_with_check() [all …]
|
D | malloc_wrappers_syshdr.h | 3 #define pb_realloc(ptr,size) realloc_with_check(ptr,size) argument
|
D | malloc_wrappers.h | 3 void* malloc_with_check(size_t size); 5 void* realloc_with_check(void *ptr, size_t size);
|
/nanopb-3.4.0/tests/missing_fields/ |
D | missing_fields.c | 11 size_t size; in main() local 24 size = stream.bytes_written; in main() 30 pb_istream_t stream = pb_istream_from_buffer(buffer, size); in main() 42 pb_istream_t stream = pb_istream_from_buffer(buffer, size); in main()
|
/nanopb-3.4.0/tests/fuzztest/ |
D | fuzztest.c | 289 void do_roundtrips(const uint8_t *data, size_t size, bool expect_valid) in do_roundtrips() argument 295 …if (do_decode(data, size, sizeof(alltypes_static_AllTypes), alltypes_static_AllTypes_fields, 0, ex… in do_roundtrips() 297 do_roundtrip(data, size, sizeof(alltypes_static_AllTypes), alltypes_static_AllTypes_fields); in do_roundtrips() 298 …do_stream_decode(data, size, SIZE_MAX, sizeof(alltypes_static_AllTypes), alltypes_static_AllTypes_… in do_roundtrips() 299 do_callback_decode(data, size, true); in do_roundtrips() 304 …if (do_decode(data, size, sizeof(alltypes_proto3_static_AllTypes), alltypes_proto3_static_AllTypes… in do_roundtrips() 306 …do_roundtrip(data, size, sizeof(alltypes_proto3_static_AllTypes), alltypes_proto3_static_AllTypes_… in do_roundtrips() 307 …do_stream_decode(data, size, SIZE_MAX, sizeof(alltypes_proto3_static_AllTypes), alltypes_proto3_st… in do_roundtrips() 312 …if (do_decode(data, size, sizeof(alltypes_pointer_AllTypes), alltypes_pointer_AllTypes_fields, 0, … in do_roundtrips() 314 … do_roundtrip(data, size, sizeof(alltypes_pointer_AllTypes), alltypes_pointer_AllTypes_fields); in do_roundtrips() [all …]
|
/nanopb-3.4.0/ |
D | pb_decode.c | 26 …eturn read_raw_value(pb_istream_t *stream, pb_wire_type_t wire_type, pb_byte_t *buf, size_t *size); 322 …return read_raw_value(pb_istream_t *stream, pb_wire_type_t wire_type, pb_byte_t *buf, size_t *size) in read_raw_value() argument 324 size_t max_size = *size; in read_raw_value() 328 *size = 0; in read_raw_value() 331 (*size)++; in read_raw_value() 332 if (*size > max_size) in read_raw_value() 341 *size = 8; in read_raw_value() 345 *size = 4; in read_raw_value() 363 uint32_t size; in pb_make_string_substream() local 364 if (!pb_decode_varint32(stream, &size)) in pb_make_string_substream() [all …]
|
D | pb_encode.c | 132 size_t size; in encode_array() local 153 size = 4 * (size_t)count; in encode_array() 157 size = 8 * (size_t)count; in encode_array() 170 size = sizestream.bytes_written; in encode_array() 173 if (!pb_encode_varint(stream, (pb_uint64_t)size)) in encode_array() 177 return pb_write(stream, NULL, size); /* Just sizing.. */ in encode_array() 299 return bytes->size == 0; in pb_check_proto3_default_value() 556 bool pb_get_encoded_size(size_t *size, const pb_msgdesc_t *fields, const void *src_struct) in pb_get_encoded_size() argument 563 *size = stream.bytes_written; in pb_get_encoded_size() 715 bool checkreturn pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size) in pb_encode_string() argument [all …]
|
D | pb_encode.h | 91 bool pb_get_encoded_size(size_t *size, const pb_msgdesc_t *fields, const void *src_struct); 156 bool pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size);
|
/nanopb-3.4.0/tests/regression/issue_692/ |
D | oneof.proto | 10 SecondOneof second = 2; // unknown size if no options are considered 15 AnotherList foo = 1; // again, unknown size
|
/nanopb-3.4.0/tests/cxx_callback_datatype/ |
D | cxx_callback_datatype.cpp | 58 pb_ostream_t outstream = pb_ostream_from_buffer(&serialized.front(), serialized.size()); in main() 73 fprintf(stderr, "source(%d): ", (int)source.size()); in main() 78 fprintf(stderr, "\nencoded(%d): ", (int)serialized.size()); in main() 79 for (unsigned i = 0; i != std::min(serialized.size(), outstream.bytes_written); ++i) { in main() 82 fprintf(stderr, "\ndestination(%d): ", (int)destination.size()); in main()
|
/nanopb-3.4.0/tests/regression/issue_363/ |
D | test_oneofmsg.c | 20 msg.body_type.device_data_crypted.size = 252; in main() 36 TEST(msg.body_type.device_data_crypted.size == 252); in main()
|
/nanopb-3.4.0/docs/ |
D | lsr.css | 129 font-size: 180%; 136 font-size: 130%; 143 font-size: 120%; 149 font-size: 110%; 156 font-size: 105%; 162 font-size: 100%; 203 font-size: 100%;
|
/nanopb-3.4.0/tests/regression/issue_322/ |
D | defaults.c | 13 msg->b2.bytes[4] == 0xEF && msg->b2.size == 5); in check_defaults() 16 msg->b3.bytes[4] == 0xEF && msg->b2.size == 5); in check_defaults()
|
/nanopb-3.4.0/tests/regression/issue_472/ |
D | test.proto | 7 uint32 size = 2; field
|
/nanopb-3.4.0/tests/regression/issue_644/ |
D | SConscript | 2 # Generator fails to account for padding when estimating struct size
|
/nanopb-3.4.0/tests/regression/issue_547/ |
D | test.c | 12 msg.mybytes.size = 0xFFFFFFFF; in main()
|
/nanopb-3.4.0/tests/regression/issue_141/ |
D | SConscript | 1 # Regression test for issue 141: wrong encoded size #define for oneof messages
|
/nanopb-3.4.0/tests/regression/issue_166/ |
D | SConscript | 1 # Verify that the maximum encoded size is calculated properly
|
/nanopb-3.4.0/tests/regression/issue_253/ |
D | SConscript | 1 # Regression test for Issue 253: Wrong calculated message maximum size
|
/nanopb-3.4.0/tests/message_sizes/ |
D | SConscript | 1 # Test the generation of message size #defines
|
/nanopb-3.4.0/tests/decode_unittests/ |
D | decode_unittests.c | 30 for (i = 0; i < ref->size; i++) in callback_check() 264 struct { pb_size_t size; uint8_t bytes[5]; } d; in main() member 272 TEST((s = S("\x00"), pb_dec_bytes(&s, &f) && d.size == 0)) in main() 273 TEST((s = S("\x01\xFF"), pb_dec_bytes(&s, &f) && d.size == 1 && d.bytes[0] == 0xFF)) in main() 274 TEST((s = S("\x05xxxxx"), pb_dec_bytes(&s, &f) && d.size == 5)) in main() 353 struct { pb_size_t size; uint8_t bytes[10]; } ref; in main() member 359 ref.size = 1; ref.bytes[0] = 0x55; in main() 362 ref.size = 3; ref.bytes[0] = ref.bytes[1] = ref.bytes[2] = 0x55; in main() 365 ref.size = 1; ref.bytes[0] = 0x55; in main() 368 ref.size = 4; ref.bytes[0] = ref.bytes[1] = ref.bytes[2] = ref.bytes[3] = 0xAA; in main() [all …]
|
/nanopb-3.4.0/tests/regression/issue_195/ |
D | SConscript | 1 # Regression test for Issue 195: Message size not calculated if a submessage includes
|
/nanopb-3.4.0/tests/regression/issue_205/ |
D | SConscript | 1 # Check that pb_release() correctly handles corrupted size fields of
|
/nanopb-3.4.0/spm_headers/nanopb/ |
D | pb_encode.h | 91 bool pb_get_encoded_size(size_t *size, const pb_msgdesc_t *fields, const void *src_struct); 156 bool pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size);
|
/nanopb-3.4.0/tests/backwards_compatibility/ |
D | encode_legacy.c | 38 alltypes.req_bytes.size = 4; in main() 61 alltypes.rep_bytes_count = 5; alltypes.rep_bytes[4].size = 4; in main() 107 alltypes.opt_bytes.size = 4; in main()
|