summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2017-07-11 14:11:54 -0500
committerJoshua Haberman <jhaberman@gmail.com>2017-07-11 14:12:27 -0500
commit1278ff899409025692d6915421f1af1c99dc837e (patch)
tree80b8c11d2895a80594a3fcbfb96c41234dfe1f64 /tools
parent717a030083cad1c2644d1d32f3284bd7a461b392 (diff)
Responded to PR comments.
Diffstat (limited to 'tools')
-rw-r--r--tools/make_c_api.lua11
-rw-r--r--tools/upbc.lua4
2 files changed, 10 insertions, 5 deletions
diff --git a/tools/make_c_api.lua b/tools/make_c_api.lua
index aaf5d1e..c13f37c 100644
--- a/tools/make_c_api.lua
+++ b/tools/make_c_api.lua
@@ -30,11 +30,6 @@ function strip_proto(filename)
return string.gsub(filename, '%.proto$','')
end
---[[
- [upb.TYPE_ENUM] = 5,
- [upb.TYPE_MESSAGE] = 8,
---]]
-
local function join(...)
return table.concat({...}, ".")
end
@@ -138,6 +133,12 @@ local function field_layout_rank(field)
-- 5. string fields
-- 6. submessage fields
-- 7. repeated fields
+ --
+ -- This has the following nice properties:
+ --
+ -- 1. padding alignment is (nearly) minimized.
+ -- 2. fields that might have defaults (1-5) are segregated
+ -- from fields that are always zero-initialized (6-7).
local rank
if field:containing_oneof() then
rank = 4
diff --git a/tools/upbc.lua b/tools/upbc.lua
index bf9a68d..bfd93f8 100644
--- a/tools/upbc.lua
+++ b/tools/upbc.lua
@@ -18,6 +18,10 @@ for _, argument in ipairs(arg) do
if argument == "--generate-upbdefs" then
generate_upbdefs = true
else
+ if src then
+ print("upbc can only handle one input file at a time.")
+ return 1
+ end
src = argument
end
end
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback