diff --git a/BUILD b/BUILD index 1276714b9c..60588bf507 100644 --- a/BUILD +++ b/BUILD @@ -77,19 +77,26 @@ cc_library( ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], - deps = [":port", ":fastdecode"], + deps = [ + ":fastdecode", + ":port", + ], ) cc_library( name = "fastdecode", srcs = [ + "upb/decode.int.h", "upb/decode_fast.c", "upb/decode_fast.h", - "upb/decode.int.h", "upb/msg.h", "upb/upb.int.h", ], - deps = [":port", ":table"], + copts = ["-std=gnu99"], + deps = [ + ":port", + ":table", + ], ) # Common support routines used by generated code. This library has no @@ -188,8 +195,8 @@ cc_library( cc_library( name = "table", hdrs = [ - "upb/table.int.h", - "upb/upb.h", + "upb/table.int.h", + "upb/upb.h", ], visibility = ["//tests:__pkg__"], deps = [ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 01c9f8fe17..8199fe39c1 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -77,12 +77,12 @@ add_library(upb ../upb/upb.h ../upb/upb.hpp) target_link_libraries(upb - port - fastdecode) + fastdecode + port) add_library(fastdecode + ../upb/decode.int.h ../upb/decode_fast.c ../upb/decode_fast.h - ../upb/decode.int.h ../upb/msg.h ../upb/upb.int.h) target_link_libraries(fastdecode diff --git a/upb/decode_fast.c b/upb/decode_fast.c index cb30317dbb..467787008e 100644 --- a/upb/decode_fast.c +++ b/upb/decode_fast.c @@ -77,9 +77,10 @@ static bool fastdecode_checktag(uint64_t data, int tagbytes) { UPB_FORCEINLINE static const char *fastdecode_longsize(const char *ptr, int *size) { + int i; UPB_ASSERT(*size & 0x80); *size &= 0xff; - for (int i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) { ptr++; size_t byte = (uint8_t)ptr[-1]; *size += (byte - 1) << (7 + 7 * i);