intsizes.proto 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* Test the integer size overriding in nanopb options.
  2. * This allows to use 8- and 16-bit integer variables, which are not supported
  3. * directly by Google Protobuf.
  4. *
  5. * The int_size setting will override the number of bits, but keep the type
  6. * otherwise. E.g. uint32 + IS_8 => uint8_t
  7. */
  8. syntax = "proto2";
  9. import 'nanopb.proto';
  10. message IntSizes {
  11. required int32 req_int8 = 1 [(nanopb).int_size = IS_8];
  12. required uint32 req_uint8 = 2 [(nanopb).int_size = IS_8];
  13. required sint32 req_sint8 = 3 [(nanopb).int_size = IS_8];
  14. required int32 req_int16 = 4 [(nanopb).int_size = IS_16];
  15. required uint32 req_uint16 = 5 [(nanopb).int_size = IS_16];
  16. required sint32 req_sint16 = 6 [(nanopb).int_size = IS_16];
  17. required int32 req_int32 = 7 [(nanopb).int_size = IS_32];
  18. required uint32 req_uint32 = 8 [(nanopb).int_size = IS_32];
  19. required sint32 req_sint32 = 9 [(nanopb).int_size = IS_32];
  20. required int32 req_int64 = 10 [(nanopb).int_size = IS_64];
  21. required uint32 req_uint64 = 11 [(nanopb).int_size = IS_64];
  22. required sint32 req_sint64 = 12 [(nanopb).int_size = IS_64];
  23. }
  24. message DefaultSizes {
  25. required int32 req_int8 = 1 ;
  26. required uint32 req_uint8 = 2 ;
  27. required sint32 req_sint8 = 3 ;
  28. required int32 req_int16 = 4 ;
  29. required uint32 req_uint16 = 5 ;
  30. required sint32 req_sint16 = 6 ;
  31. required int32 req_int32 = 7 ;
  32. required uint32 req_uint32 = 8 ;
  33. required sint32 req_sint32 = 9 ;
  34. required int64 req_int64 = 10;
  35. required uint64 req_uint64 = 11;
  36. required sint64 req_sint64 = 12;
  37. }