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.
This commit is contained in:
Tor Lillqvist 1999-08-17 17:41:01 +00:00
parent 36a4ad3713
commit 80c44ef391
14 changed files with 216 additions and 68 deletions

View File

@ -1,3 +1,12 @@
1999-08-17 Tor Lillqvist <tml@iki.fi>
* 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 <timj@gtk.org> Sun Aug 15 02:47:14 1999 Tim Janik <timj@gtk.org>
* glib.h (g_trash_stack_pop): eliminate memset() call, since string.h * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h

View File

@ -1,3 +1,12 @@
1999-08-17 Tor Lillqvist <tml@iki.fi>
* 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 <timj@gtk.org> Sun Aug 15 02:47:14 1999 Tim Janik <timj@gtk.org>
* glib.h (g_trash_stack_pop): eliminate memset() call, since string.h * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h

View File

@ -1,3 +1,12 @@
1999-08-17 Tor Lillqvist <tml@iki.fi>
* 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 <timj@gtk.org> Sun Aug 15 02:47:14 1999 Tim Janik <timj@gtk.org>
* glib.h (g_trash_stack_pop): eliminate memset() call, since string.h * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h

View File

@ -1,3 +1,12 @@
1999-08-17 Tor Lillqvist <tml@iki.fi>
* 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 <timj@gtk.org> Sun Aug 15 02:47:14 1999 Tim Janik <timj@gtk.org>
* glib.h (g_trash_stack_pop): eliminate memset() call, since string.h * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h

View File

@ -1,3 +1,12 @@
1999-08-17 Tor Lillqvist <tml@iki.fi>
* 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 <timj@gtk.org> Sun Aug 15 02:47:14 1999 Tim Janik <timj@gtk.org>
* glib.h (g_trash_stack_pop): eliminate memset() call, since string.h * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h

View File

@ -1,3 +1,12 @@
1999-08-17 Tor Lillqvist <tml@iki.fi>
* 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 <timj@gtk.org> Sun Aug 15 02:47:14 1999 Tim Janik <timj@gtk.org>
* glib.h (g_trash_stack_pop): eliminate memset() call, since string.h * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h

View File

@ -1,3 +1,12 @@
1999-08-17 Tor Lillqvist <tml@iki.fi>
* 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 <timj@gtk.org> Sun Aug 15 02:47:14 1999 Tim Janik <timj@gtk.org>
* glib.h (g_trash_stack_pop): eliminate memset() call, since string.h * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h

View File

@ -1,3 +1,12 @@
1999-08-17 Tor Lillqvist <tml@iki.fi>
* 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 <timj@gtk.org> Sun Aug 15 02:47:14 1999 Tim Janik <timj@gtk.org>
* glib.h (g_trash_stack_pop): eliminate memset() call, since string.h * glib.h (g_trash_stack_pop): eliminate memset() call, since string.h

2
glib.h
View File

