Commit c2bd295c authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

giochannel.h giowin32.c Stylistic cleanups. Use G_STRLOC in g_warning()

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.
parent 5434105f
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
......
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
......
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
......
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
......
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
......
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
......
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
......
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
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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
......
......@@ -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 */
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment