summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-03 22:43:02 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-08-03 22:43:02 -0400
commit2f19c9ae2e1e7f2d13b8e78d09fb992f55caf00b (patch)
tree844a315242d5c8d5f170116c80ab84d4feba5657
parent832cb0e4680d4274869ee67b84418e5ec06de247 (diff)
downloadpango-2f19c9ae2e1e7f2d13b8e78d09fb992f55caf00b.tar.gz
[HB] Remove use of typeof()
-rw-r--r--pango/opentype/hb-blob.c4
-rw-r--r--pango/opentype/hb-buffer.c2
-rw-r--r--pango/opentype/hb-font.cc14
-rw-r--r--pango/opentype/hb-object-private.h4
4 files changed, 12 insertions, 12 deletions
diff --git a/pango/opentype/hb-blob.c b/pango/opentype/hb-blob.c
index 590dd799..c655aa18 100644
--- a/pango/opentype/hb-blob.c
+++ b/pango/opentype/hb-blob.c
@@ -84,7 +84,7 @@ hb_blob_create (const char *data,
{
hb_blob_t *blob;
- if (!length || !HB_OBJECT_DO_CREATE (blob)) {
+ if (!length || !HB_OBJECT_DO_CREATE (hb_blob_t, blob)) {
if (destroy)
destroy (user_data);
return &_hb_blob_nil;
@@ -118,7 +118,7 @@ hb_blob_create_sub_blob (hb_blob_t *parent,
hb_blob_t *blob;
const char *pdata;
- if (!length || offset >= parent->length || !HB_OBJECT_DO_CREATE (blob))
+ if (!length || offset >= parent->length || !HB_OBJECT_DO_CREATE (hb_blob_t, blob))
return &_hb_blob_nil;
pdata = hb_blob_lock (parent);
diff --git a/pango/opentype/hb-buffer.c b/pango/opentype/hb-buffer.c
index d995b127..61f960da 100644
--- a/pango/opentype/hb-buffer.c
+++ b/pango/opentype/hb-buffer.c
@@ -78,7 +78,7 @@ hb_buffer_create (unsigned int pre_alloc_size)
{
hb_buffer_t *buffer;
- if (!HB_OBJECT_DO_CREATE (buffer))
+ if (!HB_OBJECT_DO_CREATE (hb_buffer_t, buffer))
return &_hb_buffer_nil;
if (pre_alloc_size)
diff --git a/pango/opentype/hb-font.cc b/pango/opentype/hb-font.cc
index b82fd287..869df34f 100644
--- a/pango/opentype/hb-font.cc
+++ b/pango/opentype/hb-font.cc
@@ -51,7 +51,7 @@ hb_font_callbacks_create (void)
{
hb_font_callbacks_t *fcallbacks;
- if (!HB_OBJECT_DO_CREATE (fcallbacks))
+ if (!HB_OBJECT_DO_CREATE (hb_font_callbacks_t, fcallbacks))
return &_hb_font_callbacks_nil;
return fcallbacks;
@@ -82,7 +82,7 @@ hb_font_callbacks_copy (hb_font_callbacks_t *other_fcallbacks)
{
hb_font_callbacks_t *fcallbacks;
- if (!HB_OBJECT_DO_CREATE (fcallbacks))
+ if (!HB_OBJECT_DO_CREATE (hb_font_callbacks_t, fcallbacks))
return &_hb_font_callbacks_nil;
*fcallbacks = *other_fcallbacks;
@@ -115,7 +115,7 @@ hb_unicode_callbacks_create (void)
{
hb_unicode_callbacks_t *ucallbacks;
- if (!HB_OBJECT_DO_CREATE (ucallbacks))
+ if (!HB_OBJECT_DO_CREATE (hb_unicode_callbacks_t, ucallbacks))
return &_hb_unicode_callbacks_nil;
return ucallbacks;
@@ -146,7 +146,7 @@ hb_unicode_callbacks_copy (hb_unicode_callbacks_t *other_ucallbacks)
{
hb_unicode_callbacks_t *ucallbacks;
- if (!HB_OBJECT_DO_CREATE (ucallbacks))
+ if (!HB_OBJECT_DO_CREATE (hb_unicode_callbacks_t, ucallbacks))
return &_hb_unicode_callbacks_nil;
*ucallbacks = *other_ucallbacks;
@@ -211,7 +211,7 @@ hb_face_create_for_tables (hb_get_table_func_t get_table,
{
hb_face_t *face;
- if (!HB_OBJECT_DO_CREATE (face)) {
+ if (!HB_OBJECT_DO_CREATE (hb_face_t, face)) {
if (destroy)
destroy (user_data);
return &_hb_face_nil;
@@ -232,7 +232,7 @@ hb_face_create_for_data (hb_blob_t *blob,
{
hb_face_t *face;
- if (!HB_OBJECT_DO_CREATE (face))
+ if (!HB_OBJECT_DO_CREATE (hb_face_t, face))
return &_hb_face_nil;
face->blob = hb_blob_reference (blob);
@@ -331,7 +331,7 @@ hb_font_create (hb_face_t *face)
{
hb_font_t *font;
- if (!HB_OBJECT_DO_CREATE (font))
+ if (!HB_OBJECT_DO_CREATE (hb_font_t, font))
return &_hb_font_nil;
font->face = hb_face_reference (face);
diff --git a/pango/opentype/hb-object-private.h b/pango/opentype/hb-object-private.h
index 1d904067..d274b295 100644
--- a/pango/opentype/hb-object-private.h
+++ b/pango/opentype/hb-object-private.h
@@ -73,9 +73,9 @@ typedef struct {
HB_OBJECT_DO_INIT_EXPR (obj); \
} HB_STMT_END
-#define HB_OBJECT_DO_CREATE(obj) \
+#define HB_OBJECT_DO_CREATE(Type, obj) \
HB_LIKELY (( \
- (obj) = /* XXX */(typeof (obj)) calloc (1, sizeof (*(obj))), \
+ (obj) = (Type *) calloc (1, sizeof (Type)), \
HB_OBJECT_DO_INIT_EXPR (obj), \
(obj) \
))