diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2008-12-19 20:46:36 -0500 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2008-12-20 01:06:30 -0500 |
commit | 8bf49b27aeea8179b5862a424fb3ef1934be6e0e (patch) | |
tree | 3b0029c25d8633c6bff4a2397ac1c8297dda975b /src/cairo-font-face.c | |
parent | e3675f8ac0acb285b2d669c0a44322623dac5fe9 (diff) |
[font-face] Use cairo_font_face_t instead of toy, for nil objects
And with a NULL backend. We are not supposed to read the nil objects
afterall.
If this causes crashes, the crash site should be fixed.
Diffstat (limited to 'src/cairo-font-face.c')
-rw-r--r-- | src/cairo-font-face.c | 55 |
1 files changed, 10 insertions, 45 deletions
diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c index 88e782b9..6161c0ce 100644 --- a/src/cairo-font-face.c +++ b/src/cairo-font-face.c @@ -45,79 +45,44 @@ static const cairo_font_face_backend_t _cairo_toy_font_face_backend; /* #cairo_font_face_t */ -const cairo_toy_font_face_t _cairo_font_face_nil = { - { +const cairo_font_face_t _cairo_font_face_nil = { { 0 }, /* hash_entry */ CAIRO_STATUS_NO_MEMORY, /* status */ CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */ { 0, 0, 0, NULL }, /* user_data */ - &_cairo_toy_font_face_backend - }, - CAIRO_FONT_FAMILY_DEFAULT, /* family */ - TRUE, /* owns_family */ - CAIRO_FONT_SLANT_DEFAULT, /* slant */ - CAIRO_FONT_WEIGHT_DEFAULT, /* weight */ - NULL /* impl_face */ + NULL }; -static const cairo_toy_font_face_t _cairo_font_face_null_pointer = { - { +static const cairo_font_face_t _cairo_font_face_null_pointer = { { 0 }, /* hash_entry */ CAIRO_STATUS_NULL_POINTER, /* status */ CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */ { 0, 0, 0, NULL }, /* user_data */ - &_cairo_toy_font_face_backend - }, - CAIRO_FONT_FAMILY_DEFAULT, /* family */ - TRUE, /* owns_family */ - CAIRO_FONT_SLANT_DEFAULT, /* slant */ - CAIRO_FONT_WEIGHT_DEFAULT, /* weight */ - NULL /* impl_face */ + NULL }; -static const cairo_toy_font_face_t _cairo_font_face_invalid_string = { - { +static const cairo_font_face_t _cairo_font_face_invalid_string = { { 0 }, /* hash_entry */ CAIRO_STATUS_INVALID_STRING, /* status */ CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */ { 0, 0, 0, NULL }, /* user_data */ - &_cairo_toy_font_face_backend - }, - CAIRO_FONT_FAMILY_DEFAULT, /* family */ - TRUE, /* owns_family */ - CAIRO_FONT_SLANT_DEFAULT, /* slant */ - CAIRO_FONT_WEIGHT_DEFAULT, /* weight */ - NULL /* impl_face */ + NULL }; -static const cairo_toy_font_face_t _cairo_font_face_invalid_slant = { - { +static const cairo_font_face_t _cairo_font_face_invalid_slant = { { 0 }, /* hash_entry */ CAIRO_STATUS_INVALID_SLANT, /* status */ CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */ { 0, 0, 0, NULL }, /* user_data */ - &_cairo_toy_font_face_backend - }, - CAIRO_FONT_FAMILY_DEFAULT, /* family */ - TRUE, /* owns_family */ - CAIRO_FONT_SLANT_DEFAULT, /* slant */ - CAIRO_FONT_WEIGHT_DEFAULT, /* weight */ - NULL /* impl_face */ + NULL }; -static const cairo_toy_font_face_t _cairo_font_face_invalid_weight = { - { +static const cairo_font_face_t _cairo_font_face_invalid_weight = { { 0 }, /* hash_entry */ CAIRO_STATUS_INVALID_WEIGHT, /* status */ CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */ { 0, 0, 0, NULL }, /* user_data */ - &_cairo_toy_font_face_backend - }, - CAIRO_FONT_FAMILY_DEFAULT, /* family */ - TRUE, /* owns_family */ - CAIRO_FONT_SLANT_DEFAULT, /* slant */ - CAIRO_FONT_WEIGHT_DEFAULT, /* weight */ - NULL /* impl_face */ + NULL }; cairo_status_t |