Commit 7e520d90 authored by Javier Jardon's avatar Javier Jardon
Browse files

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
parent e3fafd75
......@@ -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;
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment