Skip to content

Commit

Permalink
makes linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
starwing committed Oct 7, 2024
1 parent 3f9ffd4 commit 9a6050e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
ROCKSPEC: rockspecs/lua-protobuf-scm-1.rockspec
strategy:
matrix:
luaVersion: ["5.1", "5.2", "5.3", "5.4", "luajit-2.0.5", "luajit-2.1.0-beta3"]
luaVersion: ["5.1", "5.2", "5.3", "5.4", "luajit-openresty"]
os: ["ubuntu-latest"]
steps:
- name: Install LCov
Expand Down
11 changes: 6 additions & 5 deletions pb.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -1624,17 +1624,18 @@ static size_t lpbE_enum(lpb_Env *e, const pb_Field *f, int *pexist, int idx) {
lpb_name(e->LS, lpb_toslice(L, idx)))) != NULL) {
if (pexist) *pexist = (ev->number != 0);
return lpb_checkmem(L, pb_addvarint32(b, ev->number));
} else if (type != LUA_TSTRING) {
argcheck(L, 0, 2, "number/string expected at field '%s', got %s",
(const char*)f->name, luaL_typename(L, idx));
return 0;
} else {
} else if (type == LUA_TSTRING) {
uint64_t v = lpb_tointegerx(L, idx, &type);
if (pexist) *pexist = (v != 0);
if (!type)
argcheck(L, 0, 2, "can not encode unknown enum '%s' at field '%s'",
lua_tostring(L, -1), (const char*)f->name);
return lpb_checkmem(L, pb_addvarint64(b, v));
} else {
argcheck(L, 0, 2, "number/string expected at field '%s', got %s",
(const char*)f->name, luaL_typename(L, idx));
if (pexist) *pexist = 0;
return 0;
}
}

Expand Down

0 comments on commit 9a6050e

Please sign in to comment.