[gtk+] Fix some compilation warnings
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Fix some compilation warnings
- Date: Mon, 13 Sep 2010 01:29:14 +0000 (UTC)
commit 7e520d908aab0cd6d31fbabebf54a6fe349e5967
Author: Javier Jardón <jjardon gnome org>
Date: Wed Aug 25 17:55:48 2010 +0200
Fix some compilation warnings
GScanner token field is declared as GTokenType instead a guint
See Glib bug: https://bugzilla.gnome.org/show_bug.cgi?id=627890
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=627962
gtk/gtkbindings.c | 27 ++++++++++++++++-----------
gtk/gtkrc.c | 21 +++++++++++++++------
2 files changed, 31 insertions(+), 17 deletions(-)
---
diff --git a/gtk/gtkbindings.c b/gtk/gtkbindings.c
index 648e572..313b53e 100644
--- a/gtk/gtkbindings.c
+++ b/gtk/gtkbindings.c
@@ -1350,6 +1350,7 @@ gtk_binding_parse_signal (GScanner *scanner,
gboolean negate;
gboolean need_arg;
gboolean seen_comma;
+ guint token;
g_return_val_if_fail (scanner != NULL, G_TOKEN_ERROR);
@@ -1377,8 +1378,9 @@ gtk_binding_parse_signal (GScanner *scanner,
expected_token = G_TOKEN_INT;
else
expected_token = ')';
- g_scanner_get_next_token (scanner);
- switch (scanner->token)
+
+ token = g_scanner_get_next_token (scanner);
+ switch (token)
{
GtkBindingArg *arg;
@@ -1501,14 +1503,15 @@ gtk_binding_parse_bind (GScanner *scanner,
guint keyval = 0;
GdkModifierType modifiers = 0;
gboolean unbind = FALSE;
+ guint token;
g_return_val_if_fail (scanner != NULL, G_TOKEN_ERROR);
-
- g_scanner_get_next_token (scanner);
- if (scanner->token != GTK_RC_TOKEN_BIND &&
- scanner->token != GTK_RC_TOKEN_UNBIND)
+
+ token = g_scanner_get_next_token (scanner);
+ if (token != GTK_RC_TOKEN_BIND &&
+ token != GTK_RC_TOKEN_UNBIND)
return GTK_RC_TOKEN_BIND;
- unbind = scanner->token == GTK_RC_TOKEN_UNBIND;
+ unbind = token == GTK_RC_TOKEN_UNBIND;
g_scanner_get_next_token (scanner);
if (scanner->token != G_TOKEN_STRING)
return G_TOKEN_STRING;
@@ -1559,13 +1562,14 @@ gtk_binding_parse_bind (GScanner *scanner,
guint
_gtk_binding_parse_binding (GScanner *scanner)
{
- gchar *name;
GtkBindingSet *binding_set;
+ gchar *name;
+ guint token;
g_return_val_if_fail (scanner != NULL, G_TOKEN_ERROR);
- g_scanner_get_next_token (scanner);
- if (scanner->token != GTK_RC_TOKEN_BINDING)
+ token = g_scanner_get_next_token (scanner);
+ if (token != GTK_RC_TOKEN_BINDING)
return GTK_RC_TOKEN_BINDING;
g_scanner_get_next_token (scanner);
if (scanner->token != G_TOKEN_STRING)
@@ -1590,7 +1594,8 @@ _gtk_binding_parse_binding (GScanner *scanner)
g_scanner_peek_next_token (scanner);
while (scanner->next_token != '}')
{
- switch (scanner->next_token)
+ guint next_token = scanner->next_token;
+ switch (next_token)
{
guint expected_token;
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
index 15d3581..09f9ab7 100644
--- a/gtk/gtkrc.c
+++ b/gtk/gtkrc.c
@@ -2219,13 +2219,15 @@ gtk_rc_parse_any (GtkRcContext *context,
if (scanner->scope_id == 0)
{
+ guint token;
+
/* if we are in scope 0, we know the symbol names
* that are associated with certain token values.
* so we look them up to make the error messages
* more readable.
*/
- if (expected_token > GTK_RC_TOKEN_INVALID &&
- expected_token < GTK_RC_TOKEN_LAST)
+ if (expected_token > GTK_RC_TOKEN_INVALID &&
+ expected_token < GTK_RC_TOKEN_LAST)
{
const gchar *sym = NULL;
@@ -2237,8 +2239,9 @@ gtk_rc_parse_any (GtkRcContext *context,
msg = g_strconcat ("e.g. `", sym, "'", NULL);
}
- if (scanner->token > GTK_RC_TOKEN_INVALID &&
- scanner->token < GTK_RC_TOKEN_LAST)
+ token = scanner->token;
+ if (token > GTK_RC_TOKEN_INVALID &&
+ token < GTK_RC_TOKEN_LAST)
{
symbol_name = "???";
for (i = 0; i < G_N_ELEMENTS (symbols); i++)
@@ -3324,7 +3327,10 @@ static guint
gtk_rc_parse_xthickness (GScanner *scanner,
GtkRcStyle *style)
{
- if (g_scanner_get_next_token (scanner) != GTK_RC_TOKEN_XTHICKNESS)
+ guint token;
+
+ token = g_scanner_get_next_token (scanner);
+ if (token != GTK_RC_TOKEN_XTHICKNESS)
return GTK_RC_TOKEN_XTHICKNESS;
if (g_scanner_get_next_token (scanner) != G_TOKEN_EQUAL_SIGN)
@@ -3342,7 +3348,10 @@ static guint
gtk_rc_parse_ythickness (GScanner *scanner,
GtkRcStyle *style)
{
- if (g_scanner_get_next_token (scanner) != GTK_RC_TOKEN_YTHICKNESS)
+ guint token;
+
+ token = g_scanner_get_next_token (scanner);
+ if (token != GTK_RC_TOKEN_YTHICKNESS)
return GTK_RC_TOKEN_YTHICKNESS;
if (g_scanner_get_next_token (scanner) != G_TOKEN_EQUAL_SIGN)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]