Eliminate (void) cast on standalone function calls throughout.

This commit is contained in:
Christopher Faylor 2005-07-06 20:05:03 +00:00
parent dee9edd9ed
commit 0c55f6ed60
41 changed files with 110 additions and 106 deletions

View File

@ -1,3 +1,7 @@
2005-07-06 Christopher Faylor <cgf@timesys.com>
Eliminate (void) cast on standalone function calls throughout.
2005-07-05 Christopher Faylor <cgf@timesys.com> 2005-07-05 Christopher Faylor <cgf@timesys.com>
* dcrt0.cc (cygwin_exit): Mark as "noreturn". * dcrt0.cc (cygwin_exit): Mark as "noreturn".

View File

@ -162,7 +162,7 @@ cygheap_init ()
#endif #endif
cygheap_max = cygheap; cygheap_max = cygheap;
(void) _csbrk (sizeof (*cygheap)); _csbrk (sizeof (*cygheap));
} }
if (!cygheap->fdtab) if (!cygheap->fdtab)
cygheap->fdtab.init (); cygheap->fdtab.init ();
@ -304,7 +304,7 @@ extern "C" void __stdcall
cfree (void *s) cfree (void *s)
{ {
assert (!inheap (s)); assert (!inheap (s));
(void) _cfree (tocygheap (s)); _cfree (tocygheap (s));
MALLOC_CHECK; MALLOC_CHECK;
} }

View File

@ -258,8 +258,8 @@ cygthread::terminate_thread ()
if (!inuse) if (!inuse)
goto force_notterminated; goto force_notterminated;
(void) TerminateThread (h, 0); TerminateThread (h, 0);
(void) WaitForSingleObject (h, INFINITE); WaitForSingleObject (h, INFINITE);
CloseHandle (h); CloseHandle (h);
if (!inuse || exiting) if (!inuse || exiting)
@ -270,7 +270,7 @@ cygthread::terminate_thread ()
MEMORY_BASIC_INFORMATION m; MEMORY_BASIC_INFORMATION m;
memset (&m, 0, sizeof (m)); memset (&m, 0, sizeof (m));
(void) VirtualQuery (stack_ptr, &m, sizeof m); VirtualQuery (stack_ptr, &m, sizeof m);
if (!m.RegionSize) if (!m.RegionSize)
system_printf ("m.RegionSize 0? stack_ptr %p", stack_ptr); system_printf ("m.RegionSize 0? stack_ptr %p", stack_ptr);
@ -320,7 +320,7 @@ cygthread::detach (HANDLE sigwait)
/* Lower our priority and give priority to the read thread */ /* Lower our priority and give priority to the read thread */
HANDLE hth = GetCurrentThread (); HANDLE hth = GetCurrentThread ();
LONG prio = GetThreadPriority (hth); LONG prio = GetThreadPriority (hth);
(void) ::SetThreadPriority (hth, THREAD_PRIORITY_BELOW_NORMAL); ::SetThreadPriority (hth, THREAD_PRIORITY_BELOW_NORMAL);
HANDLE w4[2]; HANDLE w4[2];
unsigned n = 2; unsigned n = 2;
@ -363,7 +363,7 @@ cygthread::detach (HANDLE sigwait)
/* WAIT_OBJECT_0 means that the thread successfully read something, /* WAIT_OBJECT_0 means that the thread successfully read something,
so wait for the cygthread to "terminate". */ so wait for the cygthread to "terminate". */
if (res == WAIT_OBJECT_0) if (res == WAIT_OBJECT_0)
(void) WaitForSingleObject (*this, INFINITE); WaitForSingleObject (*this, INFINITE);
else else
{ {
/* Thread didn't terminate on its own, so maybe we have to /* Thread didn't terminate on its own, so maybe we have to
@ -378,7 +378,7 @@ cygthread::detach (HANDLE sigwait)
set_sig_errno (EINTR); set_sig_errno (EINTR);
thread_was_reset = true; thread_was_reset = true;
} }
(void) ::SetThreadPriority (hth, prio); ::SetThreadPriority (hth, prio);
} }
thread_printf ("%s returns %d, id %p", sigwait ? "WFMO" : "WFSO", thread_printf ("%s returns %d, id %p", sigwait ? "WFMO" : "WFSO",
@ -395,7 +395,7 @@ cygthread::detach (HANDLE sigwait)
{ {
ResetEvent (*this); ResetEvent (*this);
/* Mark the thread as available by setting inuse to zero */ /* Mark the thread as available by setting inuse to zero */
(void) InterlockedExchange (&inuse, 0); InterlockedExchange (&inuse, 0);
} }
} }
return signalled; return signalled;

View File

@ -46,7 +46,7 @@ class cygthread
bool SetThreadPriority (int nPriority) {return ::SetThreadPriority (h, nPriority);} bool SetThreadPriority (int nPriority) {return ::SetThreadPriority (h, nPriority);}
void zap_h () void zap_h ()
{ {
(void) CloseHandle (h); CloseHandle (h);
h = NULL; h = NULL;
} }
}; };

View File

