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 c207ba8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
sudo make install
- uses: actions/checkout@master
- name: Install Lua ${{ matrix.luaVersion }}
uses: leafo/gh-actions-lua@master
uses: leafo/gh-actions-lua@v10
with:
luaVersion: ${{ matrix.luaVersion }}
- name: Install Luarocks
uses: leafo/gh-actions-luarocks@master
uses: leafo/gh-actions-luarocks@v4
- name: Build
run: |
luarocks make $ROCKSPEC CFLAGS="-O3 -fPIC -Wall -Wextra --coverage" LIBFLAG="-shared --coverage"
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 c207ba8

Please # to comment.