summaryrefslogtreecommitdiff
path: root/upb
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2011-08-19 22:30:13 -0700
committerJoshua Haberman <jhaberman@gmail.com>2011-08-19 22:30:13 -0700
commit08e7ad94f99b5944405a40af5c28b9aa95e9c0b0 (patch)
tree085dc296fa9185b57f4d28f478673ecfe0802e37 /upb
parent3387ccaffde71adaf81f481d5a686ae03e001a54 (diff)
Renamed lang_ext -> bindings, README updates.
Diffstat (limited to 'upb')
-rw-r--r--upb/descriptor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/upb/descriptor.c b/upb/descriptor.c
index fbaef29..49ea5ae 100644
--- a/upb/descriptor.c
+++ b/upb/descriptor.c
@@ -304,6 +304,7 @@ static bool upb_fielddef_parsedefault(char *str, upb_value *d, int type) {
} else if (type == UPB_TYPE(MESSAGE) || type == UPB_TYPE(GROUP)) {
// We don't expect to get a default value.
free(str);
+ upb_value_setptr(d, NULL);
if (str != NULL) success = false;
} else if (type == UPB_TYPE(BOOL)) {
if (!str || strcmp(str, "false") == 0)
@@ -356,6 +357,7 @@ static bool upb_fielddef_parsedefault(char *str, upb_value *d, int type) {
upb_value_setfloat(d, strtof(str, &end));
if (errno == ERANGE || *end) success = false;
break;
+ default: abort();
}
free(str);
}
@@ -377,6 +379,7 @@ static void upb_fielddef_endmsg(void *_r, upb_status *status) {
char *dstr = r->default_string;
r->default_string = NULL;
upb_value val;
+ upb_value_setptr(&val, NULL); // Silence inaccurate compiler warnings.
if (!upb_fielddef_parsedefault(dstr, &val, f->type)) {
// We don't worry too much about giving a great error message since the
// compiler should have ensured this was correct.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback