summaryrefslogtreecommitdiffstats
path: root/tests/intsizes/intsizes.proto
blob: 236bf1832957a9f1f201b43d369f3c234e989db2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Test the integer size overriding in nanopb options.
 * This allows to use 8- and 16-bit integer variables, which are not supported
 * directly by Google Protobuf.
 *
 * The int_size setting will override the number of bits, but keep the type
 * otherwise. E.g. uint32 + IS_8 => uint8_t
 */

import 'nanopb.proto';

message IntSizes {
    required int32  req_int8 =   1  [(nanopb).int_size = IS_8];
    required uint32 req_uint8 =  2  [(nanopb).int_size = IS_8];
    required sint32 req_sint8 =  3  [(nanopb).int_size = IS_8];
    required int32  req_int16 =  4  [(nanopb).int_size = IS_16];
    required uint32 req_uint16 = 5  [(nanopb).int_size = IS_16];
    required sint32 req_sint16 = 6  [(nanopb).int_size = IS_16];
    required int32  req_int32 =  7  [(nanopb).int_size = IS_32];
    required uint32 req_uint32 = 8  [(nanopb).int_size = IS_32];
    required sint32 req_sint32 = 9  [(nanopb).int_size = IS_32];
    required int32  req_int64 =  10 [(nanopb).int_size = IS_64];
    required uint32 req_uint64 = 11 [(nanopb).int_size = IS_64];
    required sint32 req_sint64 = 12 [(nanopb).int_size = IS_64];
}

message DefaultSizes {
    required int32  req_int8 =   1 ;
    required uint32 req_uint8 =  2 ;
    required sint32 req_sint8 =  3 ;
    required int32  req_int16 =  4 ;
    required uint32 req_uint16 = 5 ;
    required sint32 req_sint16 = 6 ;
    required int32  req_int32 =  7 ;
    required uint32 req_uint32 = 8 ;
    required sint32 req_sint32 = 9 ;
    required int64  req_int64 =  10;
    required uint64 req_uint64 = 11;
    required sint64 req_sint64 = 12;
}