From c2bd295c57059ac0c14d6fbb3741b1f69dbc4ff3 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 1 Feb 2001 22:28:48 +0000 Subject: [PATCH] giochannel.h giowin32.c Stylistic cleanups. Use G_STRLOC in g_warning() 2001-02-02 Tor Lillqvist * giochannel.h * giowin32.c * gmain.c: Stylistic cleanups. Use G_STRLOC in g_warning() calls. * glib.def: Add missing functions. 2001-01-31 Tor Lillqvist * glibconfig.h.win32.in: Corresponding change as below to GStaticMutex. --- ChangeLog | 13 +++++++++++++ ChangeLog.pre-2-0 | 13 +++++++++++++ ChangeLog.pre-2-10 | 13 +++++++++++++ ChangeLog.pre-2-12 | 13 +++++++++++++ ChangeLog.pre-2-2 | 13 +++++++++++++ ChangeLog.pre-2-4 | 13 +++++++++++++ ChangeLog.pre-2-6 | 13 +++++++++++++ ChangeLog.pre-2-8 | 13 +++++++++++++ giochannel.h | 2 +- giowin32.c | 18 ++++++++++-------- glib.def | 18 ++++++++++++++++++ glib/giochannel.h | 2 +- glib/giowin32.c | 18 ++++++++++-------- glib/glib.def | 18 ++++++++++++++++++ glib/gmain.c | 17 ++++++++++------- glibconfig.h.win32.in | 17 +++++++---------- gmain.c | 17 ++++++++++------- 17 files changed, 189 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad1a0040a..8c1984a1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-02-02 Tor Lillqvist + + * giochannel.h + * giowin32.c + * gmain.c: Stylistic cleanups. Use G_STRLOC in g_warning() calls. + + * glib.def: Add missing functions. + 2001-02-01 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_init to allow @@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001 Owen Taylor * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls. +2001-01-31 Tor Lillqvist + + * glibconfig.h.win32.in: Corresponding change as below to + GStaticMutex. + 2001-01-30 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_free to allow using diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index ad1a0040a..8c1984a1e 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +2001-02-02 Tor Lillqvist + + * giochannel.h + * giowin32.c + * gmain.c: Stylistic cleanups. Use G_STRLOC in g_warning() calls. + + * glib.def: Add missing functions. + 2001-02-01 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_init to allow @@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001 Owen Taylor * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls. +2001-01-31 Tor Lillqvist + + * glibconfig.h.win32.in: Corresponding change as below to + GStaticMutex. + 2001-01-30 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_free to allow using diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ad1a0040a..8c1984a1e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2001-02-02 Tor Lillqvist + + * giochannel.h + * giowin32.c + * gmain.c: Stylistic cleanups. Use G_STRLOC in g_warning() calls. + + * glib.def: Add missing functions. + 2001-02-01 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_init to allow @@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001 Owen Taylor * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls. +2001-01-31 Tor Lillqvist + + * glibconfig.h.win32.in: Corresponding change as below to + GStaticMutex. + 2001-01-30 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_free to allow using diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index ad1a0040a..8c1984a1e 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +2001-02-02 Tor Lillqvist + + * giochannel.h + * giowin32.c + * gmain.c: Stylistic cleanups. Use G_STRLOC in g_warning() calls. + + * glib.def: Add missing functions. + 2001-02-01 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_init to allow @@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001 Owen Taylor * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls. +2001-01-31 Tor Lillqvist + + * glibconfig.h.win32.in: Corresponding change as below to + GStaticMutex. + 2001-01-30 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_free to allow using diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index ad1a0040a..8c1984a1e 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +2001-02-02 Tor Lillqvist + + * giochannel.h + * giowin32.c + * gmain.c: Stylistic cleanups. Use G_STRLOC in g_warning() calls. + + * glib.def: Add missing functions. + 2001-02-01 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_init to allow @@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001 Owen Taylor * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls. +2001-01-31 Tor Lillqvist + + * glibconfig.h.win32.in: Corresponding change as below to + GStaticMutex. + 2001-01-30 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_free to allow using diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index ad1a0040a..8c1984a1e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +2001-02-02 Tor Lillqvist + + * giochannel.h + * giowin32.c + * gmain.c: Stylistic cleanups. Use G_STRLOC in g_warning() calls. + + * glib.def: Add missing functions. + 2001-02-01 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_init to allow @@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001 Owen Taylor * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls. +2001-01-31 Tor Lillqvist + + * glibconfig.h.win32.in: Corresponding change as below to + GStaticMutex. + 2001-01-30 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_free to allow using diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ad1a0040a..8c1984a1e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2001-02-02 Tor Lillqvist + + * giochannel.h + * giowin32.c + * gmain.c: Stylistic cleanups. Use G_STRLOC in g_warning() calls. + + * glib.def: Add missing functions. + 2001-02-01 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_init to allow @@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001 Owen Taylor * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls. +2001-01-31 Tor Lillqvist + + * glibconfig.h.win32.in: Corresponding change as below to + GStaticMutex. + 2001-01-30 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_free to allow using diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ad1a0040a..8c1984a1e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2001-02-02 Tor Lillqvist + + * giochannel.h + * giowin32.c + * gmain.c: Stylistic cleanups. Use G_STRLOC in g_warning() calls. + + * glib.def: Add missing functions. + 2001-02-01 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_init to allow @@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001 Owen Taylor * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls. +2001-01-31 Tor Lillqvist + + * glibconfig.h.win32.in: Corresponding change as below to + GStaticMutex. + 2001-01-30 Sebastian Wilhelmi * gthread.c, gthread.h: Added g_static_mutex_free to allow using diff --git a/giochannel.h b/giochannel.h index 84550cad7..ed9c7c8c0 100644 --- a/giochannel.h +++ b/giochannel.h @@ -188,7 +188,7 @@ gint g_io_channel_win32_get_fd (GIOChannel *channel); * you can use normal recv() or recvfrom() on sockets even if GLib * is polling them. */ -GIOChannel *g_io_channel_win32_new_socket (int socket); +GIOChannel *g_io_channel_win32_new_socket (gint socket); #endif diff --git a/giowin32.c b/giowin32.c index a717cc74a..c54289735 100644 --- a/giowin32.c +++ b/giowin32.c @@ -282,10 +282,12 @@ create_thread (GIOWin32Channel *channel, GIOCondition condition, unsigned (__stdcall *thread) (void *parameter)) { - if ((channel->thread_handle = - (HANDLE) _beginthreadex (NULL, 0, thread, channel, 0, - &channel->thread_id)) == 0) - g_warning ("Error creating reader thread: %s", strerror (errno)); + channel->thread_handle = + (HANDLE) _beginthreadex (NULL, 0, thread, channel, 0, + &channel->thread_id); + if (channel->thread_handle == 0) + g_warning (G_STRLOC ": Error creating reader thread: %s", + strerror (errno)); WaitForSingleObject (channel->space_avail_event, INFINITE); } @@ -545,7 +547,7 @@ g_io_win32_dispatch (GSource *source, if (!func) { - g_warning ("GIOWin32Watch dispatched without callback\n" + g_warning (G_STRLOC ": GIOWin32Watch dispatched without callback\n" "You must call g_source_connect()."); return FALSE; } @@ -819,7 +821,7 @@ g_io_win32_fd_seek (GIOChannel *channel, whence = SEEK_END; break; default: - g_warning ("g_io_win32_fd_seek: unknown seek type"); + g_warning (G_STRLOC ": Unknown seek type %d", (int) type); return G_IO_ERROR_UNKNOWN; } @@ -1030,7 +1032,7 @@ g_io_channel_win32_new_fd (gint fd) if (fstat (fd, &st) == -1) { - g_warning ("%d isn't a (emulated) file descriptor", fd); + g_warning (G_STRLOC ": %d isn't a (emulated) file descriptor", fd); return NULL; } @@ -1084,7 +1086,7 @@ g_io_channel_unix_new (gint fd) if (getsockopt (fd, SOL_SOCKET, SO_TYPE, NULL, NULL) != SO_ERROR) return g_io_channel_win32_new_socket(fd); - g_warning ("%d is neither a file descriptor or a socket", fd); + g_warning (G_STRLOC ": %d is neither a file descriptor or a socket", fd); return NULL; } diff --git a/glib.def b/glib.def index abf26f938..5eaba4149 100644 --- a/glib.def +++ b/glib.def @@ -12,6 +12,23 @@ EXPORTS g_array_sized_new g_array_sort g_array_sort_with_data + g_async_queue_length + g_async_queue_length_unlocked + g_async_queue_lock + g_async_queue_new + g_async_queue_pop + g_async_queue_pop_unlocked + g_async_queue_push + g_async_queue_push_unlocked + g_async_queue_ref + g_async_queue_ref_unlocked + g_async_queue_timed_pop + g_async_queue_timed_pop_unlocked + g_async_queue_try_pop + g_async_queue_try_pop_unlocked + g_async_queue_unlock + g_async_queue_unref + g_async_queue_unref_and_unlock g_atexit g_basename g_bit_nth_lsf @@ -484,6 +501,7 @@ EXPORTS g_string_insert_c g_string_insert_len g_string_new + g_string_new_len g_string_prepend g_string_prepend_c g_string_prepend_len diff --git a/glib/giochannel.h b/glib/giochannel.h index 84550cad7..ed9c7c8c0 100644 --- a/glib/giochannel.h +++ b/glib/giochannel.h @@ -188,7 +188,7 @@ gint g_io_channel_win32_get_fd (GIOChannel *channel); * you can use normal recv() or recvfrom() on sockets even if GLib * is polling them. */ -GIOChannel *g_io_channel_win32_new_socket (int socket); +GIOChannel *g_io_channel_win32_new_socket (gint socket); #endif diff --git a/glib/giowin32.c b/glib/giowin32.c index a717cc74a..c54289735 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -282,10 +282,12 @@ create_thread (GIOWin32Channel *channel, GIOCondition condition, unsigned (__stdcall *thread) (void *parameter)) { - if ((channel->thread_handle = - (HANDLE) _beginthreadex (NULL, 0, thread, channel, 0, - &channel->thread_id)) == 0) - g_warning ("Error creating reader thread: %s", strerror (errno)); + channel->thread_handle = + (HANDLE) _beginthreadex (NULL, 0, thread, channel, 0, + &channel->thread_id); + if (channel->thread_handle == 0) + g_warning (G_STRLOC ": Error creating reader thread: %s", + strerror (errno)); WaitForSingleObject (channel->space_avail_event, INFINITE); } @@ -545,7 +547,7 @@ g_io_win32_dispatch (GSource *source, if (!func) { - g_warning ("GIOWin32Watch dispatched without callback\n" + g_warning (G_STRLOC ": GIOWin32Watch dispatched without callback\n" "You must call g_source_connect()."); return FALSE; } @@ -819,7 +821,7 @@ g_io_win32_fd_seek (GIOChannel *channel, whence = SEEK_END; break; default: - g_warning ("g_io_win32_fd_seek: unknown seek type"); + g_warning (G_STRLOC ": Unknown seek type %d", (int) type); return G_IO_ERROR_UNKNOWN; } @@ -1030,7 +1032,7 @@ g_io_channel_win32_new_fd (gint fd) if (fstat (fd, &st) == -1) { - g_warning ("%d isn't a (emulated) file descriptor", fd); + g_warning (G_STRLOC ": %d isn't a (emulated) file descriptor", fd); return NULL; } @@ -1084,7 +1086,7 @@ g_io_channel_unix_new (gint fd) if (getsockopt (fd, SOL_SOCKET, SO_TYPE, NULL, NULL) != SO_ERROR) return g_io_channel_win32_new_socket(fd); - g_warning ("%d is neither a file descriptor or a socket", fd); + g_warning (G_STRLOC ": %d is neither a file descriptor or a socket", fd); return NULL; } diff --git a/glib/glib.def b/glib/glib.def index abf26f938..5eaba4149 100644 --- a/glib/glib.def +++ b/glib/glib.def @@ -12,6 +12,23 @@ EXPORTS g_array_sized_new g_array_sort g_array_sort_with_data + g_async_queue_length + g_async_queue_length_unlocked + g_async_queue_lock + g_async_queue_new + g_async_queue_pop + g_async_queue_pop_unlocked + g_async_queue_push + g_async_queue_push_unlocked + g_async_queue_ref + g_async_queue_ref_unlocked + g_async_queue_timed_pop + g_async_queue_timed_pop_unlocked + g_async_queue_try_pop + g_async_queue_try_pop_unlocked + g_async_queue_unlock + g_async_queue_unref + g_async_queue_unref_and_unlock g_atexit g_basename g_bit_nth_lsf @@ -484,6 +501,7 @@ EXPORTS g_string_insert_c g_string_insert_len g_string_new + g_string_new_len g_string_prepend g_string_prepend_c g_string_prepend_len diff --git a/glib/gmain.c b/glib/gmain.c index 946a86262..b4db4d241 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -294,7 +294,7 @@ g_poll (GPollFD *fds, g_print ("WaitMessage\n"); #endif if (!WaitMessage ()) - g_warning ("g_poll: WaitMessage failed"); + g_warning (G_STRLOC ": WaitMessage() failed"); ready = WAIT_OBJECT_0 + nhandles; } else if (timeout == 0) @@ -310,8 +310,9 @@ g_poll (GPollFD *fds, * -> Set a timer, wait for message, * kill timer, use PeekMessage */ - if ((timer = SetTimer (NULL, 0, timeout, NULL)) == 0) - g_warning ("g_poll: SetTimer failed"); + timer = SetTimer (NULL, 0, timeout, NULL); + if (timer == 0) + g_warning (G_STRLOC ": SetTimer() failed"); else { #ifdef G_MAIN_POLL_DEBUG @@ -342,7 +343,7 @@ g_poll (GPollFD *fds, timeout, QS_ALLINPUT); if (ready == WAIT_FAILED) - g_warning ("g_poll: MsgWaitForMultipleObjects failed"); + g_warning (G_STRLOC ": MsgWaitForMultipleObjects() failed"); } } } @@ -361,7 +362,7 @@ g_poll (GPollFD *fds, #endif ready = WaitForMultipleObjects (nhandles, handles, FALSE, timeout); if (ready == WAIT_FAILED) - g_warning ("g_poll: WaitForMultipleObjects failed"); + g_warning (G_STRLOC ": WaitForMultipleObjects() failed"); } #ifdef G_MAIN_POLL_DEBUG @@ -600,8 +601,10 @@ g_main_context_get (GThread *thread) context->wake_up_rec.events = G_IO_IN; g_main_context_add_poll_unlocked (context, 0, &context->wake_up_rec); #else - if ((context->wake_up_semaphore = CreateSemaphore (NULL, 0, 100, NULL)) == NULL) - g_error ("Cannot create wake-up semaphore: %s", g_win32_error_message (GetLastError ())); + context->wake_up_semaphore = CreateSemaphore (NULL, 0, 100, NULL); + if (context->wake_up_semaphore == NULL) + g_error ("Cannot create wake-up semaphore: %s", + g_win32_error_message (GetLastError ())); context->wake_up_rec.fd = (gint) context->wake_up_semaphore; context->wake_up_rec.events = G_IO_IN; #ifdef G_MAIN_POLL_DEBUG diff --git a/glibconfig.h.win32.in b/glibconfig.h.win32.in index 482a19c26..49ecbf079 100644 --- a/glibconfig.h.win32.in +++ b/glibconfig.h.win32.in @@ -134,16 +134,13 @@ typedef struct _GStaticMutex GStaticMutex; struct _GStaticMutex { struct _GMutex *runtime_mutex; - struct { - union { - /* The size of the pad array should be sizeof (pthread_mutex_t) */ - /* This value corresponds to the 1999-05-30 version of pthreads-win32 */ - char pad[4]; - double dummy_double; - void *dummy_pointer; - long dummy_long; - } mutex; - void *debug_info; + union { + /* The size of the pad array should be sizeof (pthread_mutex_t) */ + /* This value corresponds to the 1999-05-30 version of pthreads-win32 */ + char pad[4]; + double dummy_double; + void *dummy_pointer; + long dummy_long; } static_mutex; }; /* This should be NULL followed by the bytes in PTHREAD_MUTEX_INITIALIZER */ diff --git a/gmain.c b/gmain.c index 946a86262..b4db4d241 100644 --- a/gmain.c +++ b/gmain.c @@ -294,7 +294,7 @@ g_poll (GPollFD *fds, g_print ("WaitMessage\n"); #endif if (!WaitMessage ()) - g_warning ("g_poll: WaitMessage failed"); + g_warning (G_STRLOC ": WaitMessage() failed"); ready = WAIT_OBJECT_0 + nhandles; } else if (timeout == 0) @@ -310,8 +310,9 @@ g_poll (GPollFD *fds, * -> Set a timer, wait for message, * kill timer, use PeekMessage */ - if ((timer = SetTimer (NULL, 0, timeout, NULL)) == 0) - g_warning ("g_poll: SetTimer failed"); + timer = SetTimer (NULL, 0, timeout, NULL); + if (timer == 0) + g_warning (G_STRLOC ": SetTimer() failed"); else { #ifdef G_MAIN_POLL_DEBUG @@ -342,7 +343,7 @@ g_poll (GPollFD *fds, timeout, QS_ALLINPUT); if (ready == WAIT_FAILED) - g_warning ("g_poll: MsgWaitForMultipleObjects failed"); + g_warning (G_STRLOC ": MsgWaitForMultipleObjects() failed"); } } } @@ -361,7 +362,7 @@ g_poll (GPollFD *fds, #endif ready = WaitForMultipleObjects (nhandles, handles, FALSE, timeout); if (ready == WAIT_FAILED) - g_warning ("g_poll: WaitForMultipleObjects failed"); + g_warning (G_STRLOC ": WaitForMultipleObjects() failed"); } #ifdef G_MAIN_POLL_DEBUG @@ -600,8 +601,10 @@ g_main_context_get (GThread *thread) context->wake_up_rec.events = G_IO_IN; g_main_context_add_poll_unlocked (context, 0, &context->wake_up_rec); #else - if ((context->wake_up_semaphore = CreateSemaphore (NULL, 0, 100, NULL)) == NULL) - g_error ("Cannot create wake-up semaphore: %s", g_win32_error_message (GetLastError ())); + context->wake_up_semaphore = CreateSemaphore (NULL, 0, 100, NULL); + if (context->wake_up_semaphore == NULL) + g_error ("Cannot create wake-up semaphore: %s", + g_win32_error_message (GetLastError ())); context->wake_up_rec.fd = (gint) context->wake_up_semaphore; context->wake_up_rec.events = G_IO_IN; #ifdef G_MAIN_POLL_DEBUG