diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-08-30 20:05:35 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-08-30 20:05:35 -0700 |
commit | 9b67b322da57f1d454500e1156f6520835165386 (patch) | |
tree | 707daf418fab3c71e7fa900e13a6d9d0888b4fb3 | |
parent | 527a544b04d324e3772081fe51ef8e405124704f (diff) |
Small C++ header fixes.
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | src/upb_array.h | 2 | ||||
-rw-r--r-- | src/upb_msg.h | 2 |
3 files changed, 3 insertions, 2 deletions
@@ -24,3 +24,4 @@ - valgrind check - -Werror no compiler warnings - test suite + - verify that all headers compile with C++. diff --git a/src/upb_array.h b/src/upb_array.h index b5eb22d..f79e35d 100644 --- a/src/upb_array.h +++ b/src/upb_array.h @@ -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; diff --git a/src/upb_msg.h b/src/upb_msg.h index abec479..21f77a4 100644 --- a/src/upb_msg.h +++ b/src/upb_msg.h @@ -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; |