Fixed some strict C89 errors.

pull/13171/head
Joshua Haberman 4 years ago
parent 2c1664906a
commit bc1e0b314f
  1. 2
      kokoro/ubuntu/build.sh
  2. 12
      upb/bindings/lua/def.c
  3. 6
      upb/upb.h

@ -35,5 +35,5 @@ if [[ $(uname) = "Linux" ]]; then
fi
if which valgrind; then
bazel test --run_under='valgrind --leak-check=full --error-exitcode=1' :all -- -:test_conformance_upb -:cmake_build
bazel test --run_under='valgrind --leak-check=full --error-exitcode=1' ... -- -tests:test_conformance_upb -cmake:cmake_build
fi

@ -56,8 +56,8 @@ static void lupb_wrapper_pushwrapper(lua_State *L, int narg, const void *def,
* wrapper for field |f| of this msgdef.
*/
void lupb_msgdef_pushsubmsgdef(lua_State *L, const upb_fielddef *f) {
assert(luaL_testudata(L, -1, LUPB_MSGDEF));
const upb_msgdef *m = upb_fielddef_msgsubdef(f);
assert(m);
assert(upb_fielddef_containingtype(f) == lupb_msgdef_check(L, -1));
lupb_wrapper_pushwrapper(L, -1, m, LUPB_MSGDEF);
lua_replace(L, -2); /* Replace msgdef with submsgdef. */
@ -251,8 +251,8 @@ static int lupb_oneofiter_next(lua_State *L) {
}
static int lupb_oneofdef_fields(lua_State *L) {
lupb_oneofdef_check(L, 1);
int *index = lua_newuserdata(L, sizeof(int));
lupb_oneofdef_check(L, 1);
*index = 0;
/* Closure upvalues are: oneofdef, index. */
@ -408,8 +408,8 @@ static int lupb_msgfielditer_next(lua_State *L) {
}
static int lupb_msgdef_fields(lua_State *L) {
lupb_msgdef_check(L, 1);
int *index = lua_newuserdata(L, sizeof(int));
lupb_msgdef_check(L, 1);
*index = 0;
/* Closure upvalues are: msgdef, index. */
@ -441,8 +441,8 @@ static int lupb_msgoneofiter_next(lua_State *L) {
}
static int lupb_msgdef_oneofs(lua_State *L) {
lupb_msgdef_check(L, 1);
int *index = lua_newuserdata(L, sizeof(int));
lupb_msgdef_check(L, 1);
*index = 0;
/* Closure upvalues are: msgdef, index. */
@ -750,7 +750,7 @@ static int lupb_symtab_addfile(lua_State *L) {
size_t len;
upb_symtab *s = lupb_symtab_check(L, 1);
const char *str = luaL_checklstring(L, 2, &len);
upb_arena *arena = lupb_arena_pushnew(L);;
upb_arena *arena = lupb_arena_pushnew(L);
const google_protobuf_FileDescriptorProto *file;
const upb_filedef *file_def;
upb_status status;
@ -776,7 +776,7 @@ static int lupb_symtab_addset(lua_State *L) {
google_protobuf_FileDescriptorSet *set;
upb_symtab *s = lupb_symtab_check(L, 1);
const char *str = luaL_checklstring(L, 2, &len);
upb_arena *arena = lupb_arena_pushnew(L);;
upb_arena *arena = lupb_arena_pushnew(L);
upb_status status;
upb_status_clear(&status);

@ -309,11 +309,7 @@ UPB_INLINE uint64_t _upb_be_swap64(uint64_t val) {
if (_upb_isle()) {
return val;
} else {
return ((val & 0xff) << 56) | ((val & 0xff00) << 40) |
((val & 0xff0000) << 24) | ((val & 0xff000000) << 8) |
((val & 0xff00000000ULL) >> 8) | ((val & 0xff0000000000ULL) >> 24) |
((val & 0xff000000000000ULL) >> 40) |
((val & 0xff00000000000000ULL) >> 56);
return ((uint64_t)_upb_be_swap32(val) << 32) | _upb_be_swap32(val >> 32);
}
}

Loading…
Cancel
Save