mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
avoid unneccessary extra hook referencing (the explicit hook referencing
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.
This commit is contained in:
parent
0e2f565f14
commit
00e064d2af
18
ChangeLog
18
ChangeLog
@ -1,3 +1,21 @@
|
|||||||
|
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>
|
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
|
||||||
|
|
||||||
* configure.in, glib.h:
|
* configure.in, glib.h:
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
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>
|
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
|
||||||
|
|
||||||
* configure.in, glib.h:
|
* configure.in, glib.h:
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
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>
|
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
|
||||||
|
|
||||||
* configure.in, glib.h:
|
* configure.in, glib.h:
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
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>
|
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
|
||||||
|
|
||||||
* configure.in, glib.h:
|
* configure.in, glib.h:
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
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>
|
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
|
||||||
|
|
||||||
* configure.in, glib.h:
|
* configure.in, glib.h:
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
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>
|
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
|
||||||
|
|
||||||
* configure.in, glib.h:
|
* configure.in, glib.h:
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
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>
|
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
|
||||||
|
|
||||||
* configure.in, glib.h:
|
* configure.in, glib.h:
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
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>
|
Fri Jan 1 17:09:19 EST 1999 Jeff Garzik <jgarzik@pobox.com>
|
||||||
|
|
||||||
* configure.in, glib.h:
|
* configure.in, glib.h:
|
||||||
|
30
ghook.c
30
ghook.c
@ -273,11 +273,9 @@ g_hook_list_invoke (GHookList *hook_list,
|
|||||||
hook = g_hook_first_valid (hook_list, may_recurse);
|
hook = g_hook_first_valid (hook_list, may_recurse);
|
||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GHook *tmp;
|
|
||||||
GHookFunc func;
|
GHookFunc func;
|
||||||
gboolean was_in_call;
|
gboolean was_in_call;
|
||||||
|
|
||||||
g_hook_ref (hook_list, hook);
|
|
||||||
func = (GHookFunc) hook->func;
|
func = (GHookFunc) hook->func;
|
||||||
|
|
||||||
was_in_call = G_HOOK_IN_CALL (hook);
|
was_in_call = G_HOOK_IN_CALL (hook);
|
||||||
@ -286,10 +284,7 @@ g_hook_list_invoke (GHookList *hook_list,
|
|||||||
if (!was_in_call)
|
if (!was_in_call)
|
||||||
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
|
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
|
||||||
|
|
||||||
tmp = g_hook_next_valid (hook_list, hook, may_recurse);
|
hook = g_hook_next_valid (hook_list, hook, may_recurse);
|
||||||
|
|
||||||
g_hook_unref (hook_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,12 +300,10 @@ g_hook_list_invoke_check (GHookList *hook_list,
|
|||||||
hook = g_hook_first_valid (hook_list, may_recurse);
|
hook = g_hook_first_valid (hook_list, may_recurse);
|
||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GHook *tmp;
|
|
||||||
GHookCheckFunc func;
|
GHookCheckFunc func;
|
||||||
gboolean was_in_call;
|
gboolean was_in_call;
|
||||||
gboolean need_destroy;
|
gboolean need_destroy;
|
||||||
|
|
||||||
g_hook_ref (hook_list, hook);
|
|
||||||
func = (GHookCheckFunc) hook->func;
|
func = (GHookCheckFunc) hook->func;
|
||||||
|
|
||||||
was_in_call = G_HOOK_IN_CALL (hook);
|
was_in_call = G_HOOK_IN_CALL (hook);
|
||||||
@ -321,10 +314,7 @@ g_hook_list_invoke_check (GHookList *hook_list,
|
|||||||
if (need_destroy)
|
if (need_destroy)
|
||||||
g_hook_destroy_link (hook_list, hook);
|
g_hook_destroy_link (hook_list, hook);
|
||||||
|
|
||||||
tmp = g_hook_next_valid (hook_list, hook, may_recurse);
|
hook = g_hook_next_valid (hook_list, hook, may_recurse);
|
||||||
|
|
||||||
g_hook_unref (hook_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,12 +333,9 @@ g_hook_list_marshal_check (GHookList *hook_list,
|
|||||||
hook = g_hook_first_valid (hook_list, may_recurse);
|
hook = g_hook_first_valid (hook_list, may_recurse);
|
||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GHook *tmp;
|
|
||||||
gboolean was_in_call;
|
gboolean was_in_call;
|
||||||
gboolean need_destroy;
|
gboolean need_destroy;
|
||||||
|
|
||||||
g_hook_ref (hook_list, hook);
|
|
||||||
|
|
||||||
was_in_call = G_HOOK_IN_CALL (hook);
|
was_in_call = G_HOOK_IN_CALL (hook);
|
||||||
hook->flags |= G_HOOK_FLAG_IN_CALL;
|
hook->flags |= G_HOOK_FLAG_IN_CALL;
|
||||||
need_destroy = !marshaller (hook, data);
|
need_destroy = !marshaller (hook, data);
|
||||||
@ -357,10 +344,7 @@ g_hook_list_marshal_check (GHookList *hook_list,
|
|||||||
if (need_destroy)
|
if (need_destroy)
|
||||||
g_hook_destroy_link (hook_list, hook);
|
g_hook_destroy_link (hook_list, hook);
|
||||||
|
|
||||||
tmp = g_hook_next_valid (hook_list, hook, may_recurse);
|
hook = g_hook_next_valid (hook_list, hook, may_recurse);
|
||||||
|
|
||||||
g_hook_unref (hook_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,21 +363,15 @@ g_hook_list_marshal (GHookList *hook_list,
|
|||||||
hook = g_hook_first_valid (hook_list, may_recurse);
|
hook = g_hook_first_valid (hook_list, may_recurse);
|
||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GHook *tmp;
|
|
||||||
gboolean was_in_call;
|
gboolean was_in_call;
|
||||||
|
|
||||||
g_hook_ref (hook_list, hook);
|
|
||||||
|
|
||||||
was_in_call = G_HOOK_IN_CALL (hook);
|
was_in_call = G_HOOK_IN_CALL (hook);
|
||||||
hook->flags |= G_HOOK_FLAG_IN_CALL;
|
hook->flags |= G_HOOK_FLAG_IN_CALL;
|
||||||
marshaller (hook, data);
|
marshaller (hook, data);
|
||||||
if (!was_in_call)
|
if (!was_in_call)
|
||||||
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
|
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
|
||||||
|
|
||||||
tmp = g_hook_next_valid (hook_list, hook, may_recurse);
|
hook = g_hook_next_valid (hook_list, hook, may_recurse);
|
||||||
|
|
||||||
g_hook_unref (hook_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
30
glib/ghook.c
30
glib/ghook.c
@ -273,11 +273,9 @@ g_hook_list_invoke (GHookList *hook_list,
|
|||||||
hook = g_hook_first_valid (hook_list, may_recurse);
|
hook = g_hook_first_valid (hook_list, may_recurse);
|
||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GHook *tmp;
|
|
||||||
GHookFunc func;
|
GHookFunc func;
|
||||||
gboolean was_in_call;
|
gboolean was_in_call;
|
||||||
|
|
||||||
g_hook_ref (hook_list, hook);
|
|
||||||
func = (GHookFunc) hook->func;
|
func = (GHookFunc) hook->func;
|
||||||
|
|
||||||
was_in_call = G_HOOK_IN_CALL (hook);
|
was_in_call = G_HOOK_IN_CALL (hook);
|
||||||
@ -286,10 +284,7 @@ g_hook_list_invoke (GHookList *hook_list,
|
|||||||
if (!was_in_call)
|
if (!was_in_call)
|
||||||
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
|
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
|
||||||
|
|
||||||
tmp = g_hook_next_valid (hook_list, hook, may_recurse);
|
hook = g_hook_next_valid (hook_list, hook, may_recurse);
|
||||||
|
|
||||||
g_hook_unref (hook_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,12 +300,10 @@ g_hook_list_invoke_check (GHookList *hook_list,
|
|||||||
hook = g_hook_first_valid (hook_list, may_recurse);
|
hook = g_hook_first_valid (hook_list, may_recurse);
|
||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GHook *tmp;
|
|
||||||
GHookCheckFunc func;
|
GHookCheckFunc func;
|
||||||
gboolean was_in_call;
|
gboolean was_in_call;
|
||||||
gboolean need_destroy;
|
gboolean need_destroy;
|
||||||
|
|
||||||
g_hook_ref (hook_list, hook);
|
|
||||||
func = (GHookCheckFunc) hook->func;
|
func = (GHookCheckFunc) hook->func;
|
||||||
|
|
||||||
was_in_call = G_HOOK_IN_CALL (hook);
|
was_in_call = G_HOOK_IN_CALL (hook);
|
||||||
@ -321,10 +314,7 @@ g_hook_list_invoke_check (GHookList *hook_list,
|
|||||||
if (need_destroy)
|
if (need_destroy)
|
||||||
g_hook_destroy_link (hook_list, hook);
|
g_hook_destroy_link (hook_list, hook);
|
||||||
|
|
||||||
tmp = g_hook_next_valid (hook_list, hook, may_recurse);
|
hook = g_hook_next_valid (hook_list, hook, may_recurse);
|
||||||
|
|
||||||
g_hook_unref (hook_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,12 +333,9 @@ g_hook_list_marshal_check (GHookList *hook_list,
|
|||||||
hook = g_hook_first_valid (hook_list, may_recurse);
|
hook = g_hook_first_valid (hook_list, may_recurse);
|
||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GHook *tmp;
|
|
||||||
gboolean was_in_call;
|
gboolean was_in_call;
|
||||||
gboolean need_destroy;
|
gboolean need_destroy;
|
||||||
|
|
||||||
g_hook_ref (hook_list, hook);
|
|
||||||
|
|
||||||
was_in_call = G_HOOK_IN_CALL (hook);
|
was_in_call = G_HOOK_IN_CALL (hook);
|
||||||
hook->flags |= G_HOOK_FLAG_IN_CALL;
|
hook->flags |= G_HOOK_FLAG_IN_CALL;
|
||||||
need_destroy = !marshaller (hook, data);
|
need_destroy = !marshaller (hook, data);
|
||||||
@ -357,10 +344,7 @@ g_hook_list_marshal_check (GHookList *hook_list,
|
|||||||
if (need_destroy)
|
if (need_destroy)
|
||||||
g_hook_destroy_link (hook_list, hook);
|
g_hook_destroy_link (hook_list, hook);
|
||||||
|
|
||||||
tmp = g_hook_next_valid (hook_list, hook, may_recurse);
|
hook = g_hook_next_valid (hook_list, hook, may_recurse);
|
||||||
|
|
||||||
g_hook_unref (hook_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,21 +363,15 @@ g_hook_list_marshal (GHookList *hook_list,
|
|||||||
hook = g_hook_first_valid (hook_list, may_recurse);
|
hook = g_hook_first_valid (hook_list, may_recurse);
|
||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GHook *tmp;
|
|
||||||
gboolean was_in_call;
|
gboolean was_in_call;
|
||||||
|
|
||||||
g_hook_ref (hook_list, hook);
|
|
||||||
|
|
||||||
was_in_call = G_HOOK_IN_CALL (hook);
|
was_in_call = G_HOOK_IN_CALL (hook);
|
||||||
hook->flags |= G_HOOK_FLAG_IN_CALL;
|
hook->flags |= G_HOOK_FLAG_IN_CALL;
|
||||||
marshaller (hook, data);
|
marshaller (hook, data);
|
||||||
if (!was_in_call)
|
if (!was_in_call)
|
||||||
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
|
hook->flags &= ~G_HOOK_FLAG_IN_CALL;
|
||||||
|
|
||||||
tmp = g_hook_next_valid (hook_list, hook, may_recurse);
|
hook = g_hook_next_valid (hook_list, hook, may_recurse);
|
||||||
|
|
||||||
g_hook_unref (hook_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
28
glib/gmain.c
28
glib/gmain.c
@ -402,7 +402,7 @@ g_main_dispatch (GTimeVal *current_time)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_hook_unref (&source_list, (GHook *)source);
|
g_hook_unref (&source_list, (GHook*) source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,19 +472,19 @@ g_main_iterate (gboolean block,
|
|||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GSource *source = (GSource *)hook;
|
GSource *source = (GSource *)hook;
|
||||||
GHook *tmp;
|
|
||||||
gint source_timeout = -1;
|
gint source_timeout = -1;
|
||||||
|
|
||||||
if ((n_ready > 0) && (source->priority > current_priority))
|
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))
|
if (G_HOOK_IN_CALL (hook) && !(hook->flags & G_SOURCE_CAN_RECURSE))
|
||||||
{
|
{
|
||||||
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_hook_ref (&source_list, hook);
|
|
||||||
|
|
||||||
if (hook->flags & G_SOURCE_READY ||
|
if (hook->flags & G_SOURCE_READY ||
|
||||||
((GSourceFuncs *) hook->func)->prepare (source->source_data,
|
((GSourceFuncs *) hook->func)->prepare (source->source_data,
|
||||||
¤t_time,
|
¤t_time,
|
||||||
@ -515,10 +515,7 @@ g_main_iterate (gboolean block,
|
|||||||
timeout = MIN (timeout, source_timeout);
|
timeout = MIN (timeout, source_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = g_hook_next_valid (&source_list, hook, TRUE);
|
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
||||||
|
|
||||||
g_hook_unref (&source_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* poll(), if necessary */
|
/* poll(), if necessary */
|
||||||
@ -533,18 +530,18 @@ g_main_iterate (gboolean block,
|
|||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GSource *source = (GSource *)hook;
|
GSource *source = (GSource *)hook;
|
||||||
GHook *tmp;
|
|
||||||
|
|
||||||
if ((n_ready > 0) && (source->priority > current_priority))
|
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))
|
if (G_HOOK_IN_CALL (hook) && !(hook->flags & G_SOURCE_CAN_RECURSE))
|
||||||
{
|
{
|
||||||
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_hook_ref (&source_list, hook);
|
|
||||||
|
|
||||||
if (hook->flags & G_SOURCE_READY ||
|
if (hook->flags & G_SOURCE_READY ||
|
||||||
((GSourceFuncs *) hook->func)->check (source->source_data,
|
((GSourceFuncs *) hook->func)->check (source->source_data,
|
||||||
¤t_time))
|
¤t_time))
|
||||||
@ -566,10 +563,7 @@ g_main_iterate (gboolean block,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = g_hook_next_valid (&source_list, hook, TRUE);
|
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
||||||
|
|
||||||
g_hook_unref (&source_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now invoke the callbacks */
|
/* Now invoke the callbacks */
|
||||||
|
136
glib/gscanner.c
136
glib/gscanner.c
@ -234,11 +234,11 @@ g_scanner_free_value (GTokenType *token_p,
|
|||||||
{
|
{
|
||||||
switch (*token_p)
|
switch (*token_p)
|
||||||
{
|
{
|
||||||
case G_TOKEN_STRING:
|
case G_TOKEN_STRING:
|
||||||
case G_TOKEN_IDENTIFIER:
|
case G_TOKEN_IDENTIFIER:
|
||||||
case G_TOKEN_IDENTIFIER_NULL:
|
case G_TOKEN_IDENTIFIER_NULL:
|
||||||
case G_TOKEN_COMMENT_SINGLE:
|
case G_TOKEN_COMMENT_SINGLE:
|
||||||
case G_TOKEN_COMMENT_MULTI:
|
case G_TOKEN_COMMENT_MULTI:
|
||||||
g_free (value_p->v_string);
|
g_free (value_p->v_string);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -871,7 +871,7 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
|
|
||||||
switch (scanner->token)
|
switch (scanner->token)
|
||||||
{
|
{
|
||||||
case G_TOKEN_EOF:
|
case G_TOKEN_EOF:
|
||||||
g_snprintf (token_string, token_string_len, "end of file");
|
g_snprintf (token_string, token_string_len, "end of file");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -892,7 +892,7 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case G_TOKEN_SYMBOL:
|
case G_TOKEN_SYMBOL:
|
||||||
if (expected_token == G_TOKEN_SYMBOL ||
|
if (expected_token == G_TOKEN_SYMBOL ||
|
||||||
(scanner->config->symbol_2_token &&
|
(scanner->config->symbol_2_token &&
|
||||||
expected_token > G_TOKEN_LAST))
|
expected_token > G_TOKEN_LAST))
|
||||||
@ -912,52 +912,54 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
symbol_spec);
|
symbol_spec);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_ERROR:
|
case G_TOKEN_ERROR:
|
||||||
print_unexp = FALSE;
|
print_unexp = FALSE;
|
||||||
expected_token = G_TOKEN_NONE;
|
expected_token = G_TOKEN_NONE;
|
||||||
switch (scanner->value.v_error)
|
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");
|
g_snprintf (token_string, token_string_len, "scanner: unexpected end of file");
|
||||||
break;
|
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");
|
g_snprintf (token_string, token_string_len, "scanner: unterminated string constant");
|
||||||
break;
|
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");
|
g_snprintf (token_string, token_string_len, "scanner: unterminated comment");
|
||||||
break;
|
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");
|
g_snprintf (token_string, token_string_len, "scanner: non digit in constant");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_ERR_FLOAT_RADIX:
|
case G_ERR_FLOAT_RADIX:
|
||||||
g_snprintf (token_string, token_string_len, "scanner: invalid radix for floating constant");
|
g_snprintf (token_string, token_string_len, "scanner: invalid radix for floating constant");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_ERR_FLOAT_MALFORMED:
|
case G_ERR_FLOAT_MALFORMED:
|
||||||
g_snprintf (token_string, token_string_len, "scanner: malformed floating constant");
|
g_snprintf (token_string, token_string_len, "scanner: malformed floating constant");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_ERR_DIGIT_RADIX:
|
case G_ERR_DIGIT_RADIX:
|
||||||
g_snprintf (token_string, token_string_len, "scanner: digit is beyond radix");
|
g_snprintf (token_string, token_string_len, "scanner: digit is beyond radix");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_ERR_UNKNOWN:
|
case G_ERR_UNKNOWN:
|
||||||
default:
|
default:
|
||||||
g_snprintf (token_string, token_string_len, "scanner: unknown error");
|
g_snprintf (token_string, token_string_len, "scanner: unknown error");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_CHAR:
|
case G_TOKEN_CHAR:
|
||||||
g_snprintf (token_string, token_string_len, "character `%c'", scanner->value.v_char);
|
g_snprintf (token_string, token_string_len, "character `%c'", scanner->value.v_char);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_IDENTIFIER:
|
case G_TOKEN_IDENTIFIER:
|
||||||
if (expected_token == G_TOKEN_IDENTIFIER)
|
case G_TOKEN_IDENTIFIER_NULL:
|
||||||
|
if (expected_token == G_TOKEN_IDENTIFIER ||
|
||||||
|
expected_token == G_TOKEN_IDENTIFIER_NULL)
|
||||||
print_unexp = FALSE;
|
print_unexp = FALSE;
|
||||||
g_snprintf (token_string,
|
g_snprintf (token_string,
|
||||||
token_string_len,
|
token_string_len,
|
||||||
@ -967,18 +969,18 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
scanner->value.v_string);
|
scanner->value.v_string);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_BINARY:
|
case G_TOKEN_BINARY:
|
||||||
case G_TOKEN_OCTAL:
|
case G_TOKEN_OCTAL:
|
||||||
case G_TOKEN_INT:
|
case G_TOKEN_INT:
|
||||||
case G_TOKEN_HEX:
|
case G_TOKEN_HEX:
|
||||||
g_snprintf (token_string, token_string_len, "number `%ld'", scanner->value.v_int);
|
g_snprintf (token_string, token_string_len, "number `%ld'", scanner->value.v_int);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_FLOAT:
|
case G_TOKEN_FLOAT:
|
||||||
g_snprintf (token_string, token_string_len, "number `%.3f'", scanner->value.v_float);
|
g_snprintf (token_string, token_string_len, "number `%.3f'", scanner->value.v_float);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_STRING:
|
case G_TOKEN_STRING:
|
||||||
if (expected_token == G_TOKEN_STRING)
|
if (expected_token == G_TOKEN_STRING)
|
||||||
print_unexp = FALSE;
|
print_unexp = FALSE;
|
||||||
g_snprintf (token_string,
|
g_snprintf (token_string,
|
||||||
@ -991,12 +993,12 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
token_string[token_string_len - 1] = 0;
|
token_string[token_string_len - 1] = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_COMMENT_SINGLE:
|
case G_TOKEN_COMMENT_SINGLE:
|
||||||
case G_TOKEN_COMMENT_MULTI:
|
case G_TOKEN_COMMENT_MULTI:
|
||||||
g_snprintf (token_string, token_string_len, "comment");
|
g_snprintf (token_string, token_string_len, "comment");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_NONE:
|
case G_TOKEN_NONE:
|
||||||
/* somehow the user's parsing code is screwed, there isn't much
|
/* somehow the user's parsing code is screwed, there isn't much
|
||||||
* we can do about it.
|
* we can do about it.
|
||||||
* Note, a common case to trigger this is
|
* Note, a common case to trigger this is
|
||||||
@ -1029,7 +1031,7 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case G_TOKEN_SYMBOL:
|
case G_TOKEN_SYMBOL:
|
||||||
need_valid = (scanner->token == G_TOKEN_SYMBOL ||
|
need_valid = (scanner->token == G_TOKEN_SYMBOL ||
|
||||||
(scanner->config->symbol_2_token &&
|
(scanner->config->symbol_2_token &&
|
||||||
scanner->token > G_TOKEN_LAST));
|
scanner->token > G_TOKEN_LAST));
|
||||||
@ -1041,30 +1043,32 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
/* FIXME: should we attempt to lookup the symbol_name for symbol_2_token? */
|
/* FIXME: should we attempt to lookup the symbol_name for symbol_2_token? */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_INT:
|
case G_TOKEN_INT:
|
||||||
g_snprintf (expected_string, expected_string_len, "number (integer)");
|
g_snprintf (expected_string, expected_string_len, "number (integer)");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_FLOAT:
|
case G_TOKEN_FLOAT:
|
||||||
g_snprintf (expected_string, expected_string_len, "number (float)");
|
g_snprintf (expected_string, expected_string_len, "number (float)");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_STRING:
|
case G_TOKEN_STRING:
|
||||||
g_snprintf (expected_string,
|
g_snprintf (expected_string,
|
||||||
expected_string_len,
|
expected_string_len,
|
||||||
"%sstring constant",
|
"%sstring constant",
|
||||||
scanner->token == G_TOKEN_STRING ? "valid " : "");
|
scanner->token == G_TOKEN_STRING ? "valid " : "");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_IDENTIFIER:
|
case G_TOKEN_IDENTIFIER:
|
||||||
|
case G_TOKEN_IDENTIFIER_NULL:
|
||||||
g_snprintf (expected_string,
|
g_snprintf (expected_string,
|
||||||
expected_string_len,
|
expected_string_len,
|
||||||
"%s%s",
|
"%s%s",
|
||||||
scanner->token == G_TOKEN_IDENTIFIER ? "valid " : "",
|
(scanner->token == G_TOKEN_IDENTIFIER_NULL ||
|
||||||
|
scanner->token == G_TOKEN_IDENTIFIER ? "valid " : ""),
|
||||||
identifier_spec);
|
identifier_spec);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_NONE:
|
case G_TOKEN_NONE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1238,13 +1242,13 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
|
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
token = G_TOKEN_EOF;
|
token = G_TOKEN_EOF;
|
||||||
(*position_p)++;
|
(*position_p)++;
|
||||||
/* ch = 0; */
|
/* ch = 0; */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '/':
|
case '/':
|
||||||
if (!config->scan_comment_multi ||
|
if (!config->scan_comment_multi ||
|
||||||
g_scanner_peek_next_char (scanner) != '*')
|
g_scanner_peek_next_char (scanner) != '*')
|
||||||
goto default_case;
|
goto default_case;
|
||||||
@ -1266,7 +1270,7 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
ch = 0;
|
ch = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\'':
|
case '\'':
|
||||||
if (!config->scan_string_sq)
|
if (!config->scan_string_sq)
|
||||||
goto default_case;
|
goto default_case;
|
||||||
token = G_TOKEN_STRING;
|
token = G_TOKEN_STRING;
|
||||||
@ -1285,7 +1289,7 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
ch = 0;
|
ch = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '"':
|
case '"':
|
||||||
if (!config->scan_string_dq)
|
if (!config->scan_string_dq)
|
||||||
goto default_case;
|
goto default_case;
|
||||||
token = G_TOKEN_STRING;
|
token = G_TOKEN_STRING;
|
||||||
@ -1308,41 +1312,41 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
register guint i;
|
register guint i;
|
||||||
register guint fchar;
|
register guint fchar;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\\':
|
case '\\':
|
||||||
gstring = g_string_append_c (gstring, '\\');
|
gstring = g_string_append_c (gstring, '\\');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
gstring = g_string_append_c (gstring, '\n');
|
gstring = g_string_append_c (gstring, '\n');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
gstring = g_string_append_c (gstring, '\t');
|
gstring = g_string_append_c (gstring, '\t');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
gstring = g_string_append_c (gstring, '\r');
|
gstring = g_string_append_c (gstring, '\r');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'b':
|
case 'b':
|
||||||
gstring = g_string_append_c (gstring, '\b');
|
gstring = g_string_append_c (gstring, '\b');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
gstring = g_string_append_c (gstring, '\f');
|
gstring = g_string_append_c (gstring, '\f');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '0':
|
case '0':
|
||||||
case '1':
|
case '1':
|
||||||
case '2':
|
case '2':
|
||||||
case '3':
|
case '3':
|
||||||
case '4':
|
case '4':
|
||||||
case '5':
|
case '5':
|
||||||
case '6':
|
case '6':
|
||||||
case '7':
|
case '7':
|
||||||
i = ch - '0';
|
i = ch - '0';
|
||||||
fchar = g_scanner_peek_next_char (scanner);
|
fchar = g_scanner_peek_next_char (scanner);
|
||||||
if (fchar >= '0' && fchar <= '7')
|
if (fchar >= '0' && fchar <= '7')
|
||||||
@ -1371,7 +1375,7 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
ch = 0;
|
ch = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '.':
|
case '.':
|
||||||
if (!config->scan_float)
|
if (!config->scan_float)
|
||||||
goto default_case;
|
goto default_case;
|
||||||
token = G_TOKEN_FLOAT;
|
token = G_TOKEN_FLOAT;
|
||||||
@ -1379,14 +1383,14 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
ch = g_scanner_get_char (scanner, line_p, position_p);
|
ch = g_scanner_get_char (scanner, line_p, position_p);
|
||||||
goto number_parsing;
|
goto number_parsing;
|
||||||
|
|
||||||
case '$':
|
case '$':
|
||||||
if (!config->scan_hex_dollar)
|
if (!config->scan_hex_dollar)
|
||||||
goto default_case;
|
goto default_case;
|
||||||
token = G_TOKEN_HEX;
|
token = G_TOKEN_HEX;
|
||||||
ch = g_scanner_get_char (scanner, line_p, position_p);
|
ch = g_scanner_get_char (scanner, line_p, position_p);
|
||||||
goto number_parsing;
|
goto number_parsing;
|
||||||
|
|
||||||
case '0':
|
case '0':
|
||||||
if (config->scan_octal)
|
if (config->scan_octal)
|
||||||
token = G_TOKEN_OCTAL;
|
token = G_TOKEN_OCTAL;
|
||||||
else
|
else
|
||||||
@ -1435,15 +1439,15 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
else
|
else
|
||||||
ch = '0';
|
ch = '0';
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case '1':
|
case '1':
|
||||||
case '2':
|
case '2':
|
||||||
case '3':
|
case '3':
|
||||||
case '4':
|
case '4':
|
||||||
case '5':
|
case '5':
|
||||||
case '6':
|
case '6':
|
||||||
case '7':
|
case '7':
|
||||||
case '8':
|
case '8':
|
||||||
case '9':
|
case '9':
|
||||||
number_parsing:
|
number_parsing:
|
||||||
{
|
{
|
||||||
register gboolean in_number = TRUE;
|
register gboolean in_number = TRUE;
|
||||||
|
28
gmain.c
28
gmain.c
@ -402,7 +402,7 @@ g_main_dispatch (GTimeVal *current_time)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_hook_unref (&source_list, (GHook *)source);
|
g_hook_unref (&source_list, (GHook*) source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,19 +472,19 @@ g_main_iterate (gboolean block,
|
|||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GSource *source = (GSource *)hook;
|
GSource *source = (GSource *)hook;
|
||||||
GHook *tmp;
|
|
||||||
gint source_timeout = -1;
|
gint source_timeout = -1;
|
||||||
|
|
||||||
if ((n_ready > 0) && (source->priority > current_priority))
|
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))
|
if (G_HOOK_IN_CALL (hook) && !(hook->flags & G_SOURCE_CAN_RECURSE))
|
||||||
{
|
{
|
||||||
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_hook_ref (&source_list, hook);
|
|
||||||
|
|
||||||
if (hook->flags & G_SOURCE_READY ||
|
if (hook->flags & G_SOURCE_READY ||
|
||||||
((GSourceFuncs *) hook->func)->prepare (source->source_data,
|
((GSourceFuncs *) hook->func)->prepare (source->source_data,
|
||||||
¤t_time,
|
¤t_time,
|
||||||
@ -515,10 +515,7 @@ g_main_iterate (gboolean block,
|
|||||||
timeout = MIN (timeout, source_timeout);
|
timeout = MIN (timeout, source_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = g_hook_next_valid (&source_list, hook, TRUE);
|
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
||||||
|
|
||||||
g_hook_unref (&source_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* poll(), if necessary */
|
/* poll(), if necessary */
|
||||||
@ -533,18 +530,18 @@ g_main_iterate (gboolean block,
|
|||||||
while (hook)
|
while (hook)
|
||||||
{
|
{
|
||||||
GSource *source = (GSource *)hook;
|
GSource *source = (GSource *)hook;
|
||||||
GHook *tmp;
|
|
||||||
|
|
||||||
if ((n_ready > 0) && (source->priority > current_priority))
|
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))
|
if (G_HOOK_IN_CALL (hook) && !(hook->flags & G_SOURCE_CAN_RECURSE))
|
||||||
{
|
{
|
||||||
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_hook_ref (&source_list, hook);
|
|
||||||
|
|
||||||
if (hook->flags & G_SOURCE_READY ||
|
if (hook->flags & G_SOURCE_READY ||
|
||||||
((GSourceFuncs *) hook->func)->check (source->source_data,
|
((GSourceFuncs *) hook->func)->check (source->source_data,
|
||||||
¤t_time))
|
¤t_time))
|
||||||
@ -566,10 +563,7 @@ g_main_iterate (gboolean block,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = g_hook_next_valid (&source_list, hook, TRUE);
|
hook = g_hook_next_valid (&source_list, hook, TRUE);
|
||||||
|
|
||||||
g_hook_unref (&source_list, hook);
|
|
||||||
hook = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now invoke the callbacks */
|
/* Now invoke the callbacks */
|
||||||
|
136
gscanner.c
136
gscanner.c
@ -234,11 +234,11 @@ g_scanner_free_value (GTokenType *token_p,
|
|||||||
{
|
{
|
||||||
switch (*token_p)
|
switch (*token_p)
|
||||||
{
|
{
|
||||||
case G_TOKEN_STRING:
|
case G_TOKEN_STRING:
|
||||||
case G_TOKEN_IDENTIFIER:
|
case G_TOKEN_IDENTIFIER:
|
||||||
case G_TOKEN_IDENTIFIER_NULL:
|
case G_TOKEN_IDENTIFIER_NULL:
|
||||||
case G_TOKEN_COMMENT_SINGLE:
|
case G_TOKEN_COMMENT_SINGLE:
|
||||||
case G_TOKEN_COMMENT_MULTI:
|
case G_TOKEN_COMMENT_MULTI:
|
||||||
g_free (value_p->v_string);
|
g_free (value_p->v_string);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -871,7 +871,7 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
|
|
||||||
switch (scanner->token)
|
switch (scanner->token)
|
||||||
{
|
{
|
||||||
case G_TOKEN_EOF:
|
case G_TOKEN_EOF:
|
||||||
g_snprintf (token_string, token_string_len, "end of file");
|
g_snprintf (token_string, token_string_len, "end of file");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -892,7 +892,7 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case G_TOKEN_SYMBOL:
|
case G_TOKEN_SYMBOL:
|
||||||
if (expected_token == G_TOKEN_SYMBOL ||
|
if (expected_token == G_TOKEN_SYMBOL ||
|
||||||
(scanner->config->symbol_2_token &&
|
(scanner->config->symbol_2_token &&
|
||||||
expected_token > G_TOKEN_LAST))
|
expected_token > G_TOKEN_LAST))
|
||||||
@ -912,52 +912,54 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
symbol_spec);
|
symbol_spec);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_ERROR:
|
case G_TOKEN_ERROR:
|
||||||
print_unexp = FALSE;
|
print_unexp = FALSE;
|
||||||
expected_token = G_TOKEN_NONE;
|
expected_token = G_TOKEN_NONE;
|
||||||
switch (scanner->value.v_error)
|
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");
|
g_snprintf (token_string, token_string_len, "scanner: unexpected end of file");
|
||||||
break;
|
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");
|
g_snprintf (token_string, token_string_len, "scanner: unterminated string constant");
|
||||||
break;
|
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");
|
g_snprintf (token_string, token_string_len, "scanner: unterminated comment");
|
||||||
break;
|
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");
|
g_snprintf (token_string, token_string_len, "scanner: non digit in constant");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_ERR_FLOAT_RADIX:
|
case G_ERR_FLOAT_RADIX:
|
||||||
g_snprintf (token_string, token_string_len, "scanner: invalid radix for floating constant");
|
g_snprintf (token_string, token_string_len, "scanner: invalid radix for floating constant");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_ERR_FLOAT_MALFORMED:
|
case G_ERR_FLOAT_MALFORMED:
|
||||||
g_snprintf (token_string, token_string_len, "scanner: malformed floating constant");
|
g_snprintf (token_string, token_string_len, "scanner: malformed floating constant");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_ERR_DIGIT_RADIX:
|
case G_ERR_DIGIT_RADIX:
|
||||||
g_snprintf (token_string, token_string_len, "scanner: digit is beyond radix");
|
g_snprintf (token_string, token_string_len, "scanner: digit is beyond radix");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_ERR_UNKNOWN:
|
case G_ERR_UNKNOWN:
|
||||||
default:
|
default:
|
||||||
g_snprintf (token_string, token_string_len, "scanner: unknown error");
|
g_snprintf (token_string, token_string_len, "scanner: unknown error");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_CHAR:
|
case G_TOKEN_CHAR:
|
||||||
g_snprintf (token_string, token_string_len, "character `%c'", scanner->value.v_char);
|
g_snprintf (token_string, token_string_len, "character `%c'", scanner->value.v_char);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_IDENTIFIER:
|
case G_TOKEN_IDENTIFIER:
|
||||||
if (expected_token == G_TOKEN_IDENTIFIER)
|
case G_TOKEN_IDENTIFIER_NULL:
|
||||||
|
if (expected_token == G_TOKEN_IDENTIFIER ||
|
||||||
|
expected_token == G_TOKEN_IDENTIFIER_NULL)
|
||||||
print_unexp = FALSE;
|
print_unexp = FALSE;
|
||||||
g_snprintf (token_string,
|
g_snprintf (token_string,
|
||||||
token_string_len,
|
token_string_len,
|
||||||
@ -967,18 +969,18 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
scanner->value.v_string);
|
scanner->value.v_string);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_BINARY:
|
case G_TOKEN_BINARY:
|
||||||
case G_TOKEN_OCTAL:
|
case G_TOKEN_OCTAL:
|
||||||
case G_TOKEN_INT:
|
case G_TOKEN_INT:
|
||||||
case G_TOKEN_HEX:
|
case G_TOKEN_HEX:
|
||||||
g_snprintf (token_string, token_string_len, "number `%ld'", scanner->value.v_int);
|
g_snprintf (token_string, token_string_len, "number `%ld'", scanner->value.v_int);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_FLOAT:
|
case G_TOKEN_FLOAT:
|
||||||
g_snprintf (token_string, token_string_len, "number `%.3f'", scanner->value.v_float);
|
g_snprintf (token_string, token_string_len, "number `%.3f'", scanner->value.v_float);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_STRING:
|
case G_TOKEN_STRING:
|
||||||
if (expected_token == G_TOKEN_STRING)
|
if (expected_token == G_TOKEN_STRING)
|
||||||
print_unexp = FALSE;
|
print_unexp = FALSE;
|
||||||
g_snprintf (token_string,
|
g_snprintf (token_string,
|
||||||
@ -991,12 +993,12 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
token_string[token_string_len - 1] = 0;
|
token_string[token_string_len - 1] = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_COMMENT_SINGLE:
|
case G_TOKEN_COMMENT_SINGLE:
|
||||||
case G_TOKEN_COMMENT_MULTI:
|
case G_TOKEN_COMMENT_MULTI:
|
||||||
g_snprintf (token_string, token_string_len, "comment");
|
g_snprintf (token_string, token_string_len, "comment");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_NONE:
|
case G_TOKEN_NONE:
|
||||||
/* somehow the user's parsing code is screwed, there isn't much
|
/* somehow the user's parsing code is screwed, there isn't much
|
||||||
* we can do about it.
|
* we can do about it.
|
||||||
* Note, a common case to trigger this is
|
* Note, a common case to trigger this is
|
||||||
@ -1029,7 +1031,7 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case G_TOKEN_SYMBOL:
|
case G_TOKEN_SYMBOL:
|
||||||
need_valid = (scanner->token == G_TOKEN_SYMBOL ||
|
need_valid = (scanner->token == G_TOKEN_SYMBOL ||
|
||||||
(scanner->config->symbol_2_token &&
|
(scanner->config->symbol_2_token &&
|
||||||
scanner->token > G_TOKEN_LAST));
|
scanner->token > G_TOKEN_LAST));
|
||||||
@ -1041,30 +1043,32 @@ g_scanner_unexp_token (GScanner *scanner,
|
|||||||
/* FIXME: should we attempt to lookup the symbol_name for symbol_2_token? */
|
/* FIXME: should we attempt to lookup the symbol_name for symbol_2_token? */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_INT:
|
case G_TOKEN_INT:
|
||||||
g_snprintf (expected_string, expected_string_len, "number (integer)");
|
g_snprintf (expected_string, expected_string_len, "number (integer)");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_FLOAT:
|
case G_TOKEN_FLOAT:
|
||||||
g_snprintf (expected_string, expected_string_len, "number (float)");
|
g_snprintf (expected_string, expected_string_len, "number (float)");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_STRING:
|
case G_TOKEN_STRING:
|
||||||
g_snprintf (expected_string,
|
g_snprintf (expected_string,
|
||||||
expected_string_len,
|
expected_string_len,
|
||||||
"%sstring constant",
|
"%sstring constant",
|
||||||
scanner->token == G_TOKEN_STRING ? "valid " : "");
|
scanner->token == G_TOKEN_STRING ? "valid " : "");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_IDENTIFIER:
|
case G_TOKEN_IDENTIFIER:
|
||||||
|
case G_TOKEN_IDENTIFIER_NULL:
|
||||||
g_snprintf (expected_string,
|
g_snprintf (expected_string,
|
||||||
expected_string_len,
|
expected_string_len,
|
||||||
"%s%s",
|
"%s%s",
|
||||||
scanner->token == G_TOKEN_IDENTIFIER ? "valid " : "",
|
(scanner->token == G_TOKEN_IDENTIFIER_NULL ||
|
||||||
|
scanner->token == G_TOKEN_IDENTIFIER ? "valid " : ""),
|
||||||
identifier_spec);
|
identifier_spec);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_TOKEN_NONE:
|
case G_TOKEN_NONE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1238,13 +1242,13 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
|
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
token = G_TOKEN_EOF;
|
token = G_TOKEN_EOF;
|
||||||
(*position_p)++;
|
(*position_p)++;
|
||||||
/* ch = 0; */
|
/* ch = 0; */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '/':
|
case '/':
|
||||||
if (!config->scan_comment_multi ||
|
if (!config->scan_comment_multi ||
|
||||||
g_scanner_peek_next_char (scanner) != '*')
|
g_scanner_peek_next_char (scanner) != '*')
|
||||||
goto default_case;
|
goto default_case;
|
||||||
@ -1266,7 +1270,7 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
ch = 0;
|
ch = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\'':
|
case '\'':
|
||||||
if (!config->scan_string_sq)
|
if (!config->scan_string_sq)
|
||||||
goto default_case;
|
goto default_case;
|
||||||
token = G_TOKEN_STRING;
|
token = G_TOKEN_STRING;
|
||||||
@ -1285,7 +1289,7 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
ch = 0;
|
ch = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '"':
|
case '"':
|
||||||
if (!config->scan_string_dq)
|
if (!config->scan_string_dq)
|
||||||
goto default_case;
|
goto default_case;
|
||||||
token = G_TOKEN_STRING;
|
token = G_TOKEN_STRING;
|
||||||
@ -1308,41 +1312,41 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
register guint i;
|
register guint i;
|
||||||
register guint fchar;
|
register guint fchar;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\\':
|
case '\\':
|
||||||
gstring = g_string_append_c (gstring, '\\');
|
gstring = g_string_append_c (gstring, '\\');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
gstring = g_string_append_c (gstring, '\n');
|
gstring = g_string_append_c (gstring, '\n');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
gstring = g_string_append_c (gstring, '\t');
|
gstring = g_string_append_c (gstring, '\t');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
gstring = g_string_append_c (gstring, '\r');
|
gstring = g_string_append_c (gstring, '\r');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'b':
|
case 'b':
|
||||||
gstring = g_string_append_c (gstring, '\b');
|
gstring = g_string_append_c (gstring, '\b');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
gstring = g_string_append_c (gstring, '\f');
|
gstring = g_string_append_c (gstring, '\f');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '0':
|
case '0':
|
||||||
case '1':
|
case '1':
|
||||||
case '2':
|
case '2':
|
||||||
case '3':
|
case '3':
|
||||||
case '4':
|
case '4':
|
||||||
case '5':
|
case '5':
|
||||||
case '6':
|
case '6':
|
||||||
case '7':
|
case '7':
|
||||||
i = ch - '0';
|
i = ch - '0';
|
||||||
fchar = g_scanner_peek_next_char (scanner);
|
fchar = g_scanner_peek_next_char (scanner);
|
||||||
if (fchar >= '0' && fchar <= '7')
|
if (fchar >= '0' && fchar <= '7')
|
||||||
@ -1371,7 +1375,7 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
ch = 0;
|
ch = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '.':
|
case '.':
|
||||||
if (!config->scan_float)
|
if (!config->scan_float)
|
||||||
goto default_case;
|
goto default_case;
|
||||||
token = G_TOKEN_FLOAT;
|
token = G_TOKEN_FLOAT;
|
||||||
@ -1379,14 +1383,14 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
ch = g_scanner_get_char (scanner, line_p, position_p);
|
ch = g_scanner_get_char (scanner, line_p, position_p);
|
||||||
goto number_parsing;
|
goto number_parsing;
|
||||||
|
|
||||||
case '$':
|
case '$':
|
||||||
if (!config->scan_hex_dollar)
|
if (!config->scan_hex_dollar)
|
||||||
goto default_case;
|
goto default_case;
|
||||||
token = G_TOKEN_HEX;
|
token = G_TOKEN_HEX;
|
||||||
ch = g_scanner_get_char (scanner, line_p, position_p);
|
ch = g_scanner_get_char (scanner, line_p, position_p);
|
||||||
goto number_parsing;
|
goto number_parsing;
|
||||||
|
|
||||||
case '0':
|
case '0':
|
||||||
if (config->scan_octal)
|
if (config->scan_octal)
|
||||||
token = G_TOKEN_OCTAL;
|
token = G_TOKEN_OCTAL;
|
||||||
else
|
else
|
||||||
@ -1435,15 +1439,15 @@ g_scanner_get_token_ll (GScanner *scanner,
|
|||||||
else
|
else
|
||||||
ch = '0';
|
ch = '0';
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case '1':
|
case '1':
|
||||||
case '2':
|
case '2':
|
||||||
case '3':
|
case '3':
|
||||||
case '4':
|
case '4':
|
||||||
case '5':
|
case '5':
|
||||||
case '6':
|
case '6':
|
||||||
case '7':
|
case '7':
|
||||||
case '8':
|
case '8':
|
||||||
case '9':
|
case '9':
|
||||||
number_parsing:
|
number_parsing:
|
||||||
{
|
{
|
||||||
register gboolean in_number = TRUE;
|
register gboolean in_number = TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user