+Sat Jan 2 02:20:59 1999 Tim Janik <timj@gtk.org>
+
+ * ghook.c:
+ (g_hook_list_invoke):
+ (g_hook_list_invoke_check):
+ (g_hook_list_marshal_check):
+ (g_hook_list_marshal): avoid unneccessary extra hook referencing (the
+ explicit hook referencing became unneccessarry with my changes from
+ Mon Dec 21 21:48:29 1998).
+
+ * gmain.c (g_main_iterate): fixed reference counting leaks with
+ premature loop aborts.
+
+Fri Jan 1 22:47:44 1999 Tim Janik <timj@gtk.org>
+
+ * gscanner.c (g_scanner_unexp_token): handle G_TOKEN_IDENTIFIER_NULL
+ as G_TOKEN_IDENTIFIER.
+
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
* configure.in, glib.h:
+Sat Jan 2 02:20:59 1999 Tim Janik <timj@gtk.org>
+
+ * ghook.c:
+ (g_hook_list_invoke):
+ (g_hook_list_invoke_check):
+ (g_hook_list_marshal_check):
+ (g_hook_list_marshal): avoid unneccessary extra hook referencing (the
+ explicit hook referencing became unneccessarry with my changes from
+ Mon Dec 21 21:48:29 1998).
+
+ * gmain.c (g_main_iterate): fixed reference counting leaks with
+ premature loop aborts.
+
+Fri Jan 1 22:47:44 1999 Tim Janik <timj@gtk.org>
+
+ * gscanner.c (g_scanner_unexp_token): handle G_TOKEN_IDENTIFIER_NULL
+ as G_TOKEN_IDENTIFIER.
+
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
* configure.in, glib.h:
+Sat Jan 2 02:20:59 1999 Tim Janik <timj@gtk.org>
+
+ * ghook.c:
+ (g_hook_list_invoke):
+ (g_hook_list_invoke_check):
+ (g_hook_list_marshal_check):
+ (g_hook_list_marshal): avoid unneccessary extra hook referencing (the
+ explicit hook referencing became unneccessarry with my changes from
+ Mon Dec 21 21:48:29 1998).
+
+ * gmain.c (g_main_iterate): fixed reference counting leaks with
+ premature loop aborts.
+
+Fri Jan 1 22:47:44 1999 Tim Janik <timj@gtk.org>
+
+ * gscanner.c (g_scanner_unexp_token): handle G_TOKEN_IDENTIFIER_NULL
+ as G_TOKEN_IDENTIFIER.
+
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
* configure.in, glib.h:
+Sat Jan 2 02:20:59 1999 Tim Janik <timj@gtk.org>
+
+ * ghook.c:
+ (g_hook_list_invoke):
+ (g_hook_list_invoke_check):
+ (g_hook_list_marshal_check):
+ (g_hook_list_marshal): avoid unneccessary extra hook referencing (the
+ explicit hook referencing became unneccessarry with my changes from
+ Mon Dec 21 21:48:29 1998).
+
+ * gmain.c (g_main_iterate): fixed reference counting leaks with
+ premature loop aborts.
+
+Fri Jan 1 22:47:44 1999 Tim Janik <timj@gtk.org>
+
+ * gscanner.c (g_scanner_unexp_token): handle G_TOKEN_IDENTIFIER_NULL
+ as G_TOKEN_IDENTIFIER.
+
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
* configure.in, glib.h:
+Sat Jan 2 02:20:59 1999 Tim Janik <timj@gtk.org>
+
+ * ghook.c:
+ (g_hook_list_invoke):
+ (g_hook_list_invoke_check):
+ (g_hook_list_marshal_check):
+ (g_hook_list_marshal): avoid unneccessary extra hook referencing (the
+ explicit hook referencing became unneccessarry with my changes from
+ Mon Dec 21 21:48:29 1998).
+
+ * gmain.c (g_main_iterate): fixed reference counting leaks with
+ premature loop aborts.
+
+Fri Jan 1 22:47:44 1999 Tim Janik <timj@gtk.org>
+
+ * gscanner.c (g_scanner_unexp_token): handle G_TOKEN_IDENTIFIER_NULL
+ as G_TOKEN_IDENTIFIER.
+
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
* configure.in, glib.h:
+Sat Jan 2 02:20:59 1999 Tim Janik <timj@gtk.org>
+
+ * ghook.c:
+ (g_hook_list_invoke):
+ (g_hook_list_invoke_check):
+ (g_hook_list_marshal_check):
+ (g_hook_list_marshal): avoid unneccessary extra hook referencing (the
+ explicit hook referencing became unneccessarry with my changes from
+ Mon Dec 21 21:48:29 1998).
+
+ * gmain.c (g_main_iterate): fixed reference counting leaks with
+ premature loop aborts.
+
+Fri Jan 1 22:47:44 1999 Tim Janik <timj@gtk.org>
+
+ * gscanner.c (g_scanner_unexp_token): handle G_TOKEN_IDENTIFIER_NULL
+ as G_TOKEN_IDENTIFIER.
+
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
* configure.in, glib.h:
+Sat Jan 2 02:20:59 1999 Tim Janik <timj@gtk.org>
+
+ * ghook.c:
+ (g_hook_list_invoke):
+ (g_hook_list_invoke_check):
+ (g_hook_list_marshal_check):
+ (g_hook_list_marshal): avoid unneccessary extra hook referencing (the
+ explicit hook referencing became unneccessarry with my changes from
+ Mon Dec 21 21:48:29 1998).
+
+ * gmain.c (g_main_iterate): fixed reference counting leaks with
+ premature loop aborts.
+
+Fri Jan 1 22:47:44 1999 Tim Janik <timj@gtk.org>
+
+ * gscanner.c (g_scanner_unexp_token): handle G_TOKEN_IDENTIFIER_NULL
+ as G_TOKEN_IDENTIFIER.
+
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
* configure.in, glib.h:
+Sat Jan 2 02:20:59 1999 Tim Janik <timj@gtk.org>
+
+ * ghook.c:
+ (g_hook_list_invoke):
+ (g_hook_list_invoke_check):
+ (g_hook_list_marshal_check):
+ (g_hook_list_marshal): avoid unneccessary extra hook referencing (the
+ explicit hook referencing became unneccessarry with my changes from
+ Mon Dec 21 21:48:29 1998).
+
+ * gmain.c (g_main_iterate): fixed reference counting leaks with
+ premature loop aborts.
+
+Fri Jan 1 22:47:44 1999 Tim Janik <timj@gtk.org>
+
+ * gscanner.c (g_scanner_unexp_token): handle G_TOKEN_IDENTIFIER_NULL
+ as G_TOKEN_IDENTIFIER.
+
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
* configure.in, glib.h:
hook = g_hook_first_valid (hook_list, may_recurse);
while (hook)
{
- GHook *tmp;
GHookFunc func;
gboolean was_in_call;
- g_hook_ref (hook_list, hook);
func = (GHookFunc) hook->func;
was_in_call = G_HOOK_IN_CALL (hook);
if (!was_in_call)
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
- tmp = g_hook_next_valid (hook_list, hook, may_recurse);
-
- g_hook_unref (hook_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (hook_list, hook, may_recurse);
}
}
hook = g_hook_first_valid (hook_list, may_recurse);
while (hook)
{
- GHook *tmp;
GHookCheckFunc func;
gboolean was_in_call;
gboolean need_destroy;
- g_hook_ref (hook_list, hook);
func = (GHookCheckFunc) hook->func;
was_in_call = G_HOOK_IN_CALL (hook);
if (need_destroy)
g_hook_destroy_link (hook_list, hook);
- tmp = g_hook_next_valid (hook_list, hook, may_recurse);
-
- g_hook_unref (hook_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (hook_list, hook, may_recurse);
}
}
hook = g_hook_first_valid (hook_list, may_recurse);
while (hook)
{
- GHook *tmp;
gboolean was_in_call;
gboolean need_destroy;
- g_hook_ref (hook_list, hook);
-
was_in_call = G_HOOK_IN_CALL (hook);
hook->flags |= G_HOOK_FLAG_IN_CALL;
need_destroy = !marshaller (hook, data);
if (need_destroy)
g_hook_destroy_link (hook_list, hook);
- tmp = g_hook_next_valid (hook_list, hook, may_recurse);
-
- g_hook_unref (hook_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (hook_list, hook, may_recurse);
}
}
hook = g_hook_first_valid (hook_list, may_recurse);
while (hook)
{
- GHook *tmp;
gboolean was_in_call;
- g_hook_ref (hook_list, hook);
-
was_in_call = G_HOOK_IN_CALL (hook);
hook->flags |= G_HOOK_FLAG_IN_CALL;
marshaller (hook, data);
if (!was_in_call)
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
- tmp = g_hook_next_valid (hook_list, hook, may_recurse);
-
- g_hook_unref (hook_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (hook_list, hook, may_recurse);
}
}
hook = g_hook_first_valid (hook_list, may_recurse);
while (hook)
{
- GHook *tmp;
GHookFunc func;
gboolean was_in_call;
- g_hook_ref (hook_list, hook);
func = (GHookFunc) hook->func;
was_in_call = G_HOOK_IN_CALL (hook);
if (!was_in_call)
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
- tmp = g_hook_next_valid (hook_list, hook, may_recurse);
-
- g_hook_unref (hook_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (hook_list, hook, may_recurse);
}
}
hook = g_hook_first_valid (hook_list, may_recurse);
while (hook)
{
- GHook *tmp;
GHookCheckFunc func;
gboolean was_in_call;
gboolean need_destroy;
- g_hook_ref (hook_list, hook);
func = (GHookCheckFunc) hook->func;
was_in_call = G_HOOK_IN_CALL (hook);
if (need_destroy)
g_hook_destroy_link (hook_list, hook);
- tmp = g_hook_next_valid (hook_list, hook, may_recurse);
-
- g_hook_unref (hook_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (hook_list, hook, may_recurse);
}
}
hook = g_hook_first_valid (hook_list, may_recurse);
while (hook)
{
- GHook *tmp;
gboolean was_in_call;
gboolean need_destroy;
- g_hook_ref (hook_list, hook);
-
was_in_call = G_HOOK_IN_CALL (hook);
hook->flags |= G_HOOK_FLAG_IN_CALL;
need_destroy = !marshaller (hook, data);
if (need_destroy)
g_hook_destroy_link (hook_list, hook);
- tmp = g_hook_next_valid (hook_list, hook, may_recurse);
-
- g_hook_unref (hook_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (hook_list, hook, may_recurse);
}
}
hook = g_hook_first_valid (hook_list, may_recurse);
while (hook)
{
- GHook *tmp;
gboolean was_in_call;
- g_hook_ref (hook_list, hook);
-
was_in_call = G_HOOK_IN_CALL (hook);
hook->flags |= G_HOOK_FLAG_IN_CALL;
marshaller (hook, data);
if (!was_in_call)
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
- tmp = g_hook_next_valid (hook_list, hook, may_recurse);
-
- g_hook_unref (hook_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (hook_list, hook, may_recurse);
}
}
}
}
- g_hook_unref (&source_list, (GHook *)source);
+ g_hook_unref (&source_list, (GHook*) source);
}
}
while (hook)
{
GSource *source = (GSource *)hook;
- GHook *tmp;
gint source_timeout = -1;
if ((n_ready > 0) && (source->priority > current_priority))
- break;
+ {
+ g_hook_unref (&source_list, hook);
+ break;
+ }
if (G_HOOK_IN_CALL (hook) && !(hook->flags & G_SOURCE_CAN_RECURSE))
{
hook = g_hook_next_valid (&source_list, hook, TRUE);
continue;
}
- g_hook_ref (&source_list, hook);
-
if (hook->flags & G_SOURCE_READY ||
((GSourceFuncs *) hook->func)->prepare (source->source_data,
¤t_time,
timeout = MIN (timeout, source_timeout);
}
- tmp = g_hook_next_valid (&source_list, hook, TRUE);
-
- g_hook_unref (&source_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (&source_list, hook, TRUE);
}
/* poll(), if necessary */
while (hook)
{
GSource *source = (GSource *)hook;
- GHook *tmp;
if ((n_ready > 0) && (source->priority > current_priority))
- break;
+ {
+ g_hook_unref (&source_list, hook);
+ break;
+ }
if (G_HOOK_IN_CALL (hook) && !(hook->flags & G_SOURCE_CAN_RECURSE))
{
hook = g_hook_next_valid (&source_list, hook, TRUE);
continue;
}
- g_hook_ref (&source_list, hook);
-
if (hook->flags & G_SOURCE_READY ||
((GSourceFuncs *) hook->func)->check (source->source_data,
¤t_time))
}
}
- tmp = g_hook_next_valid (&source_list, hook, TRUE);
-
- g_hook_unref (&source_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (&source_list, hook, TRUE);
}
/* Now invoke the callbacks */
{
switch (*token_p)
{
- case G_TOKEN_STRING:
- case G_TOKEN_IDENTIFIER:
- case G_TOKEN_IDENTIFIER_NULL:
- case G_TOKEN_COMMENT_SINGLE:
- case G_TOKEN_COMMENT_MULTI:
+ case G_TOKEN_STRING:
+ case G_TOKEN_IDENTIFIER:
+ case G_TOKEN_IDENTIFIER_NULL:
+ case G_TOKEN_COMMENT_SINGLE:
+ case G_TOKEN_COMMENT_MULTI:
g_free (value_p->v_string);
break;
switch (scanner->token)
{
- case G_TOKEN_EOF:
+ case G_TOKEN_EOF:
g_snprintf (token_string, token_string_len, "end of file");
break;
break;
}
/* fall through */
- case G_TOKEN_SYMBOL:
+ case G_TOKEN_SYMBOL:
if (expected_token == G_TOKEN_SYMBOL ||
(scanner->config->symbol_2_token &&
expected_token > G_TOKEN_LAST))
symbol_spec);
break;
- case G_TOKEN_ERROR:
+ case G_TOKEN_ERROR:
print_unexp = FALSE;
expected_token = G_TOKEN_NONE;
switch (scanner->value.v_error)
{
- case G_ERR_UNEXP_EOF:
+ case G_ERR_UNEXP_EOF:
g_snprintf (token_string, token_string_len, "scanner: unexpected end of file");
break;
- case G_ERR_UNEXP_EOF_IN_STRING:
+ case G_ERR_UNEXP_EOF_IN_STRING:
g_snprintf (token_string, token_string_len, "scanner: unterminated string constant");
break;
- case G_ERR_UNEXP_EOF_IN_COMMENT:
+ case G_ERR_UNEXP_EOF_IN_COMMENT:
g_snprintf (token_string, token_string_len, "scanner: unterminated comment");
break;
- case G_ERR_NON_DIGIT_IN_CONST:
+ case G_ERR_NON_DIGIT_IN_CONST:
g_snprintf (token_string, token_string_len, "scanner: non digit in constant");
break;
- case G_ERR_FLOAT_RADIX:
+ case G_ERR_FLOAT_RADIX:
g_snprintf (token_string, token_string_len, "scanner: invalid radix for floating constant");
break;
- case G_ERR_FLOAT_MALFORMED:
+ case G_ERR_FLOAT_MALFORMED:
g_snprintf (token_string, token_string_len, "scanner: malformed floating constant");
break;
- case G_ERR_DIGIT_RADIX:
+ case G_ERR_DIGIT_RADIX:
g_snprintf (token_string, token_string_len, "scanner: digit is beyond radix");
break;
- case G_ERR_UNKNOWN:
+ case G_ERR_UNKNOWN:
default:
g_snprintf (token_string, token_string_len, "scanner: unknown error");
break;
}
break;
- case G_TOKEN_CHAR:
+ case G_TOKEN_CHAR:
g_snprintf (token_string, token_string_len, "character `%c'", scanner->value.v_char);
break;
- case G_TOKEN_IDENTIFIER:
- if (expected_token == G_TOKEN_IDENTIFIER)
+ case G_TOKEN_IDENTIFIER:
+ case G_TOKEN_IDENTIFIER_NULL:
+ if (expected_token == G_TOKEN_IDENTIFIER ||
+ expected_token == G_TOKEN_IDENTIFIER_NULL)
print_unexp = FALSE;
g_snprintf (token_string,
token_string_len,
scanner->value.v_string);
break;
- case G_TOKEN_BINARY:
- case G_TOKEN_OCTAL:
- case G_TOKEN_INT:
- case G_TOKEN_HEX:
+ case G_TOKEN_BINARY:
+ case G_TOKEN_OCTAL:
+ case G_TOKEN_INT:
+ case G_TOKEN_HEX:
g_snprintf (token_string, token_string_len, "number `%ld'", scanner->value.v_int);
break;
- case G_TOKEN_FLOAT:
+ case G_TOKEN_FLOAT:
g_snprintf (token_string, token_string_len, "number `%.3f'", scanner->value.v_float);
break;
- case G_TOKEN_STRING:
+ case G_TOKEN_STRING:
if (expected_token == G_TOKEN_STRING)
print_unexp = FALSE;
g_snprintf (token_string,
token_string[token_string_len - 1] = 0;
break;
- case G_TOKEN_COMMENT_SINGLE:
- case G_TOKEN_COMMENT_MULTI:
+ case G_TOKEN_COMMENT_SINGLE:
+ case G_TOKEN_COMMENT_MULTI:
g_snprintf (token_string, token_string_len, "comment");
break;
- case G_TOKEN_NONE:
+ case G_TOKEN_NONE:
/* somehow the user's parsing code is screwed, there isn't much
* we can do about it.
* Note, a common case to trigger this is
break;
}
/* fall through */
- case G_TOKEN_SYMBOL:
+ case G_TOKEN_SYMBOL:
need_valid = (scanner->token == G_TOKEN_SYMBOL ||
(scanner->config->symbol_2_token &&
scanner->token > G_TOKEN_LAST));
/* FIXME: should we attempt to lookup the symbol_name for symbol_2_token? */
break;
- case G_TOKEN_INT:
+ case G_TOKEN_INT:
g_snprintf (expected_string, expected_string_len, "number (integer)");
break;
- case G_TOKEN_FLOAT:
+ case G_TOKEN_FLOAT:
g_snprintf (expected_string, expected_string_len, "number (float)");
break;
- case G_TOKEN_STRING:
+ case G_TOKEN_STRING:
g_snprintf (expected_string,
expected_string_len,
"%sstring constant",
scanner->token == G_TOKEN_STRING ? "valid " : "");
break;
- case G_TOKEN_IDENTIFIER:
+ case G_TOKEN_IDENTIFIER:
+ case G_TOKEN_IDENTIFIER_NULL:
g_snprintf (expected_string,
expected_string_len,
"%s%s",
- scanner->token == G_TOKEN_IDENTIFIER ? "valid " : "",
+ (scanner->token == G_TOKEN_IDENTIFIER_NULL ||
+ scanner->token == G_TOKEN_IDENTIFIER ? "valid " : ""),
identifier_spec);
break;
- case G_TOKEN_NONE:
+ case G_TOKEN_NONE:
break;
}
switch (ch)
{
- case 0:
+ case 0:
token = G_TOKEN_EOF;
(*position_p)++;
/* ch = 0; */
break;
- case '/':
+ case '/':
if (!config->scan_comment_multi ||
g_scanner_peek_next_char (scanner) != '*')
goto default_case;
ch = 0;
break;
- case '\'':
+ case '\'':
if (!config->scan_string_sq)
goto default_case;
token = G_TOKEN_STRING;
ch = 0;
break;
- case '"':
+ case '"':
if (!config->scan_string_dq)
goto default_case;
token = G_TOKEN_STRING;
register guint i;
register guint fchar;
- case 0:
+ case 0:
break;
- case '\\':
+ case '\\':
gstring = g_string_append_c (gstring, '\\');
break;
- case 'n':
+ case 'n':
gstring = g_string_append_c (gstring, '\n');
break;
- case 't':
+ case 't':
gstring = g_string_append_c (gstring, '\t');
break;
- case 'r':
+ case 'r':
gstring = g_string_append_c (gstring, '\r');
break;
- case 'b':
+ case 'b':
gstring = g_string_append_c (gstring, '\b');
break;
- case 'f':
+ case 'f':
gstring = g_string_append_c (gstring, '\f');
break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
i = ch - '0';
fchar = g_scanner_peek_next_char (scanner);
if (fchar >= '0' && fchar <= '7')
ch = 0;
break;
- case '.':
+ case '.':
if (!config->scan_float)
goto default_case;
token = G_TOKEN_FLOAT;
ch = g_scanner_get_char (scanner, line_p, position_p);
goto number_parsing;
- case '$':
+ case '$':
if (!config->scan_hex_dollar)
goto default_case;
token = G_TOKEN_HEX;
ch = g_scanner_get_char (scanner, line_p, position_p);
goto number_parsing;
- case '0':
+ case '0':
if (config->scan_octal)
token = G_TOKEN_OCTAL;
else
else
ch = '0';
/* fall through */
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
number_parsing:
{
register gboolean in_number = TRUE;
}
}
- g_hook_unref (&source_list, (GHook *)source);
+ g_hook_unref (&source_list, (GHook*) source);
}
}
while (hook)
{
GSource *source = (GSource *)hook;
- GHook *tmp;
gint source_timeout = -1;
if ((n_ready > 0) && (source->priority > current_priority))
- break;
+ {
+ g_hook_unref (&source_list, hook);
+ break;
+ }
if (G_HOOK_IN_CALL (hook) && !(hook->flags & G_SOURCE_CAN_RECURSE))
{
hook = g_hook_next_valid (&source_list, hook, TRUE);
continue;
}
- g_hook_ref (&source_list, hook);
-
if (hook->flags & G_SOURCE_READY ||
((GSourceFuncs *) hook->func)->prepare (source->source_data,
¤t_time,
timeout = MIN (timeout, source_timeout);
}
- tmp = g_hook_next_valid (&source_list, hook, TRUE);
-
- g_hook_unref (&source_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (&source_list, hook, TRUE);
}
/* poll(), if necessary */
while (hook)
{
GSource *source = (GSource *)hook;
- GHook *tmp;
if ((n_ready > 0) && (source->priority > current_priority))
- break;
+ {
+ g_hook_unref (&source_list, hook);
+ break;
+ }
if (G_HOOK_IN_CALL (hook) && !(hook->flags & G_SOURCE_CAN_RECURSE))
{
hook = g_hook_next_valid (&source_list, hook, TRUE);
continue;
}
- g_hook_ref (&source_list, hook);
-
if (hook->flags & G_SOURCE_READY ||
((GSourceFuncs *) hook->func)->check (source->source_data,
¤t_time))
}
}
- tmp = g_hook_next_valid (&source_list, hook, TRUE);
-
- g_hook_unref (&source_list, hook);
- hook = tmp;
+ hook = g_hook_next_valid (&source_list, hook, TRUE);
}
/* Now invoke the callbacks */
{
switch (*token_p)
{
- case G_TOKEN_STRING:
- case G_TOKEN_IDENTIFIER:
- case G_TOKEN_IDENTIFIER_NULL:
- case G_TOKEN_COMMENT_SINGLE:
- case G_TOKEN_COMMENT_MULTI:
+ case G_TOKEN_STRING:
+ case G_TOKEN_IDENTIFIER:
+ case G_TOKEN_IDENTIFIER_NULL:
+ case G_TOKEN_COMMENT_SINGLE:
+ case G_TOKEN_COMMENT_MULTI:
g_free (value_p->v_string);
break;
switch (scanner->token)
{
- case G_TOKEN_EOF:
+ case G_TOKEN_EOF:
g_snprintf (token_string, token_string_len, "end of file");
break;
break;
}
/* fall through */
- case G_TOKEN_SYMBOL:
+ case G_TOKEN_SYMBOL:
if (expected_token == G_TOKEN_SYMBOL ||
(scanner->config->symbol_2_token &&
expected_token > G_TOKEN_LAST))
symbol_spec);
break;
- case G_TOKEN_ERROR:
+ case G_TOKEN_ERROR:
print_unexp = FALSE;
expected_token = G_TOKEN_NONE;
switch (scanner->value.v_error)
{
- case G_ERR_UNEXP_EOF:
+ case G_ERR_UNEXP_EOF:
g_snprintf (token_string, token_string_len, "scanner: unexpected end of file");
break;
- case G_ERR_UNEXP_EOF_IN_STRING:
+ case G_ERR_UNEXP_EOF_IN_STRING:
g_snprintf (token_string, token_string_len, "scanner: unterminated string constant");
break;
- case G_ERR_UNEXP_EOF_IN_COMMENT:
+ case G_ERR_UNEXP_EOF_IN_COMMENT:
g_snprintf (token_string, token_string_len, "scanner: unterminated comment");
break;
- case G_ERR_NON_DIGIT_IN_CONST:
+ case G_ERR_NON_DIGIT_IN_CONST:
g_snprintf (token_string, token_string_len, "scanner: non digit in constant");
break;
- case G_ERR_FLOAT_RADIX:
+ case G_ERR_FLOAT_RADIX:
g_snprintf (token_string, token_string_len, "scanner: invalid radix for floating constant");
break;
- case G_ERR_FLOAT_MALFORMED:
+ case G_ERR_FLOAT_MALFORMED:
g_snprintf (token_string, token_string_len, "scanner: malformed floating constant");
break;
- case G_ERR_DIGIT_RADIX:
+ case G_ERR_DIGIT_RADIX:
g_snprintf (token_string, token_string_len, "scanner: digit is beyond radix");
break;
- case G_ERR_UNKNOWN:
+ case G_ERR_UNKNOWN:
default:
g_snprintf (token_string, token_string_len, "scanner: unknown error");
break;
}
break;
- case G_TOKEN_CHAR:
+ case G_TOKEN_CHAR:
g_snprintf (token_string, token_string_len, "character `%c'", scanner->value.v_char);
break;
- case G_TOKEN_IDENTIFIER:
- if (expected_token == G_TOKEN_IDENTIFIER)
+ case G_TOKEN_IDENTIFIER:
+ case G_TOKEN_IDENTIFIER_NULL:
+ if (expected_token == G_TOKEN_IDENTIFIER ||
+ expected_token == G_TOKEN_IDENTIFIER_NULL)
print_unexp = FALSE;
g_snprintf (token_string,
token_string_len,
scanner->value.v_string);
break;
- case G_TOKEN_BINARY:
- case G_TOKEN_OCTAL:
- case G_TOKEN_INT:
- case G_TOKEN_HEX:
+ case G_TOKEN_BINARY:
+ case G_TOKEN_OCTAL:
+ case G_TOKEN_INT:
+ case G_TOKEN_HEX:
g_snprintf (token_string, token_string_len, "number `%ld'", scanner->value.v_int);
break;
- case G_TOKEN_FLOAT:
+ case G_TOKEN_FLOAT:
g_snprintf (token_string, token_string_len, "number `%.3f'", scanner->value.v_float);
break;
- case G_TOKEN_STRING:
+ case G_TOKEN_STRING:
if (expected_token == G_TOKEN_STRING)
print_unexp = FALSE;
g_snprintf (token_string,
token_string[token_string_len - 1] = 0;
break;
- case G_TOKEN_COMMENT_SINGLE:
- case G_TOKEN_COMMENT_MULTI:
+ case G_TOKEN_COMMENT_SINGLE:
+ case G_TOKEN_COMMENT_MULTI:
g_snprintf (token_string, token_string_len, "comment");
break;
- case G_TOKEN_NONE:
+ case G_TOKEN_NONE:
/* somehow the user's parsing code is screwed, there isn't much
* we can do about it.
* Note, a common case to trigger this is
break;
}
/* fall through */
- case G_TOKEN_SYMBOL:
+ case G_TOKEN_SYMBOL:
need_valid = (scanner->token == G_TOKEN_SYMBOL ||
(scanner->config->symbol_2_token &&
scanner->token > G_TOKEN_LAST));
/* FIXME: should we attempt to lookup the symbol_name for symbol_2_token? */
break;
- case G_TOKEN_INT:
+ case G_TOKEN_INT:
g_snprintf (expected_string, expected_string_len, "number (integer)");
break;
- case G_TOKEN_FLOAT:
+ case G_TOKEN_FLOAT:
g_snprintf (expected_string, expected_string_len, "number (float)");
break;
- case G_TOKEN_STRING:
+ case G_TOKEN_STRING:
g_snprintf (expected_string,
expected_string_len,
"%sstring constant",
scanner->token == G_TOKEN_STRING ? "valid " : "");
break;
- case G_TOKEN_IDENTIFIER:
+ case G_TOKEN_IDENTIFIER:
+ case G_TOKEN_IDENTIFIER_NULL:
g_snprintf (expected_string,
expected_string_len,
"%s%s",
- scanner->token == G_TOKEN_IDENTIFIER ? "valid " : "",
+ (scanner->token == G_TOKEN_IDENTIFIER_NULL ||
+ scanner->token == G_TOKEN_IDENTIFIER ? "valid " : ""),
identifier_spec);
break;
- case G_TOKEN_NONE:
+ case G_TOKEN_NONE:
break;
}
switch (ch)
{
- case 0:
+ case 0:
token = G_TOKEN_EOF;
(*position_p)++;
/* ch = 0; */
break;
- case '/':
+ case '/':
if (!config->scan_comment_multi ||
g_scanner_peek_next_char (scanner) != '*')
goto default_case;
ch = 0;
break;
- case '\'':
+ case '\'':
if (!config->scan_string_sq)
goto default_case;
token = G_TOKEN_STRING;
ch = 0;
break;
- case '"':
+ case '"':
if (!config->scan_string_dq)
goto default_case;
token = G_TOKEN_STRING;
register guint i;
register guint fchar;
- case 0:
+ case 0:
break;
- case '\\':
+ case '\\':
gstring = g_string_append_c (gstring, '\\');
break;
- case 'n':
+ case 'n':
gstring = g_string_append_c (gstring, '\n');
break;
- case 't':
+ case 't':
gstring = g_string_append_c (gstring, '\t');
break;
- case 'r':
+ case 'r':
gstring = g_string_append_c (gstring, '\r');
break;
- case 'b':
+ case 'b':
gstring = g_string_append_c (gstring, '\b');
break;
- case 'f':
+ case 'f':
gstring = g_string_append_c (gstring, '\f');
break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
i = ch - '0';
fchar = g_scanner_peek_next_char (scanner);
if (fchar >= '0' && fchar <= '7')
ch = 0;
break;
- case '.':
+ case '.':
if (!config->scan_float)
goto default_case;
token = G_TOKEN_FLOAT;
ch = g_scanner_get_char (scanner, line_p, position_p);
goto number_parsing;
- case '$':
+ case '$':
if (!config->scan_hex_dollar)
goto default_case;
token = G_TOKEN_HEX;
ch = g_scanner_get_char (scanner, line_p, position_p);
goto number_parsing;
- case '0':
+ case '0':
if (config->scan_octal)
token = G_TOKEN_OCTAL;
else
else
ch = '0';
/* fall through */
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
number_parsing:
{
register gboolean in_number = TRUE;