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 755548 - atktablecell.c:275: bad comparison ?
atktablecell.c:275: bad comparison ?
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: general
2.18.x
Other Linux
: Normal normal
: ---
Assigned To: ATK maintainer(s)
ATK maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-09-24 14:32 UTC by dcb
Modified: 2015-09-24 15:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description dcb 2015-09-24 14:32:25 UTC
atktablecell.c:275:47: warning: ordered comparison of pointer with integer zero [-Wextra]

  return (row != 0 && column != 0 && row_span > 0 && column_span > 0);

Maybe better code

   return (row != 0 && column != 0 && row_span != 0 && column_span != 0);
Comment 1 Alejandro Piñeiro Iglesias (IRC: infapi00) 2015-09-24 14:54:49 UTC
(In reply to dcb from comment #0)
> atktablecell.c:275:47: warning: ordered comparison of pointer with integer
> zero [-Wextra]
> 
>   return (row != 0 && column != 0 && row_span > 0 && column_span > 0);

Yes, there is an error here.

> Maybe better code
> 
>    return (row != 0 && column != 0 && row_span != 0 && column_span != 0);

I disagree. The problem here is that we are receiving the pointers to store the info, but here we are using the pointer. Take a look to how column_span is computed for example:

  *column_span = atk_table_cell_get_column_span (cell);

So the correct like would be something like this:

  return (*row != 0 && *column != 0 && *row_span > 0 && *column_span > 0);

If you have time for writing a patch I would review it. If not I can do the change myself.

Thanks for reporting.
Comment 2 dcb 2015-09-24 14:58:59 UTC
>So the correct like would be something like this:

>  return (*row != 0 && *column != 0 && *row_span > 0 && *column_span > 0);

Ok.

>I can do the change myself.

That's fine by me.
Comment 3 Alejandro Piñeiro Iglesias (IRC: infapi00) 2015-09-24 15:10:42 UTC
Fixed with commit 381c3f2d67e1a0d751cba03b81e5d28b2e9b309a

Thanks for reporting.