@ -648,7 +648,7 @@ dll_crt0_0 ()
if (wincap.has_security ()) if (wincap.has_security ())
OpenProcessToken (hMainProc, MAXIMUM_ALLOWED, &hProcToken); OpenProcessToken (hMainProc, MAXIMUM_ALLOWED, &hProcToken);
(void) SetErrorMode (SEM_FAILCRITICALERRORS); SetErrorMode (SEM_FAILCRITICALERRORS);
device::init (); device::init ();
do_global_ctors (&__CTOR_LIST__, 1); do_global_ctors (&__CTOR_LIST__, 1);
@ -919,7 +919,7 @@ _dll_crt0 ()
system_printf ("internal error: sync_startup not called at start. Expect signal problems."); system_printf ("internal error: sync_startup not called at start. Expect signal problems.");
else else
{ {
(void) WaitForSingleObject (sync_startup, INFINITE); WaitForSingleObject (sync_startup, INFINITE);
CloseHandle (sync_startup); CloseHandle (sync_startup);
} }
@ -1155,7 +1155,7 @@ __api_fatal (const char *fmt, ...)
strcat (buf, "\n"); strcat (buf, "\n");
int len = strlen (buf); int len = strlen (buf);
DWORD done; DWORD done;
(void) WriteFile (GetStdHandle (STD_ERROR_HANDLE), buf, len, &done, 0); WriteFile (GetStdHandle (STD_ERROR_HANDLE), buf, len, &done, 0);
/* Make sure that the message shows up on the screen, too, since this is /* Make sure that the message shows up on the screen, too, since this is
a serious error. */ a serious error. */
@ -1165,14 +1165,14 @@ __api_fatal (const char *fmt, ...)
FILE_SHARE_WRITE | FILE_SHARE_WRITE, FILE_SHARE_WRITE | FILE_SHARE_WRITE,
&sec_none, OPEN_EXISTING, 0, 0); &sec_none, OPEN_EXISTING, 0, 0);
if (h != INVALID_HANDLE_VALUE) if (h != INVALID_HANDLE_VALUE)
(void) WriteFile (h, buf, len, &done, 0); WriteFile (h, buf, len, &done, 0);
} }
/* We are going down without mercy. Make sure we reset /* We are going down without mercy. Make sure we reset
our process_state. */ our process_state. */
sigproc_terminate (); sigproc_terminate ();
#ifdef DEBUGGING #ifdef DEBUGGING
(void) try_to_debug (); try_to_debug ();
#endif #endif
myself.exit (1); myself.exit (1);
} }

View File

@ -13,7 +13,7 @@ details. */
#include "dlmalloc.h" #include "dlmalloc.h"
#define MALLOC_CHECK ({\ #define MALLOC_CHECK ({\
debug_printf ("checking malloc pool");\ debug_printf ("checking malloc pool");\
(void) mallinfo ();\ mallinfo ();\
}) })
#endif #endif

View File

@ -106,13 +106,13 @@ win_env::add_cache (const char *in_posix, const char *in_native)
if (in_native) if (in_native)
{ {
native = (char *) realloc (native, namelen + 1 + strlen (in_native)); native = (char *) realloc (native, namelen + 1 + strlen (in_native));
(void) strcpy (native, name); strcpy (native, name);
(void) strcpy (native + namelen, in_native); strcpy (native + namelen, in_native);
} }
else else
{ {
native = (char *) realloc (native, namelen + 1 + win32_len (in_posix)); native = (char *) realloc (native, namelen + 1 + win32_len (in_posix));
(void) strcpy (native, name); strcpy (native, name);
towin32 (in_posix, native + namelen); towin32 (in_posix, native + namelen);
} }
MALLOC_CHECK; MALLOC_CHECK;
@ -897,7 +897,7 @@ spenv::retrieve (bool no_envblock, const char *const env)
return env_dontadd; return env_dontadd;
char *s = (char *) cmalloc (HEAP_1_STR, namelen + strlen (p) + 1); char *s = (char *) cmalloc (HEAP_1_STR, namelen + strlen (p) + 1);
strcpy (s, name); strcpy (s, name);
(void) strcpy (s + namelen, p); strcpy (s + namelen, p);
debug_printf ("using computed value for '%s'", name); debug_printf ("using computed value for '%s'", name);
return s; return s;
} }

View File

@ -123,7 +123,7 @@ void
init_console_handler (BOOL install_handler) init_console_handler (BOOL install_handler)
{ {
BOOL res; BOOL res;
(void) SetConsoleCtrlHandler (ctrl_c_handler, FALSE); SetConsoleCtrlHandler (ctrl_c_handler, FALSE);
if (install_handler) if (install_handler)
res = SetConsoleCtrlHandler (ctrl_c_handler, TRUE); res = SetConsoleCtrlHandler (ctrl_c_handler, TRUE);
else if (wincap.has_null_console_handler_routine ()) else if (wincap.has_null_console_handler_routine ())
@ -767,7 +767,7 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _cygtls *tls)
/* Just set pending if thread is already suspended */ /* Just set pending if thread is already suspended */
if (res) if (res)
{ {
(void) ResumeThread (hth); ResumeThread (hth);
break; break;
} }
if (tls->incyg || tls->in_exception () || tls->spinning || tls->locked ()) if (tls->incyg || tls->in_exception () || tls->spinning || tls->locked ())
@ -1144,8 +1144,8 @@ signal_exit (int rc)
/* We'd like to stop the main thread from executing but when we do that it /* We'd like to stop the main thread from executing but when we do that it
causes random, inexplicable hangs. So, instead, we set up the priority causes random, inexplicable hangs. So, instead, we set up the priority
of this thread really high so that it should do its thing and then exit. */ of this thread really high so that it should do its thing and then exit. */
(void) SetThreadPriority (hMainThread, THREAD_PRIORITY_IDLE); SetThreadPriority (hMainThread, THREAD_PRIORITY_IDLE);
(void) SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL); SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL);
user_data->resourcelocks->Delete (); user_data->resourcelocks->Delete ();
user_data->resourcelocks->Init (); user_data->resourcelocks->Init ();
@ -1157,7 +1157,7 @@ signal_exit (int rc)
} }
sigproc_printf ("about to call do_exit (%x)", rc); sigproc_printf ("about to call do_exit (%x)", rc);
(void) SetEvent (signal_arrived); SetEvent (signal_arrived);
do_exit (rc); do_exit (rc);
} }
@ -1179,7 +1179,7 @@ events_init ()
ProtectHandle (tty_mutex); ProtectHandle (tty_mutex);
mask_sync.init ("mask_sync"); mask_sync.init ("mask_sync");
windows_system_directory[0] = '\0'; windows_system_directory[0] = '\0';
(void) GetSystemDirectory (windows_system_directory, sizeof (windows_system_directory) - 2); GetSystemDirectory (windows_system_directory, sizeof (windows_system_directory) - 2);
char *end = strchr (windows_system_directory, '\0'); char *end = strchr (windows_system_directory, '\0');
if (end == windows_system_directory) if (end == windows_system_directory)
api_fatal ("can't find windows system directory"); api_fatal ("can't find windows system directory");
@ -1212,7 +1212,7 @@ _cygtls::call_signal_handler ()
int thissig = sig; int thissig = sig;
void (*sigfunc) (int) = func; void (*sigfunc) (int) = func;
(void) pop (); pop ();
reset_signal_arrived (); reset_signal_arrived ();
sigset_t this_oldmask = set_process_mask_delta (); sigset_t this_oldmask = set_process_mask_delta ();
int this_errno = saved_errno; int this_errno = saved_errno;
@ -1232,7 +1232,7 @@ extern "C" void __stdcall
reset_signal_arrived () reset_signal_arrived ()
{ {
// NEEDED? WaitForSingleObject (signal_arrived, 10); // NEEDED? WaitForSingleObject (signal_arrived, 10);
(void) ResetEvent (signal_arrived); ResetEvent (signal_arrived);
sigproc_printf ("reset signal_arrived"); sigproc_printf ("reset signal_arrived");
if (_my_tls.stackptr > _my_tls.stack) if (_my_tls.stackptr > _my_tls.stack)
debug_printf ("stackptr[-1] %p", _my_tls.stackptr[-1]); debug_printf ("stackptr[-1] %p", _my_tls.stackptr[-1]);

View File

@ -230,14 +230,14 @@ fhandler_base::raw_read (void *ptr, size_t& ulen)
{ {
h = GetCurrentThread (); h = GetCurrentThread ();
prio = GetThreadPriority (h); prio = GetThreadPriority (h);
(void) SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL); SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
signal_read_state (1); signal_read_state (1);
} }
BOOL res = ReadFile (get_handle (), ptr, len, (DWORD *) &ulen, 0); BOOL res = ReadFile (get_handle (), ptr, len, (DWORD *) &ulen, 0);
if (read_state) if (read_state)
{ {
signal_read_state (1); signal_read_state (1);
(void) SetThreadPriority (h, prio); SetThreadPriority (h, prio);
} }
if (!res) if (!res)
{ {

View File

@ -213,7 +213,7 @@ class fhandler_base
void signal_read_state (LONG n) void signal_read_state (LONG n)
{ {
(void) ReleaseSemaphore (read_state, n, NULL); ReleaseSemaphore (read_state, n, NULL);
} }
void set_fs_flags (DWORD flags) { fs_flags = flags; } void set_fs_flags (DWORD flags) { fs_flags = flags; }

View File

@ -273,5 +273,5 @@ fhandler_dev_clipboard::close ()
void void
fhandler_dev_clipboard::fixup_after_exec () fhandler_dev_clipboard::fixup_after_exec ()
{ {
(void) close (); close ();
} }

View File

@ -121,7 +121,7 @@ fhandler_console::get_tty_stuff (int flags = 0)
void void
set_console_ctty () set_console_ctty ()
{ {
(void) fhandler_console::get_tty_stuff (); fhandler_console::get_tty_stuff ();
} }
/* Return the tty structure associated with a given tty number. If the /* Return the tty structure associated with a given tty number. If the
@ -590,7 +590,7 @@ fhandler_console::scroll_screen (int x1, int y1, int x2, int y2, int xn, int yn)
CHAR_INFO fill; CHAR_INFO fill;
COORD dest; COORD dest;
(void) dev_state->fillin_info (get_output_handle ()); dev_state->fillin_info (get_output_handle ());
sr1.Left = x1 >= 0 ? x1 : dev_state->info.dwWinSize.X - 1; sr1.Left = x1 >= 0 ? x1 : dev_state->info.dwWinSize.X - 1;
if (y1 == 0) if (y1 == 0)
sr1.Top = dev_state->info.winTop; sr1.Top = dev_state->info.winTop;
@ -745,7 +745,7 @@ fhandler_console::ioctl (unsigned int cmd, void *buf)
} }
return 0; return 0;
case TIOCSWINSZ: case TIOCSWINSZ:
(void) bg_check (SIGTTOU); bg_check (SIGTTOU);
return 0; return 0;
case TIOCLINUX: case TIOCLINUX:
if (* (int *) buf == 6) if (* (int *) buf == 6)
@ -969,7 +969,7 @@ fhandler_console::clear_screen (int x1, int y1, int x2, int y2)
DWORD done; DWORD done;
int num; int num;
(void) dev_state->fillin_info (get_output_handle ()); dev_state->fillin_info (get_output_handle ());
if (x1 < 0) if (x1 < 0)
x1 = dev_state->info.dwWinSize.X - 1; x1 = dev_state->info.dwWinSize.X - 1;
@ -1008,7 +1008,7 @@ fhandler_console::cursor_set (bool rel_to_top, int x, int y)
{ {
COORD pos; COORD pos;
(void) dev_state->fillin_info (get_output_handle ()); dev_state->fillin_info (get_output_handle ());
if (y > dev_state->info.winBottom) if (y > dev_state->info.winBottom)
y = dev_state->info.winBottom; y = dev_state->info.winBottom;
else if (y < 0) else if (y < 0)
@ -1029,7 +1029,7 @@ fhandler_console::cursor_set (bool rel_to_top, int x, int y)
void void
fhandler_console::cursor_rel (int x, int y) fhandler_console::cursor_rel (int x, int y)
{ {
(void) dev_state->fillin_info (get_output_handle ()); dev_state->fillin_info (get_output_handle ());
x += dev_state->info.dwCursorPosition.X; x += dev_state->info.dwCursorPosition.X;
y += dev_state->info.dwCursorPosition.Y; y += dev_state->info.dwCursorPosition.Y;
cursor_set (false, x, y); cursor_set (false, x, y);

View File

@ -414,7 +414,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
pc.set_exec (); pc.set_exec ();
buf->st_mode |= STD_XBITS; buf->st_mode |= STD_XBITS;
} }
(void) SetFilePointer (get_handle (), cur, NULL, FILE_BEGIN); SetFilePointer (get_handle (), cur, NULL, FILE_BEGIN);
} }
} }
} }
@ -1334,7 +1334,7 @@ fhandler_disk_file::readdir (DIR *dir)
else if (!FindNextFileA (dir->__handle, &buf)) else if (!FindNextFileA (dir->__handle, &buf))
{ {
DWORD lasterr = GetLastError (); DWORD lasterr = GetLastError ();
(void) FindClose (dir->__handle); FindClose (dir->__handle);
dir->__handle = INVALID_HANDLE_VALUE; dir->__handle = INVALID_HANDLE_VALUE;
/* POSIX says you shouldn't set errno when readdir can't /* POSIX says you shouldn't set errno when readdir can't
find any more files; so, if another error we leave it set. */ find any more files; so, if another error we leave it set. */
@ -1363,7 +1363,7 @@ fhandler_disk_file::readdir (DIR *dir)
/* We get here if `buf' contains valid data. */ /* We get here if `buf' contains valid data. */
if (pc.isencoded ()) if (pc.isencoded ())
(void) fnunmunge (dir->__d_dirent->d_name, buf.cFileName); fnunmunge (dir->__d_dirent->d_name, buf.cFileName);
else else
strcpy (dir->__d_dirent->d_name, buf.cFileName); strcpy (dir->__d_dirent->d_name, buf.cFileName);
@ -1394,7 +1394,7 @@ fhandler_disk_file::rewinddir (DIR *dir)
{ {
if (dir->__handle != INVALID_HANDLE_VALUE) if (dir->__handle != INVALID_HANDLE_VALUE)
{ {
(void) FindClose (dir->__handle); FindClose (dir->__handle);
dir->__handle = INVALID_HANDLE_VALUE; dir->__handle = INVALID_HANDLE_VALUE;
} }
dir->__d_position = 0; dir->__d_position = 0;

View File

@ -140,7 +140,7 @@ fhandler_netdrive::fstat (struct __stat64 *buf)
const char *path = get_name (); const char *path = get_name ();
debug_printf ("fstat (%s)", path); debug_printf ("fstat (%s)", path);
(void) fhandler_base::fstat (buf); fhandler_base::fstat (buf);
buf->st_mode = S_IFDIR | STD_RBITS | STD_XBITS; buf->st_mode = S_IFDIR | STD_RBITS | STD_XBITS;

View File

@ -163,7 +163,7 @@ fhandler_proc::fstat (struct __stat64 *buf)
debug_printf ("fstat (%s)", path); debug_printf ("fstat (%s)", path);
path += proc_len; path += proc_len;
(void) fhandler_base::fstat (buf); fhandler_base::fstat (buf);
buf->st_mode &= ~_IFMT & NO_W; buf->st_mode &= ~_IFMT & NO_W;

View File

@ -142,7 +142,7 @@ fhandler_process::fstat (struct __stat64 *buf)
{ {
const char *path = get_name (); const char *path = get_name ();
int file_type = exists (); int file_type = exists ();
(void) fhandler_base::fstat (buf); fhandler_base::fstat (buf);
path += proc_len + 1; path += proc_len + 1;
pid = atoi (path); pid = atoi (path);
pinfo p (pid); pinfo p (pid);

View File

@ -374,7 +374,7 @@ fhandler_registry::rewinddir (DIR * dir)
{ {
if (dir->__handle != INVALID_HANDLE_VALUE) if (dir->__handle != INVALID_HANDLE_VALUE)
{ {
(void) RegCloseKey ((HKEY) dir->__handle); RegCloseKey ((HKEY) dir->__handle);
dir->__handle = INVALID_HANDLE_VALUE; dir->__handle = INVALID_HANDLE_VALUE;
} }
dir->__d_position = 0; dir->__d_position = 0;

View File

@ -53,7 +53,7 @@ fhandler_serial::raw_read (void *ptr, size_t& ulen)
io_status.hEvent); io_status.hEvent);
if (!overlapped_armed) if (!overlapped_armed)
{ {
(void) SetCommMask (get_handle (), EV_RXCHAR); SetCommMask (get_handle (), EV_RXCHAR);
ResetEvent (io_status.hEvent); ResetEvent (io_status.hEvent);
} }
@ -200,7 +200,7 @@ err:
void void
fhandler_serial::init (HANDLE f, DWORD flags, mode_t bin) fhandler_serial::init (HANDLE f, DWORD flags, mode_t bin)
{ {
(void) open (flags, bin & (O_BINARY | O_TEXT)); open (flags, bin & (O_BINARY | O_TEXT));
} }
int int
@ -218,14 +218,14 @@ fhandler_serial::open (int flags, mode_t mode)
res = 1; res = 1;
(void) SetCommMask (get_handle (), EV_RXCHAR); SetCommMask (get_handle (), EV_RXCHAR);
uninterruptible_io (true); // Handled explicitly in read code uninterruptible_io (true); // Handled explicitly in read code
overlapped_setup (); overlapped_setup ();
memset (&to, 0, sizeof (to)); memset (&to, 0, sizeof (to));
(void) SetCommTimeouts (get_handle (), &to); SetCommTimeouts (get_handle (), &to);
/* Reset serial port to known state of 9600-8-1-no flow control /* Reset serial port to known state of 9600-8-1-no flow control
on open for better behavior under Win 95. on open for better behavior under Win 95.
@ -295,7 +295,7 @@ fhandler_serial::open (int flags, mode_t mode)
int int
fhandler_serial::close () fhandler_serial::close ()
{ {
(void) ForceCloseHandle (io_status.hEvent); ForceCloseHandle (io_status.hEvent);
return fhandler_base::close (); return fhandler_base::close ();
} }

View File

@ -122,7 +122,7 @@ tty_min::kill_pgrp (int sig)
if (p == myself) if (p == myself)
killself++; killself++;
else else
(void) sig_send (p, si); sig_send (p, si);
} }
if (killself) if (killself)
sig_send (myself, si); sig_send (myself, si);
@ -316,7 +316,7 @@ fhandler_termios::line_edit (const char *rptr, int nread, termios& ti)
else if (CCEQ (ti.c_cc[VEOF], c)) else if (CCEQ (ti.c_cc[VEOF], c))
{ {
termios_printf ("EOF"); termios_printf ("EOF");
(void) accept_input (); accept_input ();
ret = line_edit_input_done; ret = line_edit_input_done;
continue; continue;
} }

View File

@ -167,7 +167,7 @@ fhandler_pty_master::accept_input ()
DWORD bytes_left; DWORD bytes_left;
int ret = 1; int ret = 1;
(void) WaitForSingleObject (input_mutex, INFINITE); WaitForSingleObject (input_mutex, INFINITE);
bytes_left = eat_readahead (-1); bytes_left = eat_readahead (-1);

View File

@ -233,7 +233,7 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls)
sync_with_parent ("loaded dlls", true); sync_with_parent ("loaded dlls", true);
} }
(void) ForceCloseHandle1 (fork_info->forker_finished, forker_finished); ForceCloseHandle1 (fork_info->forker_finished, forker_finished);
_my_tls.fixup_after_fork (); _my_tls.fixup_after_fork ();
sigproc_init (); sigproc_init ();
@ -487,7 +487,7 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_
goto cleanup; goto cleanup;
} }
/* Start the child up again. */ /* Start the child up again. */
(void) resume_child (forker_finished); resume_child (forker_finished);
} }
ForceCloseHandle (pi.hThread); ForceCloseHandle (pi.hThread);

View File

@ -59,7 +59,7 @@ putmem (PIMAGE_THUNK_DATA pi, const void *hookfn)
void *origfn = (void *) pi->u1.Function; void *origfn = (void *) pi->u1.Function;
pi->u1.Function = (DWORD) hookfn; pi->u1.Function = (DWORD) hookfn;
(void) VirtualProtect (pi, sizeof (PVOID), flOldProtect, &flDontCare); VirtualProtect (pi, sizeof (PVOID), flOldProtect, &flDontCare);
return origfn; return origfn;
} }

View File

@ -730,9 +730,9 @@ tzload(const char *name, struct state *sp)
return -1; return -1;
if ((strlen(p) + strlen(name) + 1) >= sizeof fullname) if ((strlen(p) + strlen(name) + 1) >= sizeof fullname)
return -1; return -1;
(void) strcpy(fullname, p); strcpy(fullname, p);
(void) strcat(fullname, "/"); strcat(fullname, "/");
(void) strcat(fullname, name); strcat(fullname, name);
/* /*
** Set doaccess if '.' (as in "../") shows up in name. ** Set doaccess if '.' (as in "../") shows up in name.
*/ */
@ -1346,11 +1346,11 @@ tzparse(const char *name, struct state *sp, const int lastditch)
if ((size_t) sp->charcnt > sizeof sp->chars) if ((size_t) sp->charcnt > sizeof sp->chars)
return -1; return -1;
cp = sp->chars; cp = sp->chars;
(void) strncpy(cp, stdname, stdlen); strncpy(cp, stdname, stdlen);
cp += stdlen; cp += stdlen;
*cp++ = '\0'; *cp++ = '\0';
if (dstlen != 0) { if (dstlen != 0) {
(void) strncpy(cp, dstname, dstlen); strncpy(cp, dstname, dstlen);
*(cp + dstlen) = '\0'; *(cp + dstlen) = '\0';
} }
return 0; return 0;
@ -1360,7 +1360,7 @@ static void
gmtload(struct state *sp) gmtload(struct state *sp)
{ {
if (tzload(gmt, sp) != 0) if (tzload(gmt, sp) != 0)
(void) tzparse(gmt, sp, true); tzparse(gmt, sp, true);
} }
#ifndef STD_INSPIRED #ifndef STD_INSPIRED
@ -1479,7 +1479,7 @@ tzset P((void))
return; return;
lcl_is_set = (strlen(name) < sizeof (lcl_TZname)); lcl_is_set = (strlen(name) < sizeof (lcl_TZname));
if (lcl_is_set) if (lcl_is_set)
(void) strcpy(lcl_TZname, name); strcpy(lcl_TZname, name);
#ifdef ALL_STATE #ifdef ALL_STATE
if (lclptr == NULL) { if (lclptr == NULL) {
@ -1498,10 +1498,10 @@ tzset P((void))
lclptr->timecnt = 0; lclptr->timecnt = 0;
lclptr->ttis[0].tt_gmtoff = 0; lclptr->ttis[0].tt_gmtoff = 0;
lclptr->ttis[0].tt_abbrind = 0; lclptr->ttis[0].tt_abbrind = 0;
(void) strcpy(lclptr->chars, gmt); strcpy(lclptr->chars, gmt);
} else if (tzload(name, lclptr) != 0) { } else if (tzload(name, lclptr) != 0) {
if (name[0] == ':' || tzparse(name, lclptr, false) != 0) if (name[0] == ':' || tzparse(name, lclptr, false) != 0)
(void) gmtload(lclptr); gmtload(lclptr);
} }
settzname(); settzname();
} }

View File

@ -193,7 +193,7 @@ check_iovec (const struct iovec *iov, int iovcnt, bool forwrite)
else if (!forwrite) else if (!forwrite)
*p = dummytest (p); *p = dummytest (p);
else else
(void) dummytest (p); dummytest (p);
iov++; iov++;
iovcnt--; iovcnt--;

View File

@ -1203,7 +1203,7 @@ fhandler_disk_file::fixup_mmap_after_fork (HANDLE h, DWORD access, int flags,
if (base != address) if (base != address)
{ {
MEMORY_BASIC_INFORMATION m; MEMORY_BASIC_INFORMATION m;
(void) VirtualQuery (address, &m, sizeof (m)); VirtualQuery (address, &m, sizeof (m));
system_printf ("requested %p != %p mem alloc base %p, state %p, size %d, %E", system_printf ("requested %p != %p mem alloc base %p, state %p, size %d, %E",
address, base, m.AllocationBase, m.State, m.RegionSize); address, base, m.AllocationBase, m.State, m.RegionSize);
} }

View File

@ -79,7 +79,7 @@ pwdgrp::read_passwd ()
{ {
static char linebuf[1024]; // must be static and static char linebuf[1024]; // must be static and
// should not be NO_COPY // should not be NO_COPY
(void) cygheap->user.ontherange (CH_HOME, NULL); cygheap->user.ontherange (CH_HOME, NULL);
snprintf (linebuf, sizeof (linebuf), "%s:*:%lu:%lu:,%s:%s:/bin/sh", snprintf (linebuf, sizeof (linebuf), "%s:*:%lu:%lu:,%s:%s:/bin/sh",
cygheap->user.name (), cygheap->user.name (),
myself->uid == ILLEGAL_UID ? UNKNOWN_UID : myself->uid, myself->uid == ILLEGAL_UID ? UNKNOWN_UID : myself->uid,

View File

@ -1325,7 +1325,7 @@ special_name (const char *s, int inc = 1)
|| strncasematch (s, "con", 3)) || strncasematch (s, "con", 3))
p = s + n; p = s + n;
else if (strncasematch (s, "com", 3) || strncasematch (s, "lpt", 3)) else if (strncasematch (s, "com", 3) || strncasematch (s, "lpt", 3))
(void) strtoul (s + 3, (char **) &p, 10); strtoul (s + 3, (char **) &p, 10);
if (p && (*p == '\0' || *p == '.')) if (p && (*p == '\0' || *p == '.'))
return -1; return -1;
@ -2682,7 +2682,7 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
{ {
strcpy (w32oldpath, oldpath); strcpy (w32oldpath, oldpath);
create_how = CREATE_ALWAYS; create_how = CREATE_ALWAYS;
(void) SetFileAttributes (win32_path, FILE_ATTRIBUTE_NORMAL); SetFileAttributes (win32_path, FILE_ATTRIBUTE_NORMAL);
} }
else else
{ {
@ -3998,7 +3998,7 @@ etc::init (int n, const char *etc_fn)
fn[n] = etc_fn; fn[n] = etc_fn;
change_possible[n] = false; change_possible[n] = false;
(void) test_file_change (n); test_file_change (n);
paranoid_printf ("fn[%d] %s, curr_ix %d", n, fn[n], curr_ix); paranoid_printf ("fn[%d] %s, curr_ix %d", n, fn[n], curr_ix);
return n; return n;
} }
@ -4052,7 +4052,7 @@ etc::dir_changed (int n)
change_possible[n] = true; change_possible[n] = true;
else if (WaitForSingleObject (changed_h, 0) == WAIT_OBJECT_0) else if (WaitForSingleObject (changed_h, 0) == WAIT_OBJECT_0)
{ {
(void) FindNextChangeNotification (changed_h); FindNextChangeNotification (changed_h);
memset (change_possible, true, sizeof change_possible); memset (change_possible, true, sizeof change_possible);
} }
} }

View File

@ -53,7 +53,7 @@ set_myself (HANDLE h)
myself->process_state |= PID_IN_USE; myself->process_state |= PID_IN_USE;
myself->dwProcessId = GetCurrentProcessId (); myself->dwProcessId = GetCurrentProcessId ();
(void) GetModuleFileName (NULL, myself->progname, sizeof (myself->progname)); GetModuleFileName (NULL, myself->progname, sizeof (myself->progname));
if (!strace.active) if (!strace.active)
strace.hello (); strace.hello ();
debug_printf ("myself->dwProcessId %u", myself->dwProcessId); debug_printf ("myself->dwProcessId %u", myself->dwProcessId);
@ -130,7 +130,7 @@ pinfo::zap_cwd ()
/* Move to an innocuous location to avoid a race with other processes /* Move to an innocuous location to avoid a race with other processes
that may want to manipulate the current directory before this that may want to manipulate the current directory before this
process has completely exited. */ process has completely exited. */
(void) SetCurrentDirectory (windows_system_directory); SetCurrentDirectory (windows_system_directory);
} }
void void
@ -610,7 +610,7 @@ _pinfo::commune_recv ()
sigproc_printf ("WriteFile read handle failed, %E"); sigproc_printf ("WriteFile read handle failed, %E");
} }
(void) ReadFile (__fromthem, &nr, sizeof (nr), &nr, NULL); ReadFile (__fromthem, &nr, sizeof (nr), &nr, NULL);
break; break;
} }
} }
@ -761,7 +761,7 @@ _pinfo::commune_send (DWORD code, ...)
} }
DWORD x = ReadFile (fromthem, res.handles, sizeof (res.handles), &nr, NULL); DWORD x = ReadFile (fromthem, res.handles, sizeof (res.handles), &nr, NULL);
(void) WriteFile (tothem, &x, sizeof (x), &x, NULL); WriteFile (tothem, &x, sizeof (x), &x, NULL);
if (!x) if (!x)
goto err; goto err;

