Mercurial > pidgin.yaz
diff libpurple/win32/giowin32.c @ 31534:a8cc50c2279f
Remove trailing whitespace
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 04 Jan 2011 06:55:30 +0000 |
parents | 1568dc7a14f8 |
children |
line wrap: on
line diff
--- a/libpurple/win32/giowin32.c Tue Jan 04 06:42:45 2011 +0000 +++ b/libpurple/win32/giowin32.c Tue Jan 04 06:55:30 2011 +0000 @@ -72,14 +72,14 @@ * as provided by WinSock. */ GIOWin32ChannelType type; - + gboolean debug; CRITICAL_SECTION mutex; /* This is used by G_IO_WIN32_WINDOWS_MESSAGES channels */ HWND hwnd; /* handle of window, or NULL */ - + /* Following fields are used by both fd and socket channels. */ gboolean running; /* Is reader thread running. FALSE if * EOF has been reached. @@ -94,7 +94,7 @@ gushort revents; /* Following fields used by fd channels for input */ - + /* Data is kept in a circular buffer. To be able to distinguish between * empty and full buffer, we cannot fill it completely, but have to * leave a one character gap. @@ -154,7 +154,7 @@ else return FALSE; #endif -} +} static void g_io_channel_win32_init (GIOWin32Channel *channel) @@ -178,7 +178,7 @@ create_events (GIOWin32Channel *channel) { SECURITY_ATTRIBUTES sec_attrs; - + sec_attrs.nLength = sizeof (SECURITY_ATTRIBUTES); sec_attrs.lpSecurityDescriptor = NULL; sec_attrs.bInheritHandle = FALSE; @@ -254,7 +254,7 @@ g_warning (G_STRLOC ": Error binding to reset_recv socket: %s\n", g_win32_error_message (WSAGetLastError ())); } - + len = sizeof (local2); if (getsockname (channel->reset_recv, (struct sockaddr *)&local2, &len) == SOCKET_ERROR) { @@ -292,12 +292,12 @@ channel->fd, (guint) channel->data_avail_event, (guint) channel->data_avail_noticed_event); - + channel->rdp = channel->wrp = 0; channel->running = TRUE; SetEvent (channel->space_avail_event); - + while (channel->running) { FD_ZERO (&read_fds); @@ -317,7 +317,7 @@ FD_SET (channel->fd, &write_fds); if (watch->condition & G_IO_ERR) FD_SET (channel->fd, &except_fds); - + tmp = tmp->next; } UNLOCK (channel->mutex); @@ -328,9 +328,9 @@ (FD_ISSET (channel->fd, &read_fds) ? " IN" : ""), (FD_ISSET (channel->fd, &write_fds) ? " OUT" : ""), (FD_ISSET (channel->fd, &except_fds) ? " ERR" : "")); - + n = select (1, &read_fds, &write_fds, &except_fds, NULL); - + LOCK (channel->mutex); if (channel->needs_close) { @@ -362,7 +362,7 @@ (FD_ISSET (channel->fd, &read_fds) ? " IN" : ""), (FD_ISSET (channel->fd, &write_fds) ? " OUT" : ""), (FD_ISSET (channel->fd, &except_fds) ? " ERR" : "")); - + if (FD_ISSET (channel->fd, &read_fds)) channel->revents |= G_IO_IN; if (FD_ISSET (channel->fd, &write_fds)) @@ -418,9 +418,9 @@ GIOWin32Watch *watch = (GIOWin32Watch *)source; GIOCondition buffer_condition = g_io_channel_get_buffer_condition (watch->channel); GIOWin32Channel *channel = (GIOWin32Channel *)watch->channel; - + *timeout = -1; - + if (channel->debug) g_print ("g_io_win32_prepare: for thread %#x buffer_condition:%#x\n" " watch->pollfd.events:%#x watch->pollfd.revents:%#x channel->revents:%#x\n", @@ -478,7 +478,7 @@ { return (PeekMessage (&msg, channel->hwnd, 0, 0, PM_NOREMOVE)); } - + if (channel->type == G_IO_WIN32_SOCKET) { LOCK (channel->mutex); @@ -503,14 +503,14 @@ GIOFunc func = (GIOFunc)callback; GIOWin32Watch *watch = (GIOWin32Watch *)source; GIOCondition buffer_condition = g_io_channel_get_buffer_condition (watch->channel); - + if (!func) { g_warning (G_STRLOC ": GIOWin32Watch dispatched without callback\n" "You must call g_source_connect()."); return FALSE; } - + return (*func) (watch->channel, (watch->pollfd.revents | buffer_condition) & watch->condition, user_data); @@ -522,7 +522,7 @@ GIOWin32Watch *watch = (GIOWin32Watch *)source; GIOWin32Channel *channel = (GIOWin32Channel *)watch->channel; char send_buffer[] = "f"; - + LOCK (channel->mutex); if (channel->debug) g_print ("g_io_win32_finalize: channel with thread %#x\n", @@ -563,18 +563,18 @@ source = g_source_new (&wp_g_io_watch_funcs, sizeof (GIOWin32Watch)); watch = (GIOWin32Watch *)source; - + watch->channel = channel; g_io_channel_ref (channel); - + watch->condition = condition; - + if (win32_channel->data_avail_event == NULL) create_events (win32_channel); watch->pollfd.fd = (gint) win32_channel->data_avail_event; watch->pollfd.events = condition; - + if (win32_channel->debug) g_print ("g_io_win32_create_watch: fd:%d condition:%#x handle:%#x\n", win32_channel->fd, condition, watch->pollfd.fd); @@ -597,7 +597,7 @@ g_io_win32_free (GIOChannel *channel) { GIOWin32Channel *win32_channel = (GIOWin32Channel *)channel; - + if (win32_channel->debug) g_print ("thread %#x: freeing channel, fd: %d\n", win32_channel->thread_id, @@ -643,7 +643,7 @@ if (win32_channel->debug) g_print ("g_io_win32_sock_read: recv:%d\n", result); - + if (result == SOCKET_ERROR) { *bytes_read = 0; @@ -674,7 +674,7 @@ internal_status = G_IO_STATUS_EOF; } - if ((internal_status == G_IO_STATUS_EOF) || + if ((internal_status == G_IO_STATUS_EOF) || (internal_status == G_IO_STATUS_ERROR)) { LOCK (win32_channel->mutex); @@ -697,7 +697,7 @@ gint result; GIOChannelError error = G_IO_STATUS_NORMAL; char send_buffer[] = "sw"; - + if (win32_channel->debug) g_print ("g_io_win32_sock_write: sockfd:%d count:%d\n", win32_channel->fd, count); @@ -705,10 +705,10 @@ repeat: #endif result = send (win32_channel->fd, buf, count, 0); - + if (win32_channel->debug) g_print ("g_io_win32_sock_write: send:%d\n", result); - + if (result == SOCKET_ERROR) { *bytes_written = 0; @@ -767,7 +767,7 @@ g_print ("thread %#x: closing socket %d\n", win32_channel->thread_id, win32_channel->fd); - + closesocket (win32_channel->fd); win32_channel->fd = -1; }