Thu Dec 17 04:10:49 1998 Tim Janik <timj@gtk.org>
* glib.h (G_LOCK_DECLARE_*): if !G_THREADS_ENABLED, eat the
trailing semicolon with a bogus function declaration, instead
of with a bogus variable declarations, so we avoid unused
variable warnings.
12 files changed:
+Thu Dec 17 04:10:49 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h (G_LOCK_DECLARE_*): if !G_THREADS_ENABLED, eat the
+ trailing semicolon with a bogus function declaration, instead
+ of with a bogus variable declarations, so we avoid unused
+ variable warnings.
+
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
+Thu Dec 17 04:10:49 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h (G_LOCK_DECLARE_*): if !G_THREADS_ENABLED, eat the
+ trailing semicolon with a bogus function declaration, instead
+ of with a bogus variable declarations, so we avoid unused
+ variable warnings.
+
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
+Thu Dec 17 04:10:49 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h (G_LOCK_DECLARE_*): if !G_THREADS_ENABLED, eat the
+ trailing semicolon with a bogus function declaration, instead
+ of with a bogus variable declarations, so we avoid unused
+ variable warnings.
+
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
+Thu Dec 17 04:10:49 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h (G_LOCK_DECLARE_*): if !G_THREADS_ENABLED, eat the
+ trailing semicolon with a bogus function declaration, instead
+ of with a bogus variable declarations, so we avoid unused
+ variable warnings.
+
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
+Thu Dec 17 04:10:49 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h (G_LOCK_DECLARE_*): if !G_THREADS_ENABLED, eat the
+ trailing semicolon with a bogus function declaration, instead
+ of with a bogus variable declarations, so we avoid unused
+ variable warnings.
+
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
+Thu Dec 17 04:10:49 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h (G_LOCK_DECLARE_*): if !G_THREADS_ENABLED, eat the
+ trailing semicolon with a bogus function declaration, instead
+ of with a bogus variable declarations, so we avoid unused
+ variable warnings.
+
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
+Thu Dec 17 04:10:49 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h (G_LOCK_DECLARE_*): if !G_THREADS_ENABLED, eat the
+ trailing semicolon with a bogus function declaration, instead
+ of with a bogus variable declarations, so we avoid unused
+ variable warnings.
+
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
+Thu Dec 17 04:10:49 1998 Tim Janik <timj@gtk.org>
+
+ * glib.h (G_LOCK_DECLARE_*): if !G_THREADS_ENABLED, eat the
+ trailing semicolon with a bogus function declaration, instead
+ of with a bogus variable declarations, so we avoid unused
+ variable warnings.
+
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
Wed Dec 16 07:49:16 PST 1998 Shawn T. Amundson <amundson@gtk.org>
* Released GLib 1.1.8 (CVS tag is GLIB_1_1_8a)
* such mutexes can be done with G_LOCK(), G_UNLOCK() and G_TRYLOCK()
* respectively.
*/
* such mutexes can be done with G_LOCK(), G_UNLOCK() and G_TRYLOCK()
* respectively.
*/
-extern gboolean glib_dummy_decl;
+extern void glib_dummy_decl (void);
#define G_LOCK_NAME(name) (g__ ## name ## _lock)
#ifdef G_THREADS_ENABLED
# define G_LOCK_DECLARE_STATIC(name) static G_LOCK_DECLARE (name)
#define G_LOCK_NAME(name) (g__ ## name ## _lock)
#ifdef G_THREADS_ENABLED
# define G_LOCK_DECLARE_STATIC(name) static G_LOCK_DECLARE (name)
# define G_TRYLOCK(name) g_static_mutex_trylock (G_LOCK_NAME (name))
# endif /* !G_DEBUG_LOCKS */
#else /* !G_THREADS_ENABLED */
# define G_TRYLOCK(name) g_static_mutex_trylock (G_LOCK_NAME (name))
# endif /* !G_DEBUG_LOCKS */
#else /* !G_THREADS_ENABLED */
-# define G_LOCK_DECLARE_STATIC(name) extern gboolean glib_dummy_decl
-# define G_LOCK_DECLARE(name) extern gboolean glib_dummy_decl
+# define G_LOCK_DECLARE_STATIC(name) extern void glib_dummy_decl (void)
+# define G_LOCK_DECLARE(name) extern void glib_dummy_decl (void)
# define G_LOCK(name)
# define G_UNLOCK(name)
# define G_TRYLOCK(name) (FALSE)
# define G_LOCK(name)
# define G_UNLOCK(name)
# define G_TRYLOCK(name) (FALSE)
* such mutexes can be done with G_LOCK(), G_UNLOCK() and G_TRYLOCK()
* respectively.
*/
* such mutexes can be done with G_LOCK(), G_UNLOCK() and G_TRYLOCK()
* respectively.
*/
-extern gboolean glib_dummy_decl;
+extern void glib_dummy_decl (void);
#define G_LOCK_NAME(name) (g__ ## name ## _lock)
#ifdef G_THREADS_ENABLED
# define G_LOCK_DECLARE_STATIC(name) static G_LOCK_DECLARE (name)
#define G_LOCK_NAME(name) (g__ ## name ## _lock)
#ifdef G_THREADS_ENABLED
# define G_LOCK_DECLARE_STATIC(name) static G_LOCK_DECLARE (name)
# define G_TRYLOCK(name) g_static_mutex_trylock (G_LOCK_NAME (name))
# endif /* !G_DEBUG_LOCKS */
#else /* !G_THREADS_ENABLED */
# define G_TRYLOCK(name) g_static_mutex_trylock (G_LOCK_NAME (name))
# endif /* !G_DEBUG_LOCKS */
#else /* !G_THREADS_ENABLED */
-# define G_LOCK_DECLARE_STATIC(name) extern gboolean glib_dummy_decl
-# define G_LOCK_DECLARE(name) extern gboolean glib_dummy_decl
+# define G_LOCK_DECLARE_STATIC(name) extern void glib_dummy_decl (void)
+# define G_LOCK_DECLARE(name) extern void glib_dummy_decl (void)
# define G_LOCK(name)
# define G_UNLOCK(name)
# define G_TRYLOCK(name) (FALSE)
# define G_LOCK(name)
# define G_UNLOCK(name)
# define G_TRYLOCK(name) (FALSE)
typedef struct _GSource GSource;
typedef struct _GPollRec GPollRec;
typedef struct _GSource GSource;
typedef struct _GPollRec GPollRec;
G_SOURCE_READY = 1 << G_HOOK_FLAG_USER_SHIFT,
G_SOURCE_CAN_RECURSE = 1 << (G_HOOK_FLAG_USER_SHIFT + 1)
} GSourceFlags;
G_SOURCE_READY = 1 << G_HOOK_FLAG_USER_SHIFT,
G_SOURCE_CAN_RECURSE = 1 << (G_HOOK_FLAG_USER_SHIFT + 1)
} GSourceFlags;
GHook hook;
gint priority;
gpointer source_data;
};
GHook hook;
gint priority;
gpointer source_data;
};
GTimeVal expiration;
gint interval;
GSourceFunc callback;
};
GTimeVal expiration;
gint interval;
GSourceFunc callback;
};
gint priority;
GPollFD *fd;
GPollRec *next;
gint priority;
GPollFD *fd;
GPollRec *next;
static gboolean poll_waiting = FALSE;
#ifdef HAVE_POLL
static gboolean poll_waiting = FALSE;
#ifdef HAVE_POLL
-static GPollFunc poll_func = (GPollFunc)poll;
-#else
+static GPollFunc poll_func = (GPollFunc) poll;
+#else /* !HAVE_POLL */
/* The following implementation of poll() comes from the GNU C Library.
* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
/* The following implementation of poll() comes from the GNU C Library.
* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
#ifndef NO_FD_SET
# define SELECT_MASK fd_set
#ifndef NO_FD_SET
# define SELECT_MASK fd_set
# ifndef _AIX
typedef long fd_mask;
# endif
# ifndef _AIX
typedef long fd_mask;
# endif
# else
# define SELECT_MASK int
# endif
# else
# define SELECT_MASK int
# endif
static gint
g_poll (GPollFD *fds, guint nfds, gint timeout)
static gint
g_poll (GPollFD *fds, guint nfds, gint timeout)
static GPollFunc poll_func = g_poll;
static GPollFunc poll_func = g_poll;
/* Hooks for adding to the main loop */
/* Hooks for adding to the main loop */
* sure we insert at the end of equal priority items
*/
static gint
* sure we insert at the end of equal priority items
*/
static gint
-g_source_compare (GHook *a, GHook *b)
+g_source_compare (GHook *a,
+ GHook *b)
{
GSource *source_a = (GSource *)a;
GSource *source_b = (GSource *)b;
{
GSource *source_a = (GSource *)a;
GSource *source_b = (GSource *)b;
if (hook)
{
GSource *source = (GSource *)hook;
if (hook)
{
GSource *source = (GSource *)hook;
- ((GSourceFuncs *)source->hook.func)->destroy (source->source_data);
+
+ ((GSourceFuncs *) source->hook.func)->destroy (source->source_data);
g_hook_destroy_link (&source_list, hook);
}
g_hook_destroy_link (&source_list, hook);
}
if (hook)
{
GSource *source = (GSource *)hook;
if (hook)
{
GSource *source = (GSource *)hook;
- ((GSourceFuncs *)source->hook.func)->destroy (source->source_data);
+
+ ((GSourceFuncs *) source->hook.func)->destroy (source->source_data);
g_hook_destroy_link (&source_list, hook);
}
g_hook_destroy_link (&source_list, hook);
}
gpointer data)
{
GSource *source = (GSource *)hook;
gpointer data)
{
GSource *source = (GSource *)hook;
return (source->source_data == data);
}
return (source->source_data == data);
}
G_LOCK (main_loop);
hook = g_hook_find (&source_list, TRUE,
G_LOCK (main_loop);
hook = g_hook_find (&source_list, TRUE,
- g_source_find_source_data, source_data);
+ g_source_find_source_data, source_data);
if (hook)
{
GSource *source = (GSource *)hook;
if (hook)
{
GSource *source = (GSource *)hook;
- ((GSourceFuncs *)source->hook.func)->destroy (source->source_data);
+
+ ((GSourceFuncs *) source->hook.func)->destroy (source->source_data);
g_hook_destroy_link (&source_list, hook);
}
G_UNLOCK (main_loop);
}
g_hook_destroy_link (&source_list, hook);
}
G_UNLOCK (main_loop);
}
-void g_get_current_time (GTimeVal *result)
+void
+g_get_current_time (GTimeVal *result)
- gettimeofday ((struct timeval *)result, NULL);
+ g_return_if_fail (result != NULL);
+
+ gettimeofday ((struct timeval *) result, NULL);
}
/* Running the main loop */
}
/* Running the main loop */
if (G_HOOK_IS_VALID (source))
{
if (G_HOOK_IS_VALID (source))
{
- gboolean (*dispatch) (gpointer, GTimeVal *, gpointer);
gpointer hook_data = source->hook.data;
gpointer source_data = source->source_data;
gpointer hook_data = source->hook.data;
gpointer source_data = source->source_data;
+ gboolean (*dispatch) (gpointer,
+ GTimeVal *,
+ gpointer);
- dispatch = ((GSourceFuncs *)source->hook.func)->dispatch;
+ dispatch = ((GSourceFuncs *) source->hook.func)->dispatch;
source->hook.flags |= G_HOOK_FLAG_IN_CALL;
G_UNLOCK (main_loop);
source->hook.flags |= G_HOOK_FLAG_IN_CALL;
G_UNLOCK (main_loop);
- need_destroy = ! dispatch(source_data,
- current_time,
- hook_data);
+ need_destroy = ! dispatch (source_data,
+ current_time,
+ hook_data);
G_LOCK (main_loop);
source->hook.flags &= ~G_HOOK_FLAG_IN_CALL;
if (need_destroy)
G_LOCK (main_loop);
source->hook.flags &= ~G_HOOK_FLAG_IN_CALL;
if (need_destroy)
- g_hook_destroy_link (&source_list, (GHook *)source);
+ g_hook_destroy_link (&source_list, (GHook *) source);
}
g_hook_unref (&source_list, (GHook *)source);
}
g_hook_unref (&source_list, (GHook *)source);
* run the loop.
*/
static gboolean
* run the loop.
*/
static gboolean
-g_main_iterate (gboolean block, gboolean dispatch)
+g_main_iterate (gboolean block,
+ gboolean dispatch)
{
GHook *hook;
GTimeVal current_time;
{
GHook *hook;
GTimeVal current_time;
typedef struct _GSource GSource;
typedef struct _GPollRec GPollRec;
typedef struct _GSource GSource;
typedef struct _GPollRec GPollRec;
G_SOURCE_READY = 1 << G_HOOK_FLAG_USER_SHIFT,
G_SOURCE_CAN_RECURSE = 1 << (G_HOOK_FLAG_USER_SHIFT + 1)
} GSourceFlags;
G_SOURCE_READY = 1 << G_HOOK_FLAG_USER_SHIFT,
G_SOURCE_CAN_RECURSE = 1 << (G_HOOK_FLAG_USER_SHIFT + 1)
} GSourceFlags;
GHook hook;
gint priority;
gpointer source_data;
};
GHook hook;
gint priority;
gpointer source_data;
};
GTimeVal expiration;
gint interval;
GSourceFunc callback;
};
GTimeVal expiration;
gint interval;
GSourceFunc callback;
};
gint priority;
GPollFD *fd;
GPollRec *next;
gint priority;
GPollFD *fd;
GPollRec *next;
static gboolean poll_waiting = FALSE;
#ifdef HAVE_POLL
static gboolean poll_waiting = FALSE;
#ifdef HAVE_POLL
-static GPollFunc poll_func = (GPollFunc)poll;
-#else
+static GPollFunc poll_func = (GPollFunc) poll;
+#else /* !HAVE_POLL */
/* The following implementation of poll() comes from the GNU C Library.
* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
/* The following implementation of poll() comes from the GNU C Library.
* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
#ifndef NO_FD_SET
# define SELECT_MASK fd_set
#ifndef NO_FD_SET
# define SELECT_MASK fd_set
# ifndef _AIX
typedef long fd_mask;
# endif
# ifndef _AIX
typedef long fd_mask;
# endif
# else
# define SELECT_MASK int
# endif
# else
# define SELECT_MASK int
# endif
static gint
g_poll (GPollFD *fds, guint nfds, gint timeout)
static gint
g_poll (GPollFD *fds, guint nfds, gint timeout)
static GPollFunc poll_func = g_poll;
static GPollFunc poll_func = g_poll;
/* Hooks for adding to the main loop */
/* Hooks for adding to the main loop */
* sure we insert at the end of equal priority items
*/
static gint
* sure we insert at the end of equal priority items
*/
static gint
-g_source_compare (GHook *a, GHook *b)
+g_source_compare (GHook *a,
+ GHook *b)
{
GSource *source_a = (GSource *)a;
GSource *source_b = (GSource *)b;
{
GSource *source_a = (GSource *)a;
GSource *source_b = (GSource *)b;
if (hook)
{
GSource *source = (GSource *)hook;
if (hook)
{
GSource *source = (GSource *)hook;
- ((GSourceFuncs *)source->hook.func)->destroy (source->source_data);
+
+ ((GSourceFuncs *) source->hook.func)->destroy (source->source_data);
g_hook_destroy_link (&source_list, hook);
}
g_hook_destroy_link (&source_list, hook);
}
if (hook)
{
GSource *source = (GSource *)hook;
if (hook)
{
GSource *source = (GSource *)hook;
- ((GSourceFuncs *)source->hook.func)->destroy (source->source_data);
+
+ ((GSourceFuncs *) source->hook.func)->destroy (source->source_data);
g_hook_destroy_link (&source_list, hook);
}
g_hook_destroy_link (&source_list, hook);
}
gpointer data)
{
GSource *source = (GSource *)hook;
gpointer data)
{
GSource *source = (GSource *)hook;
return (source->source_data == data);
}
return (source->source_data == data);
}
G_LOCK (main_loop);
hook = g_hook_find (&source_list, TRUE,
G_LOCK (main_loop);
hook = g_hook_find (&source_list, TRUE,
- g_source_find_source_data, source_data);
+ g_source_find_source_data, source_data);
if (hook)
{
GSource *source = (GSource *)hook;
if (hook)
{
GSource *source = (GSource *)hook;
- ((GSourceFuncs *)source->hook.func)->destroy (source->source_data);
+
+ ((GSourceFuncs *) source->hook.func)->destroy (source->source_data);
g_hook_destroy_link (&source_list, hook);
}
G_UNLOCK (main_loop);
}
g_hook_destroy_link (&source_list, hook);
}
G_UNLOCK (main_loop);
}
-void g_get_current_time (GTimeVal *result)
+void
+g_get_current_time (GTimeVal *result)
- gettimeofday ((struct timeval *)result, NULL);
+ g_return_if_fail (result != NULL);
+
+ gettimeofday ((struct timeval *) result, NULL);
}
/* Running the main loop */
}
/* Running the main loop */
if (G_HOOK_IS_VALID (source))
{
if (G_HOOK_IS_VALID (source))
{
- gboolean (*dispatch) (gpointer, GTimeVal *, gpointer);
gpointer hook_data = source->hook.data;
gpointer source_data = source->source_data;
gpointer hook_data = source->hook.data;
gpointer source_data = source->source_data;
+ gboolean (*dispatch) (gpointer,
+ GTimeVal *,
+ gpointer);
- dispatch = ((GSourceFuncs *)source->hook.func)->dispatch;
+ dispatch = ((GSourceFuncs *) source->hook.func)->dispatch;
source->hook.flags |= G_HOOK_FLAG_IN_CALL;
G_UNLOCK (main_loop);
source->hook.flags |= G_HOOK_FLAG_IN_CALL;
G_UNLOCK (main_loop);
- need_destroy = ! dispatch(source_data,
- current_time,
- hook_data);
+ need_destroy = ! dispatch (source_data,
+ current_time,
+ hook_data);
G_LOCK (main_loop);
source->hook.flags &= ~G_HOOK_FLAG_IN_CALL;
if (need_destroy)
G_LOCK (main_loop);
source->hook.flags &= ~G_HOOK_FLAG_IN_CALL;
if (need_destroy)
- g_hook_destroy_link (&source_list, (GHook *)source);
+ g_hook_destroy_link (&source_list, (GHook *) source);
}
g_hook_unref (&source_list, (GHook *)source);
}
g_hook_unref (&source_list, (GHook *)source);
* run the loop.
*/
static gboolean
* run the loop.
*/
static gboolean
-g_main_iterate (gboolean block, gboolean dispatch)
+g_main_iterate (gboolean block,
+ gboolean dispatch)
{
GHook *hook;
GTimeVal current_time;
{
GHook *hook;
GTimeVal current_time;