View File

@ -185,7 +185,7 @@ fhandler_pipe::read (void *in_ptr, size_t& in_len)
if (th->detach (read_state) && !in_len) if (th->detach (read_state) && !in_len)
in_len = (size_t) -1; /* received a signal */ in_len = (size_t) -1; /* received a signal */
} }
(void) ReleaseMutex (guard); ReleaseMutex (guard);
return; return;
} }

View File

@ -976,7 +976,7 @@ peek_serial (select_record *s, bool)
goto out; goto out;
} }
(void) SetCommMask (h, EV_RXCHAR); SetCommMask (h, EV_RXCHAR);
if (!fh->overlapped_armed) if (!fh->overlapped_armed)
{ {
@ -1166,7 +1166,7 @@ fhandler_base::ready_for_read (int fd, DWORD howlong)
me.fd = fd; me.fd = fd;
while (!avail) while (!avail)
{ {
(void) select_read (&me); select_read (&me);
avail = me.read_ready ?: me.peek (&me, false); avail = me.read_ready ?: me.peek (&me, false);
if (fd >= 0 && cygheap->fdtab.not_open (fd)) if (fd >= 0 && cygheap->fdtab.not_open (fd))

View File

@ -86,7 +86,7 @@ open_shared (const char *name, int n, HANDLE& shared_h, DWORD size,
else else
{ {
addr = offsets[m]; addr = offsets[m];
(void) VirtualFree (addr, 0, MEM_RELEASE); VirtualFree (addr, 0, MEM_RELEASE);
} }
if (shared_h) if (shared_h)

View File

@ -94,7 +94,7 @@ nanosleep (const struct timespec *rqtp, struct timespec *rmtp)
rem = 0; rem = 0;
if (rc == WAIT_OBJECT_0) if (rc == WAIT_OBJECT_0)
{ {
(void) _my_tls.call_signal_handler (); _my_tls.call_signal_handler ();
set_errno (EINTR); set_errno (EINTR);
res = -1; res = -1;
} }
@ -172,7 +172,7 @@ handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& op
newmask = *set; newmask = *set;
break; break;
} }
(void) set_signal_mask (newmask, opmask); set_signal_mask (newmask, opmask);
} }
return 0; return 0;
} }
@ -208,7 +208,7 @@ _pinfo::kill (siginfo_t& si)
si2.si_signo = SIGCONT; si2.si_signo = SIGCONT;
si2.si_code = SI_KERNEL; si2.si_code = SI_KERNEL;
si2.si_pid = si2.si_uid = si2.si_errno = 0; si2.si_pid = si2.si_uid = si2.si_errno = 0;
(void) sig_send (this, si2); sig_send (this, si2);
} }
syscall_printf ("%d = _pinfo::kill (%d, %d), process_state %p", res, pid, syscall_printf ("%d = _pinfo::kill (%d, %d), process_state %p", res, pid,
@ -332,7 +332,7 @@ abort (void)
set_signal_mask (sig_mask); set_signal_mask (sig_mask);
raise (SIGABRT); raise (SIGABRT);
(void) _my_tls.call_signal_handler (); /* Call any signal handler */ _my_tls.call_signal_handler (); /* Call any signal handler */
do_exit (SIGABRT); /* signal handler didn't exit. Goodbye. */ do_exit (SIGABRT); /* signal handler didn't exit. Goodbye. */
} }
@ -466,7 +466,7 @@ extern "C" int
siginterrupt (int sig, int flag) siginterrupt (int sig, int flag)
{ {
struct sigaction act; struct sigaction act;
(void) sigaction(sig, NULL, &act); sigaction(sig, NULL, &act);
if (flag) if (flag)
act.sa_flags &= ~SA_RESTART; act.sa_flags &= ~SA_RESTART;
else else

View File

@ -129,9 +129,9 @@ wait_for_sigthread ()
{ {
sigproc_printf ("wait_sig_inited %p", wait_sig_inited); sigproc_printf ("wait_sig_inited %p", wait_sig_inited);
HANDLE hsig_inited = wait_sig_inited; HANDLE hsig_inited = wait_sig_inited;
(void) WaitForSingleObject (hsig_inited, INFINITE); WaitForSingleObject (hsig_inited, INFINITE);
wait_sig_inited = NULL; wait_sig_inited = NULL;
(void) ForceCloseHandle1 (hsig_inited, wait_sig_inited); ForceCloseHandle1 (hsig_inited, wait_sig_inited);
} }
/* Get the sync_proc_subproc muto to control access to /* Get the sync_proc_subproc muto to control access to
@ -389,7 +389,7 @@ proc_terminate (void)
{ {
sync_proc_subproc.acquire (WPSP); sync_proc_subproc.acquire (WPSP);
(void) proc_subproc (PROC_CLEARWAIT, 1); proc_subproc (PROC_CLEARWAIT, 1);
/* Clean out proc processes from the pid list. */ /* Clean out proc processes from the pid list. */
int i; int i;
@ -457,7 +457,7 @@ sig_dispatch_pending (bool fast)
#ifdef DEBUGGING #ifdef DEBUGGING
sigproc_printf ("flushing"); sigproc_printf ("flushing");
#endif #endif
(void) sig_send (myself, fast ? __SIGFLUSHFAST : __SIGFLUSH); sig_send (myself, fast ? __SIGFLUSHFAST : __SIGFLUSH);
} }
void __stdcall void __stdcall
@ -1000,7 +1000,7 @@ wait_sig (VOID *self)
Static bool holding_signals; Static bool holding_signals;
/* Initialization */ /* Initialization */
(void) SetThreadPriority (GetCurrentThread (), WAIT_SIG_PRIORITY); SetThreadPriority (GetCurrentThread (), WAIT_SIG_PRIORITY);
if (!CreatePipe (&readsig, &myself->sendsig, sec_user_nih (sa_buf), 0)) if (!CreatePipe (&readsig, &myself->sendsig, sec_user_nih (sa_buf), 0))
api_fatal ("couldn't create signal pipe, %E"); api_fatal ("couldn't create signal pipe, %E");

