I know that the data-types supported by protobuf-c are restricted to the ones mentioned here , but what can be a good protobuf-c equivalent to the following data types in C
time_t, int8_t, int16_t, uint8_t, uint16_t, ushort
I know that the data-types supported by protobuf-c are restricted to the ones mentioned here , but what can be a good protobuf-c equivalent to the following data types in C
time_t, int8_t, int16_t, uint8_t, uint16_t, ushort
For
time_t
, useuint64_t
.For all the others, use
sint32_t
(often negative),int32_t
(rarely negative), oruint32_t
(never negative). Protobuf uses a variable-width encoding for integers that avoids using more space on the wire than is really needed. For instance, numbers less than 128 will be encoded in 1 byte byint32_t
.