int mode = (argc > 1) ? atoi(argv[1]) : 0;
/* Initialize the structure with constants */
- AllTypes alltypes = {0};
+ AllTypes alltypes = AllTypes_init_zero;
alltypes.req_int32 = -1001;
alltypes.req_int64 = -1002;
alltypes.rep_enum_count = 5; alltypes.rep_enum[4] = MyEnum_Truth;
alltypes.rep_emptymsg_count = 5;
+ alltypes.req_limits.int32_min = INT32_MIN;
+ alltypes.req_limits.int32_max = INT32_MAX;
+ alltypes.req_limits.uint32_min = 0;
+ alltypes.req_limits.uint32_max = UINT32_MAX;
+ alltypes.req_limits.int64_min = INT64_MIN;
+ alltypes.req_limits.int64_max = INT64_MAX;
+ alltypes.req_limits.uint64_min = 0;
+ alltypes.req_limits.uint64_max = UINT64_MAX;
+ alltypes.req_limits.enum_min = HugeEnum_Negative;
+ alltypes.req_limits.enum_max = HugeEnum_Positive;
+
if (mode != 0)
{
/* Fill in values for optional fields */
alltypes.has_opt_enum = true;
alltypes.opt_enum = MyEnum_Truth;
alltypes.has_opt_emptymsg = true;
+
+ alltypes.which_oneof = AllTypes_oneof_msg1_tag;
+ strcpy(alltypes.oneof.oneof_msg1.substuff1, "4059");
+ alltypes.oneof.oneof_msg1.substuff2 = 4059;
}
alltypes.end = 1099;