GNOME Bugzilla – Bug 627962
Fix some compiler warnings: GScanner token field is declared as GTokenType instead a guint
Last modified: 2010-09-13 01:30:31 UTC
Patch following
Created attachment 168750 [details] [review] Fix some compiler warnings Related Glib bug: bug #627890
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
Created attachment 168773 [details] [review] Fix some compiler warnings.v2 Here a new patch with your comments, thanks for the review.
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