/nanopb-2.7.6/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-2.7.6/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-2.7.6/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-2.7.6/ |
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); 320 …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 322 size_t max_size = *size; in read_raw_value() 326 *size = 0; in read_raw_value() 329 (*size)++; in read_raw_value() 330 if (*size > max_size) in read_raw_value() 339 *size = 8; in read_raw_value() 343 *size = 4; in read_raw_value() 361 uint32_t size; in pb_make_string_substream() local 362 if (!pb_decode_varint32(stream, &size)) in pb_make_string_substream() [all …]
|
D | pb_encode.c | 130 size_t size; in encode_array() local 151 size = 4 * (size_t)count; in encode_array() 155 size = 8 * (size_t)count; in encode_array() 168 size = sizestream.bytes_written; in encode_array() 171 if (!pb_encode_varint(stream, (pb_uint64_t)size)) in encode_array() 175 return pb_write(stream, NULL, size); /* Just sizing.. */ in encode_array() 297 return bytes->size == 0; in pb_check_proto3_default_value() 554 bool pb_get_encoded_size(size_t *size, const pb_msgdesc_t *fields, const void *src_struct) in pb_get_encoded_size() argument 561 *size = stream.bytes_written; in pb_get_encoded_size() 702 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-2.7.6/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-2.7.6/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-2.7.6/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-2.7.6/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-2.7.6/tests/regression/issue_472/ |
D | test.proto | 7 uint32 size = 2; field
|
/nanopb-2.7.6/tests/regression/issue_644/ |
D | SConscript | 2 # Generator fails to account for padding when estimating struct size
|
/nanopb-2.7.6/tests/regression/issue_547/ |
D | test.c | 12 msg.mybytes.size = 0xFFFFFFFF; in main()
|
/nanopb-2.7.6/tests/regression/issue_141/ |
D | SConscript | 1 # Regression test for issue 141: wrong encoded size #define for oneof messages
|
/nanopb-2.7.6/tests/regression/issue_166/ |
D | SConscript | 1 # Verify that the maximum encoded size is calculated properly
|
/nanopb-2.7.6/tests/regression/issue_253/ |
D | SConscript | 1 # Regression test for Issue 253: Wrong calculated message maximum size
|
/nanopb-2.7.6/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-2.7.6/tests/message_sizes/ |
D | SConscript | 1 # Test the generation of message size #defines
|
/nanopb-2.7.6/tests/regression/issue_205/ |
D | SConscript | 1 # Check that pb_release() correctly handles corrupted size fields of
|
/nanopb-2.7.6/tests/regression/issue_195/ |
D | SConscript | 1 # Regression test for Issue 195: Message size not calculated if a submessage includes
|
/nanopb-2.7.6/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()
|
/nanopb-2.7.6/tests/without_64bit/ |
D | encode_alltypes.c | 28 alltypes.req_bytes.size = 4; in main() 45 alltypes.rep_bytes_count = 5; alltypes.rep_bytes[4].size = 4; in main() 89 alltypes.opt_bytes.size = 4; in main()
|
/nanopb-2.7.6/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);
|