From a2fb1d96ef4660f94c2bed6cad1749c10013d351 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 2 Jun 2016 22:38:36 +0100 Subject: [PATCH] windows: Make select_result() return void. Nothing now uses its return value anyway. --- windows/winnet.c | 33 +++++++++++++-------------------- windows/winstuff.h | 2 +- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/windows/winnet.c b/windows/winnet.c index fc26c3e5..0ec64a55 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -1625,9 +1625,9 @@ static void sk_tcp_write_eof(Socket sock) try_send(s); } -int select_result(WPARAM wParam, LPARAM lParam) +void select_result(WPARAM wParam, LPARAM lParam) { - int ret, open; + int ret; DWORD err; char buf[20480]; /* nice big buffer for plenty of speed */ Actual_Socket s; @@ -1636,11 +1636,11 @@ int select_result(WPARAM wParam, LPARAM lParam) /* wParam is the socket itself */ if (wParam == 0) - return 1; /* boggle */ + return; /* boggle */ s = find234(sktree, (void *) wParam, cmpforsearch); if (!s) - return 1; /* boggle */ + return; /* boggle */ if ((err = WSAGETSELECTERROR(lParam)) != 0) { /* @@ -1657,9 +1657,8 @@ int select_result(WPARAM wParam, LPARAM lParam) } } if (err != 0) - return plug_closing(s->plug, winsock_error_string(err), err, 0); - else - return 1; + plug_closing(s->plug, winsock_error_string(err), err, 0); + return; } noise_ultralight(lParam); @@ -1712,12 +1711,11 @@ int select_result(WPARAM wParam, LPARAM lParam) } } if (ret < 0) { - return plug_closing(s->plug, winsock_error_string(err), err, - 0); + plug_closing(s->plug, winsock_error_string(err), err, 0); } else if (0 == ret) { - return plug_closing(s->plug, NULL, 0, 0); + plug_closing(s->plug, NULL, 0, 0); } else { - return plug_receive(s->plug, atmark ? 0 : 1, buf, ret); + plug_receive(s->plug, atmark ? 0 : 1, buf, ret); } break; case FD_OOB: @@ -1737,7 +1735,7 @@ int select_result(WPARAM wParam, LPARAM lParam) logevent(NULL, str); fatalbox("%s", str); } else { - return plug_receive(s->plug, 2, buf, ret); + plug_receive(s->plug, 2, buf, ret); } break; case FD_WRITE: @@ -1753,23 +1751,20 @@ int select_result(WPARAM wParam, LPARAM lParam) break; case FD_CLOSE: /* Signal a close on the socket. First read any outstanding data. */ - open = 1; do { ret = p_recv(s->s, buf, sizeof(buf), 0); if (ret < 0) { err = p_WSAGetLastError(); if (err == WSAEWOULDBLOCK) break; - return plug_closing(s->plug, winsock_error_string(err), - err, 0); + plug_closing(s->plug, winsock_error_string(err), err, 0); } else { if (ret) - open &= plug_receive(s->plug, 0, buf, ret); + plug_receive(s->plug, 0, buf, ret); else - open &= plug_closing(s->plug, NULL, 0, 0); + plug_closing(s->plug, NULL, 0, 0); } } while (ret > 0); - return open; case FD_ACCEPT: { #ifdef NO_IPV6 @@ -1807,8 +1802,6 @@ int select_result(WPARAM wParam, LPARAM lParam) } } } - - return 1; } /* diff --git a/windows/winstuff.h b/windows/winstuff.h index f8c4243f..dfa032f4 100644 --- a/windows/winstuff.h +++ b/windows/winstuff.h @@ -284,7 +284,7 @@ GLOBAL void *logctx; /* * Exports from winnet.c. */ -extern int select_result(WPARAM, LPARAM); +extern void select_result(WPARAM, LPARAM); /* * winnet.c dynamically loads WinSock 2 or WinSock 1 depending on