@ -1669,7 +1669,7 @@ G_INLINE_FUNC void
g_trash_stack_push (GTrashStack **stack_p, g_trash_stack_push (GTrashStack **stack_p,
gpointer data_p) gpointer data_p)
{ {
GTrashStack *data = data_p; GTrashStack *data = (GTrashStack *) data_p;
data->next = *stack_p; data->next = *stack_p;
*stack_p = data; *stack_p = data;

View File

@ -1669,7 +1669,7 @@ G_INLINE_FUNC void
g_trash_stack_push (GTrashStack **stack_p, g_trash_stack_push (GTrashStack **stack_p,
gpointer data_p) gpointer data_p)
{ {
GTrashStack *data = data_p; GTrashStack *data = (GTrashStack *) data_p;
data->next = *stack_p; data->next = *stack_p;
*stack_p = data; *stack_p = data;

View File

@ -100,8 +100,8 @@ g_list_pop_allocator (void)
G_UNLOCK (current_allocator); G_UNLOCK (current_allocator);
} }
inline GList* static inline GList*
g_list_alloc (void) _g_list_alloc (void)
{ {
GList *list; GList *list;
@ -140,6 +140,12 @@ g_list_alloc (void)
return list; return list;
} }
GList*
g_list_alloc (void)
{
return _g_list_alloc ();
}
void void
g_list_free (GList *list) g_list_free (GList *list)
{ {
@ -153,8 +159,8 @@ g_list_free (GList *list)
} }
} }
inline void static inline void
g_list_free_1 (GList *list) _g_list_free_1 (GList *list)
{ {
if (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* GList*
g_list_append (GList *list, g_list_append (GList *list,
gpointer data) gpointer data)
@ -173,7 +185,7 @@ g_list_append (GList *list,
GList *new_list; GList *new_list;
GList *last; GList *last;
new_list = g_list_alloc (); new_list = _g_list_alloc ();
new_list->data = data; new_list->data = data;
if (list) if (list)
@ -195,7 +207,7 @@ g_list_prepend (GList *list,
{ {
GList *new_list; GList *new_list;
new_list = g_list_alloc (); new_list = _g_list_alloc ();
new_list->data = data; new_list->data = data;
if (list) if (list)
@ -229,7 +241,7 @@ g_list_insert (GList *list,
if (!tmp_list) if (!tmp_list)
return g_list_append (list, data); return g_list_append (list, data);
new_list = g_list_alloc (); new_list = _g_list_alloc ();
new_list->data = data; new_list->data = data;
if (tmp_list->prev) if (tmp_list->prev)
@ -285,7 +297,7 @@ g_list_remove (GList *list,
if (list == tmp) if (list == tmp)
list = list->next; list = list->next;
g_list_free_1 (tmp); _g_list_free_1 (tmp);
break; break;
} }
@ -293,9 +305,9 @@ g_list_remove (GList *list,
return list; return list;
} }
inline GList* static inline GList*
g_list_remove_link (GList *list, _g_list_remove_link (GList *list,
GList *link) GList *link)
{ {
if (link) if (link)
{ {
@ -314,12 +326,19 @@ g_list_remove_link (GList *list,
return list; return list;
} }
GList*
g_list_remove_link (GList *list,
GList *link)
{
return _g_list_remove_link (list, link);
}
GList* GList*
g_list_delete_link (GList *list, g_list_delete_link (GList *list,
GList *link) GList *link)
{ {
list = g_list_remove_link (list, link); list = _g_list_remove_link (list, link);
g_list_free_1 (link); _g_list_free_1 (link);
return list; return list;
} }
@ -333,13 +352,13 @@ g_list_copy (GList *list)
{ {
GList *last; GList *last;
new_list = g_list_alloc (); new_list = _g_list_alloc ();
new_list->data = list->data; new_list->data = list->data;
last = new_list; last = new_list;
list = list->next; list = list->next;
while (list) while (list)
{ {
last->next = g_list_alloc (); last->next = _g_list_alloc ();
last->next->prev = last; last->next->prev = last;
last = last->next; last = last->next;
last->data = list->data; last->data = list->data;
@ -520,7 +539,7 @@ g_list_insert_sorted (GList *list,
if (!list) if (!list)
{ {
new_list = g_list_alloc(); new_list = _g_list_alloc ();
new_list->data = data; new_list->data = data;
return new_list; return new_list;
} }
@ -533,7 +552,7 @@ g_list_insert_sorted (GList *list,
cmp = (*func) (data, tmp_list->data); cmp = (*func) (data, tmp_list->data);
} }
new_list = g_list_alloc(); new_list = _g_list_alloc ();
new_list->data = data; new_list->data = data;
if ((!tmp_list->next) && (cmp > 0)) if ((!tmp_list->next) && (cmp > 0))

View File

@ -100,8 +100,8 @@ g_slist_pop_allocator (void)
G_UNLOCK (current_allocator); G_UNLOCK (current_allocator);
} }
inline GSList* static inline GSList*
g_slist_alloc (void) _g_slist_alloc (void)
{ {
GSList *list; GSList *list;
@ -140,6 +140,12 @@ g_slist_alloc (void)
return list; return list;
} }
GSList*
g_slist_alloc (void)
{
return _g_slist_alloc ();
}
void void
g_slist_free (GSList *list) g_slist_free (GSList *list)
{ {
@ -153,8 +159,8 @@ g_slist_free (GSList *list)
} }
} }
inline void static inline void
g_slist_free_1 (GSList *list) _g_slist_free_1 (GSList *list)
{ {
if (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* GSList*
g_slist_append (GSList *list, g_slist_append (GSList *list,
gpointer data) gpointer data)
@ -173,7 +185,7 @@ g_slist_append (GSList *list,
GSList *new_list; GSList *new_list;
GSList *last; GSList *last;
new_list = g_slist_alloc (); new_list = _g_slist_alloc ();
new_list->data = data; new_list->data = data;
if (list) if (list)
@ -194,7 +206,7 @@ g_slist_prepend (GSList *list,
{ {
GSList *new_list; GSList *new_list;
new_list = g_slist_alloc (); new_list = _g_slist_alloc ();
new_list->data = data; new_list->data = data;
new_list->next = list; new_list->next = list;
@ -215,7 +227,7 @@ g_slist_insert (GSList *list,
else if (position == 0) else if (position == 0)
return g_slist_prepend (list, data); return g_slist_prepend (list, data);
new_list = g_slist_alloc (); new_list = _g_slist_alloc ();
new_list->data = data; new_list->data = data;
if (!list) if (!list)
@ -290,9 +302,9 @@ g_slist_remove (GSList *list,
return list; return list;
} }
inline GSList* static inline GSList*
g_slist_remove_link (GSList *list, _g_slist_remove_link (GSList *list,
GSList *link) GSList *link)
{ {
GSList *tmp; GSList *tmp;
GSList *prev; GSList *prev;
@ -320,12 +332,19 @@ g_slist_remove_link (GSList *list,
return list; return list;
} }
GSList*
g_slist_remove_link (GSList *list,
GSList *link)
{
return _g_slist_remove_link (list, link);
}
GSList* GSList*
g_slist_delete_link (GSList *list, g_slist_delete_link (GSList *list,
GSList *link) GSList *link)
{ {
list = g_slist_remove_link (list, link); list = _g_slist_remove_link (list, link);
g_slist_free_1 (link); _g_slist_free_1 (link);
return list; return list;
} }
@ -339,13 +358,13 @@ g_slist_copy (GSList *list)
{ {
GSList *last; GSList *last;
new_list = g_slist_alloc (); new_list = _g_slist_alloc ();
new_list->data = list->data; new_list->data = list->data;
last = new_list; last = new_list;
list = list->next; list = list->next;
while (list) while (list)
{ {
last->next = g_slist_alloc (); last->next = _g_slist_alloc ();
last = last->next; last = last->next;
last->data = list->data; last->data = list->data;
list = list->next; list = list->next;
@ -519,7 +538,7 @@ g_slist_insert_sorted (GSList *list,
if (!list) if (!list)
{ {
new_list = g_slist_alloc(); new_list = _g_slist_alloc ();
new_list->data = data; new_list->data = data;
return new_list; return new_list;
} }
@ -533,7 +552,7 @@ g_slist_insert_sorted (GSList *list,
cmp = (*func) (data, tmp_list->data); cmp = (*func) (data, tmp_list->data);
} }
new_list = g_slist_alloc(); new_list = _g_slist_alloc ();
new_list->data = data; new_list->data = data;
if ((!tmp_list->next) && (cmp > 0)) if ((!tmp_list->next) && (cmp > 0))

53
glist.c
View File

@ -100,8 +100,8 @@ g_list_pop_allocator (void)
G_UNLOCK (current_allocator); G_UNLOCK (current_allocator);
} }
inline GList* static inline GList*
g_list_alloc (void) _g_list_alloc (void)
{ {
GList *list; GList *list;
@ -140,6 +140,12 @@ g_list_alloc (void)
return list; return list;
} }
GList*
g_list_alloc (void)
{
return _g_list_alloc ();
}
void void
g_list_free (GList *list) g_list_free (GList *list)
{ {
@ -153,8 +159,8 @@ g_list_free (GList *list)
} }
} }
inline void static inline void
g_list_free_1 (GList *list) _g_list_free_1 (GList *list)
{ {
if (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* GList*
g_list_append (GList *list, g_list_append (GList *list,
gpointer data) gpointer data)
@ -173,7 +185,7 @@ g_list_append (GList *list,
GList *new_list; GList *new_list;
GList *last; GList *last;
new_list = g_list_alloc (); new_list = _g_list_alloc ();
new_list->data = data; new_list->data = data;
if (list) if (list)
@ -195,7 +207,7 @@ g_list_prepend (GList *list,
{ {
GList *new_list; GList *new_list;
new_list = g_list_alloc (); new_list = _g_list_alloc ();
new_list->data = data; new_list->data = data;
if (list) if (list)
@ -229,7 +241,7 @@ g_list_insert (GList *list,
if (!tmp_list) if (!tmp_list)
return g_list_append (list, data); return g_list_append (list, data);
new_list = g_list_alloc (); new_list = _g_list_alloc ();
new_list->data = data; new_list->data = data;
if (tmp_list->prev) if (tmp_list->prev)
@ -285,7 +297,7 @@ g_list_remove (GList *list,
if (list == tmp) if (list == tmp)
list = list->next; list = list->next;
g_list_free_1 (tmp); _g_list_free_1 (tmp);
break; break;
} }
@ -293,9 +305,9 @@ g_list_remove (GList *list,
return list; return list;
} }
inline GList* static inline GList*
g_list_remove_link (GList *list, _g_list_remove_link (GList *list,
GList *link) GList *link)
{ {
if (link) if (link)
{ {
@ -314,12 +326,19 @@ g_list_remove_link (GList *list,
return list; return list;
} }
GList*
g_list_remove_link (GList *list,
GList *link)
{
return _g_list_remove_link (list, link);
}
GList* GList*
g_list_delete_link (GList *list, g_list_delete_link (GList *list,
GList *link) GList *link)
{ {
list = g_list_remove_link (list, link); list = _g_list_remove_link (list, link);
g_list_free_1 (link); _g_list_free_1 (link);
return list; return list;
} }
@ -333,13 +352,13 @@ g_list_copy (GList *list)
{ {
GList *last; GList *last;
new_list = g_list_alloc (); new_list = _g_list_alloc ();
new_list->data = list->data; new_list->data = list->data;
last = new_list; last = new_list;
list = list->next; list = list->next;
while (list) while (list)
{ {
last->next = g_list_alloc (); last->next = _g_list_alloc ();
last->next->prev = last; last->next->prev = last;
last = last->next; last = last->next;
last->data = list->data; last->data = list->data;
@ -520,7 +539,7 @@ g_list_insert_sorted (GList *list,
if (!list) if (!list)
{ {
new_list = g_list_alloc(); new_list = _g_list_alloc ();
new_list->data = data; new_list->data = data;
return new_list; return new_list;
} }
@ -533,7 +552,7 @@ g_list_insert_sorted (GList *list,
cmp = (*func) (data, tmp_list->data); cmp = (*func) (data, tmp_list->data);
} }
new_list = g_list_alloc(); new_list = _g_list_alloc ();
new_list->data = data; new_list->data = data;
if ((!tmp_list->next) && (cmp > 0)) if ((!tmp_list->next) && (cmp > 0))

View File

@ -100,8 +100,8 @@ g_slist_pop_allocator (void)
G_UNLOCK (current_allocator); G_UNLOCK (current_allocator);
} }
inline GSList* static inline GSList*
g_slist_alloc (void) _g_slist_alloc (void)
{ {
GSList *list; GSList *list;
@ -140,6 +140,12 @@ g_slist_alloc (void)
return list; return list;
} }
GSList*
g_slist_alloc (void)
{
return _g_slist_alloc ();
}
void void
g_slist_free (GSList *list) g_slist_free (GSList *list)
{ {
@ -153,8 +159,8 @@ g_slist_free (GSList *list)
} }
} }
inline void static inline void
g_slist_free_1 (GSList *list) _g_slist_free_1 (GSList *list)
{ {
if (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* GSList*
g_slist_append (GSList *list, g_slist_append (GSList *list,
gpointer data) gpointer data)
@ -173,7 +185,7 @@ g_slist_append (GSList *list,
GSList *new_list; GSList *new_list;
GSList *last; GSList *last;
new_list = g_slist_alloc (); new_list = _g_slist_alloc ();
new_list->data = data; new_list->data = data;
if (list) if (list)
@ -194,7 +206,7 @@ g_slist_prepend (GSList *list,
{ {
GSList *new_list; GSList *new_list;
new_list = g_slist_alloc (); new_list = _g_slist_alloc ();
new_list->data = data; new_list->data = data;
new_list->next = list; new_list->next = list;
@ -215,7 +227,7 @@ g_slist_insert (GSList *list,
else if (position == 0) else if (position == 0)
return g_slist_prepend (list, data); return g_slist_prepend (list, data);
new_list = g_slist_alloc (); new_list = _g_slist_alloc ();
new_list->data = data; new_list->data = data;
if (!list) if (!list)
@ -290,9 +302,9 @@ g_slist_remove (GSList *list,
return list; return list;
} }
inline GSList* static inline GSList*
g_slist_remove_link (GSList *list, _g_slist_remove_link (GSList *list,
GSList *link) GSList *link)
{ {
GSList *tmp; GSList *tmp;
GSList *prev; GSList *prev;
@ -320,12 +332,19 @@ g_slist_remove_link (GSList *list,
return list; return list;
} }
GSList*
g_slist_remove_link (GSList *list,
GSList *link)
{
return _g_slist_remove_link (list, link);
}
GSList* GSList*
g_slist_delete_link (GSList *list, g_slist_delete_link (GSList *list,
GSList *link) GSList *link)
{ {
list = g_slist_remove_link (list, link); list = _g_slist_remove_link (list, link);
g_slist_free_1 (link); _g_slist_free_1 (link);
return list; return list;
} }
@ -339,13 +358,13 @@ g_slist_copy (GSList *list)
{ {
GSList *last; GSList *last;
new_list = g_slist_alloc (); new_list = _g_slist_alloc ();
new_list->data = list->data; new_list->data = list->data;
last = new_list; last = new_list;
list = list->next; list = list->next;
while (list) while (list)
{ {
last->next = g_slist_alloc (); last->next = _g_slist_alloc ();
last = last->next; last = last->next;
last->data = list->data; last->data = list->data;
list = list->next; list = list->next;
@ -519,7 +538,7 @@ g_slist_insert_sorted (GSList *list,
if (!list) if (!list)
{ {
new_list = g_slist_alloc(); new_list = _g_slist_alloc ();
new_list->data = data; new_list->data = data;
return new_list; return new_list;
} }
@ -533,7 +552,7 @@ g_slist_insert_sorted (GSList *list,
cmp = (*func) (data, tmp_list->data); cmp = (*func) (data, tmp_list->data);
} }
new_list = g_slist_alloc(); new_list = _g_slist_alloc ();
new_list->data = data; new_list->data = data;
if ((!tmp_list->next) && (cmp > 0)) if ((!tmp_list->next) && (cmp > 0))