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 627962 - Fix some compiler warnings: GScanner token field is declared as GTokenType instead a guint
Fix some compiler warnings: GScanner token field is declared as GTokenType in...
Product: gtk+
Classification: Platform
Component: .General
Other All
: Normal trivial
: ---
Assigned To: gtk-bugs
Depends on:
Reported: 2010-08-25 16:14 UTC by Javier Jardón (IRC: jjardon)
Modified: 2010-09-13 01:30 UTC
See Also:
GNOME target: ---
GNOME version: ---

Fix some compiler warnings (4.04 KB, patch)
2010-08-25 16:16 UTC, Javier Jardón (IRC: jjardon)
needs-work Details | Review
Fix some compiler warnings.v2 (4.70 KB, patch)
2010-08-25 22:18 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description Javier Jardón (IRC: jjardon) 2010-08-25 16:14:36 UTC
Patch following
Comment 1 Javier Jardón (IRC: jjardon) 2010-08-25 16:16:21 UTC
Created attachment 168750 [details] [review]
Fix some compiler warnings

Related Glib bug: bug #627890
Comment 2 Emmanuele Bassi (:ebassi) 2010-08-25 20:52:32 UTC
Review of attachment 168750 [details] [review]:

generally, looks okay - just some minor fixes that need to be verified.

::: gtk/gtkbindings.c
@@ +1510,2 @@
   g_scanner_get_next_token (scanner);
+  token = (guint) scanner->token;

there shouldn't be a need for the cast here: the assignment should do an implicit cast/

@@ +1571,2 @@
   g_scanner_get_next_token (scanner);
+  if ((guint) scanner->token != GTK_RC_TOKEN_BINDING)

g_scanner_get_next_token() returns the token; since there's a check immediately after, you can turn these two lines into:

  guint token = g_scanner_get_next_token (scanner);
  if (token != GTK_RC_TOKEN_BINDING)

@@ +1595,3 @@
   while (scanner->next_token != '}')
+      guint next_token = (guint) scanner->next_token;

here too, the cast should not be necessary.

::: gtk/gtkrc.c
@@ +2240,3 @@
+                  token = (guint) scanner->token;

the cast should not be necessary

@@ +3328,3 @@
 			 GtkRcStyle *style)
+  if ((guint) g_scanner_get_next_token (scanner) != GTK_RC_TOKEN_XTHICKNESS)

I'd use a temporary variable here, to avoid the ugly cast inside the condition

@@ +3346,3 @@
 			 GtkRcStyle *style)
+  if ((guint) g_scanner_get_next_token (scanner) != GTK_RC_TOKEN_YTHICKNESS)

and here too
Comment 3 Javier Jardón (IRC: jjardon) 2010-08-25 22:18:56 UTC
Created attachment 168773 [details] [review]
Fix some compiler warnings.v2

Here a new patch with your comments, thanks for the review.
Comment 4 Javier Jardón (IRC: jjardon) 2010-09-13 01:30:17 UTC
Comment on attachment 168773 [details] [review]
Fix some compiler warnings.v2

comitted after removing some unneeded guint casts
commit 7e520d908aab0cd6d31fbabebf54a6fe349e5967

Thanks ebassi for the review