After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 397327 - pango-layout.c: 'pango_layout_is_ellipsized' must return a value
pango-layout.c: 'pango_layout_is_ellipsized' must return a value
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.15.x
Other All
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2007-01-16 17:47 UTC by Kazuki Iwamoto
Modified: 2007-01-16 18:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kazuki Iwamoto 2007-01-16 17:47:33 UTC
Please describe the problem:
'pango_layout_is_ellipsized' returns with a booelan.
But 'g_return_if_fail' returns without a value.
'g_return_val_if_fail' should be used.

Steps to reproduce:
1. compile pango-layout.c
2. pango_layout_is_ellipsized (NULL);

Actual results:
If layout is NULL, pango_layout_is_ellipsized returns a unknown value.

Expected results:
Use 'g_return_val_if_fail'.
For example,

gboolean
pango_layout_is_ellipsized (PangoLayout *layout)
{
  g_return_val_if_fail (layout != NULL, FALSE);

  pango_layout_check_lines (layout);

  return layout->is_ellipsized;
}

Does this happen every time?
/trunk/pango/pango-layout.c

Other information:
Comment 1 Behdad Esfahbod 2007-01-16 18:11:00 UTC
Thanks.

2007-01-16  Behdad Esfahbod  <behdad@gnome.org>

        Bug 397327 – pango-layout.c: 'pango_layout_is_ellipsized' must return
        a value

        * pango/pango-layout.c (pango_layout_is_ellipsized): Use
        g_return_val_if_fail() instead of g_return_if_fail().