From 1cd5969f253528b1fc05a06c7a9f222baa29f68d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 2 May 2011 19:53:39 -0400 Subject: [PATCH] [object] Fix bug in get_user_data() implementation --- src/hb-object-private.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hb-object-private.hh b/src/hb-object-private.hh index d124758..47cef7e 100644 --- a/src/hb-object-private.hh +++ b/src/hb-object-private.hh @@ -91,7 +91,8 @@ struct hb_user_data_array_t { } inline void *get (hb_user_data_key_t *key) { - return map.get (key); + hb_user_data_t *user_data = map.get (key); + return user_data ? user_data->data : NULL; } void finish (void) { map.finish (); } @@ -177,7 +178,7 @@ static inline void hb_object_trace (const Type *obj, const char *function) obj->header.trace (function); } template -static inline Type *hb_object_create () +static inline Type *hb_object_create (void) { Type *obj = (Type *) hb_object_header_t::create (sizeof (Type)); hb_object_trace (obj, HB_FUNC); @@ -186,7 +187,7 @@ static inline Type *hb_object_create () template static inline bool hb_object_is_inert (const Type *obj) { - return unlikely (obj->header.is_inert()); + return unlikely (obj->header.is_inert ()); } template static inline Type *hb_object_reference (Type *obj) -- 2.7.4