View File

@ -772,7 +772,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
cleanup.oldquit = signal (SIGQUIT, SIG_IGN); cleanup.oldquit = signal (SIGQUIT, SIG_IGN);
sigemptyset (&child_block); sigemptyset (&child_block);
sigaddset (&child_block, SIGCHLD); sigaddset (&child_block, SIGCHLD);
(void) sigprocmask (SIG_BLOCK, &child_block, &cleanup.oldmask); sigprocmask (SIG_BLOCK, &child_block, &cleanup.oldmask);
} }
pthread_cleanup_push (do_cleanup, (void *) &cleanup); pthread_cleanup_push (do_cleanup, (void *) &cleanup);
@ -819,7 +819,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
just in case we've been previously just in case we've been previously
execed. */ execed. */
myself.zap_cwd (); myself.zap_cwd ();
(void) myself->dup_proc_pipe (pi.hProcess); myself->dup_proc_pipe (pi.hProcess);
} }
} }
else else
@ -844,7 +844,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
the fields filled out by child.remember do not disappear and so there the fields filled out by child.remember do not disappear and so there
is not a brief period during which the pid is not available. is not a brief period during which the pid is not available.
However, we should try to find another way to do this eventually. */ However, we should try to find another way to do this eventually. */
(void) DuplicateHandle (hMainProc, child.shared_handle (), pi.hProcess, DuplicateHandle (hMainProc, child.shared_handle (), pi.hProcess,
NULL, 0, 0, DUPLICATE_SAME_ACCESS); NULL, 0, 0, DUPLICATE_SAME_ACCESS);
child->start_time = time (NULL); /* Register child's starting time. */ child->start_time = time (NULL); /* Register child's starting time. */
child->nice = myself->nice; child->nice = myself->nice;

