From 80c44ef391085fcb5b647ed7e5f4d0215f8fbec6 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 17 Aug 1999 17:41:01 +0000 Subject: [PATCH] Add a cast. * glib.h (g_trash_stack_push): Add a cast. * gslist.c * glist.c: Make the inline functions static inline, and add separate extern wrappers. Not all compilers produce callable entry points for inline functions, even if gcc does. --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-0 | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-12 | 9 +++++++++ ChangeLog.pre-2-2 | 9 +++++++++ ChangeLog.pre-2-4 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ glib.h | 2 +- glib/glib.h | 2 +- glib/glist.c | 53 ++++++++++++++++++++++++++++++++++++----------------- glib/gslist.c | 51 +++++++++++++++++++++++++++++++++++---------------- glist.c | 53 ++++++++++++++++++++++++++++++++++++----------------- gslist.c | 51 +++++++++++++++++++++++++++++++++++---------------- 14 files changed, 216 insertions(+), 68 deletions(-) diff --git a/ChangeLog b/ChangeLog index aecfc05..a5660c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +1999-08-17 Tor Lillqvist + + * glib.h (g_trash_stack_push): Add a cast. + + * gslist.c + * glist.c: Make the inline functions static inline, and add + separate extern wrappers. Not all compilers produce callable entry + points for inline functions, even if gcc does. + Sun Aug 15 02:47:14 1999 Tim Janik * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index aecfc05..a5660c2 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,12 @@ +1999-08-17 Tor Lillqvist + + * glib.h (g_trash_stack_push): Add a cast. + + * gslist.c + * glist.c: Make the inline functions static inline, and add + separate extern wrappers. Not all compilers produce callable entry + points for inline functions, even if gcc does. + Sun Aug 15 02:47:14 1999 Tim Janik * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index aecfc05..a5660c2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +1999-08-17 Tor Lillqvist + + * glib.h (g_trash_stack_push): Add a cast. + + * gslist.c + * glist.c: Make the inline functions static inline, and add + separate extern wrappers. Not all compilers produce callable entry + points for inline functions, even if gcc does. + Sun Aug 15 02:47:14 1999 Tim Janik * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index aecfc05..a5660c2 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,12 @@ +1999-08-17 Tor Lillqvist + + * glib.h (g_trash_stack_push): Add a cast. + + * gslist.c + * glist.c: Make the inline functions static inline, and add + separate extern wrappers. Not all compilers produce callable entry + points for inline functions, even if gcc does. + Sun Aug 15 02:47:14 1999 Tim Janik * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index aecfc05..a5660c2 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +1999-08-17 Tor Lillqvist + + * glib.h (g_trash_stack_push): Add a cast. + + * gslist.c + * glist.c: Make the inline functions static inline, and add + separate extern wrappers. Not all compilers produce callable entry + points for inline functions, even if gcc does. + Sun Aug 15 02:47:14 1999 Tim Janik * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index aecfc05..a5660c2 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +1999-08-17 Tor Lillqvist + + * glib.h (g_trash_stack_push): Add a cast. + + * gslist.c + * glist.c: Make the inline functions static inline, and add + separate extern wrappers. Not all compilers produce callable entry + points for inline functions, even if gcc does. + Sun Aug 15 02:47:14 1999 Tim Janik * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index aecfc05..a5660c2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +1999-08-17 Tor Lillqvist + + * glib.h (g_trash_stack_push): Add a cast. + + * gslist.c + * glist.c: Make the inline functions static inline, and add + separate extern wrappers. Not all compilers produce callable entry + points for inline functions, even if gcc does. + Sun Aug 15 02:47:14 1999 Tim Janik * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index aecfc05..a5660c2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +1999-08-17 Tor Lillqvist + + * glib.h (g_trash_stack_push): Add a cast. + + * gslist.c + * glist.c: Make the inline functions static inline, and add + separate extern wrappers. Not all compilers produce callable entry + points for inline functions, even if gcc does. + Sun Aug 15 02:47:14 1999 Tim Janik * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h diff --git a/glib.h b/glib.h index 9d2d4ab..24cf29a 100644 --- a/glib.h +++ b/glib.h @@ -1669,7 +1669,7 @@ G_INLINE_FUNC void g_trash_stack_push (GTrashStack **stack_p, gpointer data_p) { - GTrashStack *data = data_p; + GTrashStack *data = (GTrashStack *) data_p; data->next = *stack_p; *stack_p = data; diff --git a/glib/glib.h b/glib/glib.h index 9d2d4ab..24cf29a 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -1669,7 +1669,7 @@ G_INLINE_FUNC void g_trash_stack_push (GTrashStack **stack_p, gpointer data_p) { - GTrashStack *data = data_p; + GTrashStack *data = (GTrashStack *) data_p; data->next = *stack_p; *stack_p = data; diff --git a/glib/glist.c b/glib/glist.c index b4a89cd..e719e1c 100644 --- a/glib/glist.c +++ b/glib/glist.c @@ -100,8 +100,8 @@ g_list_pop_allocator (void) G_UNLOCK (current_allocator); } -inline GList* -g_list_alloc (void) +static inline GList* +_g_list_alloc (void) { GList *list; @@ -140,6 +140,12 @@ g_list_alloc (void) return list; } +GList* +g_list_alloc (void) +{ + return _g_list_alloc (); +} + void g_list_free (GList *list) { @@ -153,8 +159,8 @@ g_list_free (GList *list) } } -inline void -g_list_free_1 (GList *list) +static inline void +_g_list_free_1 (GList *list) { if (list) { @@ -166,6 +172,12 @@ g_list_free_1 (GList *list) } } +void +g_list_free_1 (GList *list) +{ + _g_list_free_1 (list); +} + GList* g_list_append (GList *list, gpointer data) @@ -173,7 +185,7 @@ g_list_append (GList *list, GList *new_list; GList *last; - new_list = g_list_alloc (); + new_list = _g_list_alloc (); new_list->data = data; if (list) @@ -195,7 +207,7 @@ g_list_prepend (GList *list, { GList *new_list; - new_list = g_list_alloc (); + new_list = _g_list_alloc (); new_list->data = data; if (list) @@ -229,7 +241,7 @@ g_list_insert (GList *list, if (!tmp_list) return g_list_append (list, data); - new_list = g_list_alloc (); + new_list = _g_list_alloc (); new_list->data = data; if (tmp_list->prev) @@ -285,7 +297,7 @@ g_list_remove (GList *list, if (list == tmp) list = list->next; - g_list_free_1 (tmp); + _g_list_free_1 (tmp); break; } @@ -293,9 +305,9 @@ g_list_remove (GList *list, return list; } -inline GList* -g_list_remove_link (GList *list, - GList *link) +static inline GList* +_g_list_remove_link (GList *list, + GList *link) { if (link) { @@ -315,11 +327,18 @@ g_list_remove_link (GList *list, } GList* +g_list_remove_link (GList *list, + GList *link) +{ + return _g_list_remove_link (list, link); +} + +GList* g_list_delete_link (GList *list, GList *link) { - list = g_list_remove_link (list, link); - g_list_free_1 (link); + list = _g_list_remove_link (list, link); + _g_list_free_1 (link); return list; } @@ -333,13 +352,13 @@ g_list_copy (GList *list) { GList *last; - new_list = g_list_alloc (); + new_list = _g_list_alloc (); new_list->data = list->data; last = new_list; list = list->next; while (list) { - last->next = g_list_alloc (); + last->next = _g_list_alloc (); last->next->prev = last; last = last->next; last->data = list->data; @@ -520,7 +539,7 @@ g_list_insert_sorted (GList *list, if (!list) { - new_list = g_list_alloc(); + new_list = _g_list_alloc (); new_list->data = data; return new_list; } @@ -533,7 +552,7 @@ g_list_insert_sorted (GList *list, cmp = (*func) (data, tmp_list->data); } - new_list = g_list_alloc(); + new_list = _g_list_alloc (); new_list->data = data; if ((!tmp_list->next) && (cmp > 0)) diff --git a/glib/gslist.c b/glib/gslist.c index a89f477..9e7c88f 100644 --- a/glib/gslist.c +++ b/glib/gslist.c @@ -100,8 +100,8 @@ g_slist_pop_allocator (void) G_UNLOCK (current_allocator); } -inline GSList* -g_slist_alloc (void) +static inline GSList* +_g_slist_alloc (void) { GSList *list; @@ -140,6 +140,12 @@ g_slist_alloc (void) return list; } +GSList* +g_slist_alloc (void) +{ + return _g_slist_alloc (); +} + void g_slist_free (GSList *list) { @@ -153,8 +159,8 @@ g_slist_free (GSList *list) } } -inline void -g_slist_free_1 (GSList *list) +static inline void +_g_slist_free_1 (GSList *list) { if (list) { @@ -166,6 +172,12 @@ g_slist_free_1 (GSList *list) } } +void +g_slist_free_1 (GSList *list) +{ + _g_slist_free_1 (list); +} + GSList* g_slist_append (GSList *list, gpointer data) @@ -173,7 +185,7 @@ g_slist_append (GSList *list, GSList *new_list; GSList *last; - new_list = g_slist_alloc (); + new_list = _g_slist_alloc (); new_list->data = data; if (list) @@ -194,7 +206,7 @@ g_slist_prepend (GSList *list, { GSList *new_list; - new_list = g_slist_alloc (); + new_list = _g_slist_alloc (); new_list->data = data; new_list->next = list; @@ -215,7 +227,7 @@ g_slist_insert (GSList *list, else if (position == 0) return g_slist_prepend (list, data); - new_list = g_slist_alloc (); + new_list = _g_slist_alloc (); new_list->data = data; if (!list) @@ -290,9 +302,9 @@ g_slist_remove (GSList *list, return list; } -inline GSList* -g_slist_remove_link (GSList *list, - GSList *link) +static inline GSList* +_g_slist_remove_link (GSList *list, + GSList *link) { GSList *tmp; GSList *prev; @@ -320,12 +332,19 @@ g_slist_remove_link (GSList *list, return list; } +GSList* +g_slist_remove_link (GSList *list, + GSList *link) +{ + return _g_slist_remove_link (list, link); +} + GSList* g_slist_delete_link (GSList *list, GSList *link) { - list = g_slist_remove_link (list, link); - g_slist_free_1 (link); + list = _g_slist_remove_link (list, link); + _g_slist_free_1 (link); return list; } @@ -339,13 +358,13 @@ g_slist_copy (GSList *list) { GSList *last; - new_list = g_slist_alloc (); + new_list = _g_slist_alloc (); new_list->data = list->data; last = new_list; list = list->next; while (list) { - last->next = g_slist_alloc (); + last->next = _g_slist_alloc (); last = last->next; last->data = list->data; list = list->next; @@ -519,7 +538,7 @@ g_slist_insert_sorted (GSList *list, if (!list) { - new_list = g_slist_alloc(); + new_list = _g_slist_alloc (); new_list->data = data; return new_list; } @@ -533,7 +552,7 @@ g_slist_insert_sorted (GSList *list, cmp = (*func) (data, tmp_list->data); } - new_list = g_slist_alloc(); + new_list = _g_slist_alloc (); new_list->data = data; if ((!tmp_list->next) && (cmp > 0)) diff --git a/glist.c b/glist.c index b4a89cd..e719e1c 100644 --- a/glist.c +++ b/glist.c @@ -100,8 +100,8 @@ g_list_pop_allocator (void) G_UNLOCK (current_allocator); } -inline GList* -g_list_alloc (void) +static inline GList* +_g_list_alloc (void) { GList *list; @@ -140,6 +140,12 @@ g_list_alloc (void) return list; } +GList* +g_list_alloc (void) +{ + return _g_list_alloc (); +} + void g_list_free (GList *list) { @@ -153,8 +159,8 @@ g_list_free (GList *list) } } -inline void -g_list_free_1 (GList *list) +static inline void +_g_list_free_1 (GList *list) { if (list) { @@ -166,6 +172,12 @@ g_list_free_1 (GList *list) } } +void +g_list_free_1 (GList *list) +{ + _g_list_free_1 (list); +} + GList* g_list_append (GList *list, gpointer data) @@ -173,7 +185,7 @@ g_list_append (GList *list, GList *new_list; GList *last; - new_list = g_list_alloc (); + new_list = _g_list_alloc (); new_list->data = data; if (list) @@ -195,7 +207,7 @@ g_list_prepend (GList *list, { GList *new_list; - new_list = g_list_alloc (); + new_list = _g_list_alloc (); new_list->data = data; if (list) @@ -229,7 +241,7 @@ g_list_insert (GList *list, if (!tmp_list) return g_list_append (list, data); - new_list = g_list_alloc (); + new_list = _g_list_alloc (); new_list->data = data; if (tmp_list->prev) @@ -285,7 +297,7 @@ g_list_remove (GList *list, if (list == tmp) list = list->next; - g_list_free_1 (tmp); + _g_list_free_1 (tmp); break; } @@ -293,9 +305,9 @@ g_list_remove (GList *list, return list; } -inline GList* -g_list_remove_link (GList *list, - GList *link) +static inline GList* +_g_list_remove_link (GList *list, + GList *link) { if (link) { @@ -315,11 +327,18 @@ g_list_remove_link (GList *list, } GList* +g_list_remove_link (GList *list, + GList *link) +{ + return _g_list_remove_link (list, link); +} + +GList* g_list_delete_link (GList *list, GList *link) { - list = g_list_remove_link (list, link); - g_list_free_1 (link); + list = _g_list_remove_link (list, link); + _g_list_free_1 (link); return list; } @@ -333,13 +352,13 @@ g_list_copy (GList *list) { GList *last; - new_list = g_list_alloc (); + new_list = _g_list_alloc (); new_list->data = list->data; last = new_list; list = list->next; while (list) { - last->next = g_list_alloc (); + last->next = _g_list_alloc (); last->next->prev = last; last = last->next; last->data = list->data; @@ -520,7 +539,7 @@ g_list_insert_sorted (GList *list, if (!list) { - new_list = g_list_alloc(); + new_list = _g_list_alloc (); new_list->data = data; return new_list; } @@ -533,7 +552,7 @@ g_list_insert_sorted (GList *list, cmp = (*func) (data, tmp_list->data); } - new_list = g_list_alloc(); + new_list = _g_list_alloc (); new_list->data = data; if ((!tmp_list->next) && (cmp > 0)) diff --git a/gslist.c b/gslist.c index a89f477..9e7c88f 100644 --- a/gslist.c +++ b/gslist.c @@ -100,8 +100,8 @@ g_slist_pop_allocator (void) G_UNLOCK (current_allocator); } -inline GSList* -g_slist_alloc (void) +static inline GSList* +_g_slist_alloc (void) { GSList *list; @@ -140,6 +140,12 @@ g_slist_alloc (void) return list; } +GSList* +g_slist_alloc (void) +{ + return _g_slist_alloc (); +} + void g_slist_free (GSList *list) { @@ -153,8 +159,8 @@ g_slist_free (GSList *list) } } -inline void -g_slist_free_1 (GSList *list) +static inline void +_g_slist_free_1 (GSList *list) { if (list) { @@ -166,6 +172,12 @@ g_slist_free_1 (GSList *list) } } +void +g_slist_free_1 (GSList *list) +{ + _g_slist_free_1 (list); +} + GSList* g_slist_append (GSList *list, gpointer data) @@ -173,7 +185,7 @@ g_slist_append (GSList *list, GSList *new_list; GSList *last; - new_list = g_slist_alloc (); + new_list = _g_slist_alloc (); new_list->data = data; if (list) @@ -194,7 +206,7 @@ g_slist_prepend (GSList *list, { GSList *new_list; - new_list = g_slist_alloc (); + new_list = _g_slist_alloc (); new_list->data = data; new_list->next = list; @@ -215,7 +227,7 @@ g_slist_insert (GSList *list, else if (position == 0) return g_slist_prepend (list, data); - new_list = g_slist_alloc (); + new_list = _g_slist_alloc (); new_list->data = data; if (!list) @@ -290,9 +302,9 @@ g_slist_remove (GSList *list, return list; } -inline GSList* -g_slist_remove_link (GSList *list, - GSList *link) +static inline GSList* +_g_slist_remove_link (GSList *list, + GSList *link) { GSList *tmp; GSList *prev; @@ -320,12 +332,19 @@ g_slist_remove_link (GSList *list, return list; } +GSList* +g_slist_remove_link (GSList *list, + GSList *link) +{ + return _g_slist_remove_link (list, link); +} + GSList* g_slist_delete_link (GSList *list, GSList *link) { - list = g_slist_remove_link (list, link); - g_slist_free_1 (link); + list = _g_slist_remove_link (list, link); + _g_slist_free_1 (link); return list; } @@ -339,13 +358,13 @@ g_slist_copy (GSList *list) { GSList *last; - new_list = g_slist_alloc (); + new_list = _g_slist_alloc (); new_list->data = list->data; last = new_list; list = list->next; while (list) { - last->next = g_slist_alloc (); + last->next = _g_slist_alloc (); last = last->next; last->data = list->data; list = list->next; @@ -519,7 +538,7 @@ g_slist_insert_sorted (GSList *list, if (!list) { - new_list = g_slist_alloc(); + new_list = _g_slist_alloc (); new_list->data = data; return new_list; } @@ -533,7 +552,7 @@ g_slist_insert_sorted (GSList *list, cmp = (*func) (data, tmp_list->data); } - new_list = g_slist_alloc(); + new_list = _g_slist_alloc (); new_list->data = data; if ((!tmp_list->next) && (cmp > 0)) -- 2.7.4