diff --git a/upb/def.c b/upb/def.c index 4d47131bc6..3fc8917662 100644 --- a/upb/def.c +++ b/upb/def.c @@ -2403,7 +2403,7 @@ static int count_bits_debug(uint64_t x) { static int compare_int32(const void* a_ptr, const void* b_ptr) { int32_t a = *(int32_t*)a_ptr; int32_t b = *(int32_t*)b_ptr; - return (a) < (b) ? -1 : ((a) == (b) ? 0 : 1); + return a < b ? -1 : (a == b ? 0 : 1); } upb_MiniTable_Enum* create_enumlayout(symtab_addctx* ctx, diff --git a/upbc/protoc-gen-upb.cc b/upbc/protoc-gen-upb.cc index b8dd5f783b..7bbc154707 100644 --- a/upbc/protoc-gen-upb.cc +++ b/upbc/protoc-gen-upb.cc @@ -1324,7 +1324,7 @@ int WriteEnums(const protobuf::FileDescriptor* file, Output& output) { if (!values.empty()) { values_init = EnumInit(e) + "_values"; output("static const int32_t $0[$1] = {\n", values_init, values.size()); - for (auto value : values) { + for (int32_t value : values) { output(" $0,\n", value); } output("};\n\n");