View File

@ -135,12 +135,12 @@ muto::release ()
if (!--visits) if (!--visits)
{ {
tls = 0; /* We were the last unlocker. */ tls = 0; /* We were the last unlocker. */
(void) InterlockedExchange (&sync, 0); /* Reset trigger. */ InterlockedExchange (&sync, 0); /* Reset trigger. */
/* This thread had incremented waiters but had never decremented it. /* This thread had incremented waiters but had never decremented it.
Decrement it now. If it is >= 0 then there are possibly other Decrement it now. If it is >= 0 then there are possibly other
threads waiting for the lock, so trigger bruteforce. */ threads waiting for the lock, so trigger bruteforce. */
if (InterlockedDecrement (&waiters) >= 0) if (InterlockedDecrement (&waiters) >= 0)
(void) SetEvent (bruteforce); /* Wake up one of the waiting threads */ SetEvent (bruteforce); /* Wake up one of the waiting threads */
else if (*name == '!') else if (*name == '!')
{ {
CloseHandle (bruteforce); /* If *name == '!' and there are no CloseHandle (bruteforce); /* If *name == '!' and there are no

View File

@ -202,7 +202,7 @@ unlink (const char *ourname)
if (h != INVALID_HANDLE_VALUE) if (h != INVALID_HANDLE_VALUE)
{ {
if (wincap.has_hard_links () && setattrs) if (wincap.has_hard_links () && setattrs)
(void) SetFileAttributes (win32_name, (DWORD) win32_name); SetFileAttributes (win32_name, (DWORD) win32_name);
BOOL res = CloseHandle (h); BOOL res = CloseHandle (h);
syscall_printf ("%d = CloseHandle (%p)", res, h); syscall_printf ("%d = CloseHandle (%p)", res, h);
if (GetFileAttributes (win32_name) == INVALID_FILE_ATTRIBUTES if (GetFileAttributes (win32_name) == INVALID_FILE_ATTRIBUTES
@ -230,7 +230,7 @@ unlink (const char *ourname)
DWORD lasterr; DWORD lasterr;
lasterr = GetLastError (); lasterr = GetLastError ();
(void) SetFileAttributes (win32_name, (DWORD) win32_name); SetFileAttributes (win32_name, (DWORD) win32_name);
/* Windows 9x seems to report ERROR_ACCESS_DENIED rather than sharing /* Windows 9x seems to report ERROR_ACCESS_DENIED rather than sharing
violation. So, set lasterr to ERROR_SHARING_VIOLATION in this case violation. So, set lasterr to ERROR_SHARING_VIOLATION in this case

View File

@ -179,7 +179,7 @@ tcgetattr (int fd, struct termios *in_t)
else if (!cfd->is_tty ()) else if (!cfd->is_tty ())
set_errno (ENOTTY); set_errno (ENOTTY);
else if ((res = cfd->tcgetattr (t)) == 0) else if ((res = cfd->tcgetattr (t)) == 0)
(void) __toapp_termios (in_t, t); __toapp_termios (in_t, t);
if (res) if (res)
termios_printf ("%d = tcgetattr (%d, %p)", res, fd, in_t); termios_printf ("%d = tcgetattr (%d, %p)", res, fd, in_t);
@ -291,7 +291,7 @@ cfsetospeed (struct termios *in_tp, speed_t speed)
{ {
struct termios *tp = __tonew_termios (in_tp); struct termios *tp = __tonew_termios (in_tp);
int res = setspeed (tp->c_ospeed, speed); int res = setspeed (tp->c_ospeed, speed);
(void) __toapp_termios (in_tp, tp); __toapp_termios (in_tp, tp);
return res; return res;
} }
@ -301,6 +301,6 @@ cfsetispeed (struct termios *in_tp, speed_t speed)
{ {
struct termios *tp = __tonew_termios (in_tp); struct termios *tp = __tonew_termios (in_tp);
int res = setspeed (tp->c_ispeed, speed); int res = setspeed (tp->c_ispeed, speed);
(void) __toapp_termios (in_tp, tp); __toapp_termios (in_tp, tp);
return res; return res;
} }

View File

@ -1660,7 +1660,7 @@ pthread_mutex::_lock (pthread_t self)
set_owner (self); set_owner (self);
else if (type == PTHREAD_MUTEX_NORMAL || !pthread::equal (owner, self)) else if (type == PTHREAD_MUTEX_NORMAL || !pthread::equal (owner, self))
{ {
(void) cancelable_wait (win32_obj_id, INFINITE, cw_no_cancel, cw_sig_resume); cancelable_wait (win32_obj_id, INFINITE, cw_no_cancel, cw_sig_resume);
set_owner (self); set_owner (self);
} }
else else

View File

@ -245,7 +245,7 @@ timer_tracker::settime (int in_flags, const itimerspec *value, itimerspec *ovalu
syncthread = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL); syncthread = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
else else
ResetEvent (syncthread); ResetEvent (syncthread);
(void) new cygthread (timer_thread, this, "itimer", syncthread); new cygthread (timer_thread, this, "itimer", syncthread);
} }
return 0; return 0;

View File

@ -88,7 +88,7 @@ create_tty_master (int ttynum)
DWORD len = sizeof our_utmp.ut_host; DWORD len = sizeof our_utmp.ut_host;
bzero ((char *) &our_utmp, sizeof (utmp)); bzero ((char *) &our_utmp, sizeof (utmp));
(void) time (&our_utmp.ut_time); time (&our_utmp.ut_time);
strncpy (our_utmp.ut_name, getlogin (), sizeof (our_utmp.ut_name)); strncpy (our_utmp.ut_name, getlogin (), sizeof (our_utmp.ut_name));
GetComputerName (our_utmp.ut_host, &len); GetComputerName (our_utmp.ut_host, &len);
__small_sprintf (our_utmp.ut_line, "tty%d", ttynum); __small_sprintf (our_utmp.ut_line, "tty%d", ttynum);

View File

@ -126,7 +126,7 @@ internal_getlogin (cygheap_user &user)
debug_printf ("gsid not found in augmented /etc/group"); debug_printf ("gsid not found in augmented /etc/group");
} }
} }
(void) cygheap->user.ontherange (CH_HOME, pw); cygheap->user.ontherange (CH_HOME, pw);
return; return;
} }
@ -440,7 +440,7 @@ const char *
cygheap_user::env_name (const char *name, size_t namelen) cygheap_user::env_name (const char *name, size_t namelen)
{ {
if (!test_uid (pwinname, name, namelen)) if (!test_uid (pwinname, name, namelen))
(void) domain (); domain ();
return pwinname; return pwinname;
} }