summaryrefslogtreecommitdiff
path: root/xC-gen-proto-c.awk
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-09-10 14:39:23 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-09-10 16:06:35 +0200
commitf3cc1373423b8bab3e2c364318d7e0857e79098a (patch)
tree1d5d5dbe070e0a73b17061dcdf5a3d7760784ea9 /xC-gen-proto-c.awk
parent8c8e06b0157c97ee1771f848ed363c6a0ed398be (diff)
downloadxK-f3cc1373423b8bab3e2c364318d7e0857e79098a.tar.gz
xK-f3cc1373423b8bab3e2c364318d7e0857e79098a.tar.xz
xK-f3cc1373423b8bab3e2c364318d7e0857e79098a.zip
xC-gen-proto: reduce enums to single bytes
That's already way more than we can possibly use.
Diffstat (limited to 'xC-gen-proto-c.awk')
-rw-r--r--xC-gen-proto-c.awk6
1 files changed, 3 insertions, 3 deletions
diff --git a/xC-gen-proto-c.awk b/xC-gen-proto-c.awk
index e7faef0..2810c96 100644
--- a/xC-gen-proto-c.awk
+++ b/xC-gen-proto-c.awk
@@ -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"