Added a few missing copts, and made some functions proper prototypes.

pull/13171/head
Joshua Haberman 4 years ago
parent 558315a1c3
commit a0d16e7073
  1. 1
      examples/bazel/BUILD
  2. 1
      tests/BUILD
  3. 5
      tests/bindings/lua/BUILD
  4. 2
      tests/bindings/lua/main.c
  5. 14
      tests/test_generated_code.c

@ -17,4 +17,5 @@ cc_binary(
name = "test_binary",
srcs = ["test_binary.c"],
deps = [":foo_upbproto"],
copts = ["-std=c99"],
)

@ -50,6 +50,7 @@ upb_proto_library(
cc_test(
name = "test_generated_code",
srcs = ["test_generated_code.c"],
copts = UPB_DEFAULT_COPTS,
deps = [
":empty_upbdefs_proto",
":test_messages_proto3_proto_upb",

@ -2,6 +2,10 @@ load(
"//upb/bindings/lua:lua_proto_library.bzl",
"lua_proto_library",
)
load(
"//bazel:build_defs.bzl",
"UPB_DEFAULT_COPTS",
)
licenses(["notice"])
@ -20,6 +24,7 @@ cc_test(
"@com_google_protobuf//:conformance_proto",
"@com_google_protobuf//:descriptor_proto",
],
copts = UPB_DEFAULT_COPTS,
linkstatic = 1,
deps = [
"//upb/bindings/lua:lupb",

@ -34,7 +34,7 @@ const char *init =
"upb/bindings/lua/?.lua"
"'";
int main() {
int main(int argc, char **argv) {
int ret = 0;
L = luaL_newstate();
luaL_openlibs(L);

@ -24,7 +24,7 @@ const int32_t test_int32_2 = -20;
const int32_t test_int32_3 = 30;
const int32_t test_int32_4 = -40;
static void test_scalars() {
static void test_scalars(void) {
upb_arena *arena = upb_arena_new();
protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
@ -117,7 +117,7 @@ static void check_string_map_one_entry(
ASSERT(!const_ent);
}
static void test_string_double_map() {
static void test_string_double_map(void) {
upb_arena *arena = upb_arena_new();
upb_strview serialized;
upb_test_MapTest *msg = upb_test_MapTest_new(arena);
@ -141,7 +141,7 @@ static void test_string_double_map() {
upb_arena_free(arena);
}
static void test_string_map() {
static void test_string_map(void) {
upb_arena *arena = upb_arena_new();
protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
@ -259,7 +259,7 @@ static void check_int32_map_one_entry(
ASSERT(!const_ent);
}
static void test_int32_map() {
static void test_int32_map(void) {
upb_arena *arena = upb_arena_new();
protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
@ -328,7 +328,7 @@ static void test_int32_map() {
upb_arena_free(arena);
}
void test_repeated() {
void test_repeated(void) {
upb_arena *arena = upb_arena_new();
protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
@ -347,7 +347,7 @@ void test_repeated() {
upb_arena_free(arena);
}
void test_null_decode_buf() {
void test_null_decode_buf(void) {
upb_arena *arena = upb_arena_new();
protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
protobuf_test_messages_proto3_TestAllTypesProto3_parse(NULL, 0, arena);
@ -359,7 +359,7 @@ void test_null_decode_buf() {
upb_arena_free(arena);
}
void test_status_truncation() {
void test_status_truncation(void) {
int i, j;
upb_status status;
upb_status status2;

Loading…
Cancel
Save