giochannel.h giowin32.c Stylistic cleanups. Use G_STRLOC in g_warning()
authorTor Lillqvist <tml@iki.fi>
Thu, 1 Feb 2001 22:28:48 +0000 (22:28 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Thu, 1 Feb 2001 22:28:48 +0000 (22:28 +0000)
2001-02-02  Tor Lillqvist  <tml@iki.fi>

* 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  <tml@iki.fi>

* glibconfig.h.win32.in: Corresponding change as below to
GStaticMutex.

17 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
giochannel.h
giowin32.c
glib.def
glib/giochannel.h
glib/giowin32.c
glib/glib.def
glib/gmain.c
glibconfig.h.win32.in
gmain.c

index ad1a004..8c1984a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-02-02  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_init to allow
@@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls.
 
+2001-01-31  Tor Lillqvist  <tml@iki.fi>
+
+       * glibconfig.h.win32.in: Corresponding change as below to
+       GStaticMutex.
+
 2001-01-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_free to allow using
index ad1a004..8c1984a 100644 (file)
@@ -1,3 +1,11 @@
+2001-02-02  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_init to allow
@@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls.
 
+2001-01-31  Tor Lillqvist  <tml@iki.fi>
+
+       * glibconfig.h.win32.in: Corresponding change as below to
+       GStaticMutex.
+
 2001-01-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_free to allow using
index ad1a004..8c1984a 100644 (file)
@@ -1,3 +1,11 @@
+2001-02-02  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_init to allow
@@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls.
 
+2001-01-31  Tor Lillqvist  <tml@iki.fi>
+
+       * glibconfig.h.win32.in: Corresponding change as below to
+       GStaticMutex.
+
 2001-01-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_free to allow using
index ad1a004..8c1984a 100644 (file)
@@ -1,3 +1,11 @@
+2001-02-02  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_init to allow
@@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls.
 
+2001-01-31  Tor Lillqvist  <tml@iki.fi>
+
+       * glibconfig.h.win32.in: Corresponding change as below to
+       GStaticMutex.
+
 2001-01-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_free to allow using
index ad1a004..8c1984a 100644 (file)
@@ -1,3 +1,11 @@
+2001-02-02  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_init to allow
@@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls.
 
+2001-01-31  Tor Lillqvist  <tml@iki.fi>
+
+       * glibconfig.h.win32.in: Corresponding change as below to
+       GStaticMutex.
+
 2001-01-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_free to allow using
index ad1a004..8c1984a 100644 (file)
@@ -1,3 +1,11 @@
+2001-02-02  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_init to allow
@@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls.
 
+2001-01-31  Tor Lillqvist  <tml@iki.fi>
+
+       * glibconfig.h.win32.in: Corresponding change as below to
+       GStaticMutex.
+
 2001-01-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_free to allow using
index ad1a004..8c1984a 100644 (file)
@@ -1,3 +1,11 @@
+2001-02-02  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_init to allow
@@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls.
 
+2001-01-31  Tor Lillqvist  <tml@iki.fi>
+
+       * glibconfig.h.win32.in: Corresponding change as below to
+       GStaticMutex.
+
 2001-01-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_free to allow using
index ad1a004..8c1984a 100644 (file)
@@ -1,3 +1,11 @@
+2001-02-02  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_init to allow
@@ -8,6 +16,11 @@ Wed Jan 31 13:46:58 2001  Owen Taylor  <otaylor@redhat.com>
 
        * acinclude.m4 glib-gettext.m4: Fix problem with --disable-nls.
 
+2001-01-31  Tor Lillqvist  <tml@iki.fi>
+
+       * glibconfig.h.win32.in: Corresponding change as below to
+       GStaticMutex.
+
 2001-01-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * gthread.c, gthread.h: Added g_static_mutex_free to allow using
index 84550ca..ed9c7c8 100644 (file)
@@ -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
 
index a717cc7..c542897 100644 (file)
@@ -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;
 }
 
index abf26f9..5eaba41 100644 (file)
--- 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
index 84550ca..ed9c7c8 100644 (file)
@@ -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
 
index a717cc7..c542897 100644 (file)
@@ -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;
 }
 
index abf26f9..5eaba41 100644 (file)
@@ -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
index 946a862..b4db4d2 100644 (file)
@@ -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
index 482a19c..49ecbf0 100644 (file)
@@ -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 946a862..b4db4d2 100644 (file)
--- 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