diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-08-12 13:47:24 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-08-12 13:47:24 -0700 |
commit | 2282d2489bd8db3cd4ddbe0dd813732bffcf6452 (patch) | |
tree | 814fc94cd8ca4993363fb0ebe45b14e320a7a792 /src/upb_text.c | |
parent | 89a6c6d71f87bab63ee17c60f0feb56215f5c116 (diff) |
Refactoring: unify upb_msg.
The cost is that a upb_msg will now always have an overhead
of 2*sizeof(void*). This is comparable to proto2 overhead.
The benefit is that upb_msg is now self-describing, and
read-only algorithms can now operate on a upb_msg regardless
of the memory-management scheme.
Also, upb_array and upb_string now know inherently if they
own their associated memory, and upb_array has a generic
pointer for memory management purposes like upb_msg does.
Diffstat (limited to 'src/upb_text.c')
-rw-r--r-- | src/upb_text.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/upb_text.c b/src/upb_text.c index 6e17777..c9aad7e 100644 --- a/src/upb_text.c +++ b/src/upb_text.c @@ -36,7 +36,7 @@ void upb_text_printval(upb_field_type_t type, union upb_value val, FILE *file) case GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_STRING: case GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_BYTES: /* TODO: escaping. */ - fprintf(file, "\"" UPB_STRFMT "\"", UPB_STRARG(*val.str)); break; + fprintf(file, "\"" UPB_STRFMT "\"", UPB_STRARG(val.str)); break; } } @@ -48,7 +48,7 @@ static void print_indent(struct upb_text_printer *p, FILE *stream) } void upb_text_printfield(struct upb_text_printer *p, - struct upb_string name, + struct upb_string *name, upb_field_type_t valtype, union upb_value val, FILE *stream) { @@ -62,7 +62,7 @@ void upb_text_printfield(struct upb_text_printer *p, } void upb_text_push(struct upb_text_printer *p, - struct upb_string submsg_type, + struct upb_string *submsg_type, FILE *stream) { print_indent(p, stream); |