Small C++ header fixes.

pull/13171/head
Joshua Haberman 16 years ago
parent 527a544b04
commit 9b67b322da
  1. 1
      TODO
  2. 2
      src/upb_array.h
  3. 2
      src/upb_msg.h

@ -24,3 +24,4 @@
- valgrind check
- -Werror no compiler warnings
- test suite
- verify that all headers compile with C++.

@ -45,7 +45,7 @@ INLINE union upb_value_ptr upb_array_getelementptr(struct upb_array *arr,
INLINE struct upb_array *upb_array_new(struct upb_msg_fielddef *f)
{
struct upb_array *arr = malloc(sizeof(*arr));
struct upb_array *arr = (struct upb_array*)malloc(sizeof(*arr));
upb_mmhead_init(&arr->mmhead);
arr->elements._void = NULL;
arr->len = 0;

@ -141,7 +141,7 @@ INLINE struct google_protobuf_FieldDescriptorProto *upb_msg_field_descriptor(
* counted reference. */
INLINE struct upb_msg *upb_msg_new(struct upb_msgdef *md) {
size_t size = md->size + offsetof(struct upb_msg, data);
struct upb_msg *msg = malloc(size);
struct upb_msg *msg = (struct upb_msg*)malloc(size);
memset(msg, 0, size);
upb_mmhead_init(&msg->mmhead);
msg->def = md;

Loading…
Cancel
Save