From eace8e32954eb6152e8df06f5a18905c235f0156 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 13 May 2015 16:23:35 -0700 Subject: Enable Travis for Clang, and enable -Werror for all Travis builds. Also added an extra Clang-only warning flag. --- upb/bindings/googlepb/bridge.cc | 2 +- upb/bindings/lua/upb/table.c | 4 ++-- upb/descriptor/reader.c | 2 +- upb/pb/compile_decoder_x64.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'upb') diff --git a/upb/bindings/googlepb/bridge.cc b/upb/bindings/googlepb/bridge.cc index 2a2bbbf..394f7b4 100644 --- a/upb/bindings/googlepb/bridge.cc +++ b/upb/bindings/googlepb/bridge.cc @@ -99,7 +99,7 @@ const MessageDef* DefBuilder::GetMaybeUnfrozenMessageDef( fields.push_back(d->field(i)); } - for (int i = 0; i < fields.size(); i++) { + for (size_t i = 0; i < fields.size(); i++) { const goog::FieldDescriptor* proto2_f = fields[i]; assert(proto2_f); md->AddField(NewFieldDef(proto2_f, m), &status); diff --git a/upb/bindings/lua/upb/table.c b/upb/bindings/lua/upb/table.c index 0907f58..e574ab0 100644 --- a/upb/bindings/lua/upb/table.c +++ b/upb/bindings/lua/upb/table.c @@ -88,7 +88,7 @@ static void lupbtable_pushtable(lua_State *L, const upb_table *t, bool inttab) { lupbtable_setnum(L, -1, "size_lg2", t->size_lg2); lua_newtable(L); - for (int i = 0; i < upb_table_size(t); i++) { + for (size_t i = 0; i < upb_table_size(t); i++) { lupbtable_pushent(L, &t->entries[i], inttab, t->ctype); lua_rawseti(L, -2, i + 1); } @@ -102,7 +102,7 @@ static void lupbtable_pushinttable(lua_State *L, const upb_inttable *t) { lupbtable_setnum(L, -1, "array_count", t->array_count); lua_newtable(L); - for (int i = 0; i < t->array_size; i++) { + for (size_t i = 0; i < t->array_size; i++) { lua_newtable(L); if (upb_arrhas(t->array[i])) { lupbtable_pushval(L, t->array[i], t->t.ctype); diff --git a/upb/descriptor/reader.c b/upb/descriptor/reader.c index 0b289c0..29a2188 100644 --- a/upb/descriptor/reader.c +++ b/upb/descriptor/reader.c @@ -319,7 +319,7 @@ static bool parse_default(char *str, upb_fielddef *f) { break; } case UPB_TYPE_UINT32: { - long val = strtoul(str, &end, 0); + unsigned long val = strtoul(str, &end, 0); if (val > UINT32_MAX || errno == ERANGE || *end) success = false; else diff --git a/upb/pb/compile_decoder_x64.c b/upb/pb/compile_decoder_x64.c index a0cb3c9..51b9b9e 100644 --- a/upb/pb/compile_decoder_x64.c +++ b/upb/pb/compile_decoder_x64.c @@ -330,7 +330,7 @@ static void patchdispatch(jitcompiler *jc) { // Secondary slot. Since we have 64 bits for the value, we use an // absolute offset. int mcofs = machine_code_ofs2(jc, method, val); - newval = (uint64_t)(jc->group->jit_code + mcofs); + newval = (uint64_t)((char*)jc->group->jit_code + mcofs); } bool ok = upb_inttable_replace(dispatch, key, upb_value_uint64(newval)); UPB_ASSERT_VAR(ok, ok); @@ -339,7 +339,7 @@ static void patchdispatch(jitcompiler *jc) { // Update entry point for this method to point at mc base instead of bc // base. Set this only *after* we have patched the offsets // (machine_code_ofs2() uses this). - method->code_base.ptr = jc->group->jit_code + machine_code_ofs(jc, method); + method->code_base.ptr = (char*)jc->group->jit_code + machine_code_ofs(jc, method); upb_byteshandler *h = &method->input_handler_; upb_byteshandler_setstartstr(h, upb_pbdecoder_startjit, NULL); -- cgit v1.2.3