From 621c0cdcb5efc4f7c2382031becded018ef0b62b Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 4 Sep 2011 19:29:36 -0700 Subject: Const invasion: large parts of upb made const-correct. --- benchmarks/parsetostruct.upb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'benchmarks/parsetostruct.upb.c') diff --git a/benchmarks/parsetostruct.upb.c b/benchmarks/parsetostruct.upb.c index 6a36544..5e7aa35 100644 --- a/benchmarks/parsetostruct.upb.c +++ b/benchmarks/parsetostruct.upb.c @@ -7,7 +7,7 @@ #include "upb/pb/decoder.h" #include "upb/pb/glue.h" -static upb_msgdef *def; +static const upb_msgdef *def; static size_t len; static void *msg[NUM_MESSAGES]; static upb_stringsrc strsrc; @@ -18,14 +18,14 @@ static bool initialize() // Initialize upb state, decode descriptor. upb_status status = UPB_STATUS_INIT; upb_symtab *s = upb_symtab_new(); - upb_read_descriptorfile(s, MESSAGE_DESCRIPTOR_FILE, &status); + upb_load_descriptor_file_into_symtab(s, MESSAGE_DESCRIPTOR_FILE, &status); if(!upb_ok(&status)) { fprintf(stderr, "Error reading descriptor: %s\n", upb_status_getstr(&status)); return false; } - def = upb_dyncast_msgdef(upb_symtab_lookup(s, MESSAGE_NAME)); + def = upb_dyncast_msgdef_const(upb_symtab_lookup(s, MESSAGE_NAME)); if(!def) { fprintf(stderr, "Error finding symbol '%s'.\n", MESSAGE_NAME); return false; -- cgit v1.2.3