xC-gen-proto: reduce enums to single bytes
That's already way more than we can possibly use.
This commit is contained in:
@@ -110,11 +110,11 @@ function codegen_enum(name, cg, ctype) {
|
||||
|
||||
# XXX: This should also check if it isn't out-of-range for any reason,
|
||||
# but our usage of sprintf() stands in the way a bit.
|
||||
CodegenSerialize[name] = "\tstr_pack_i32(w, %s);\n"
|
||||
CodegenSerialize[name] = "\tstr_pack_i8(w, %s);\n"
|
||||
CodegenDeserialize[name] = \
|
||||
"\t{\n" \
|
||||
"\t\tint32_t v = 0;\n" \
|
||||
"\t\tif (!msg_unpacker_i32(r, &v) || !v)\n" \
|
||||
"\t\tint8_t v = 0;\n" \
|
||||
"\t\tif (!msg_unpacker_i8(r, &v) || !v)\n" \
|
||||
"\t\t\treturn false;\n" \
|
||||
"\t\t%s = v;\n" \
|
||||
"\t}\n"
|
||||
|
||||
Reference in New Issue
Block a user