aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/cygheap.cc4
-rw-r--r--winsup/cygwin/cygthread.cc14
-rw-r--r--winsup/cygwin/cygthread.h2
-rw-r--r--winsup/cygwin/dcrt0.cc10
-rw-r--r--winsup/cygwin/debug.h2
-rw-r--r--winsup/cygwin/environ.cc8
-rw-r--r--winsup/cygwin/exceptions.cc16
-rw-r--r--winsup/cygwin/fhandler.cc4
-rw-r--r--winsup/cygwin/fhandler.h2
-rw-r--r--winsup/cygwin/fhandler_clipboard.cc2
-rw-r--r--winsup/cygwin/fhandler_console.cc12
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc8
-rw-r--r--winsup/cygwin/fhandler_netdrive.cc2
-rw-r--r--winsup/cygwin/fhandler_proc.cc2
-rw-r--r--winsup/cygwin/fhandler_process.cc2
-rw-r--r--winsup/cygwin/fhandler_registry.cc2
-rw-r--r--winsup/cygwin/fhandler_serial.cc10
-rw-r--r--winsup/cygwin/fhandler_termios.cc4
-rw-r--r--winsup/cygwin/fhandler_tty.cc2
-rw-r--r--winsup/cygwin/fork.cc4
-rw-r--r--winsup/cygwin/hookapi.cc2
-rw-r--r--winsup/cygwin/localtime.cc18
-rw-r--r--winsup/cygwin/miscfuncs.cc2
-rw-r--r--winsup/cygwin/mmap.cc2
-rw-r--r--winsup/cygwin/passwd.cc2
-rw-r--r--winsup/cygwin/path.cc8
-rw-r--r--winsup/cygwin/pinfo.cc8
-rw-r--r--winsup/cygwin/pipe.cc2
-rw-r--r--winsup/cygwin/select.cc4
-rw-r--r--winsup/cygwin/shared.cc2
-rw-r--r--winsup/cygwin/signal.cc10
-rw-r--r--winsup/cygwin/sigproc.cc10
-rw-r--r--winsup/cygwin/spawn.cc6
-rw-r--r--winsup/cygwin/sync.cc4
-rw-r--r--winsup/cygwin/syscalls.cc4
-rw-r--r--winsup/cygwin/termios.cc6
-rw-r--r--winsup/cygwin/thread.cc2
-rw-r--r--winsup/cygwin/timer.cc2
-rw-r--r--winsup/cygwin/tty.cc2
-rw-r--r--winsup/cygwin/uinfo.cc4
41 files changed, 110 insertions, 106 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 706f7f2..c42dc59 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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>
* dcrt0.cc (cygwin_exit): Mark as "noreturn".
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 48262ca..633df7f 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -162,7 +162,7 @@ cygheap_init ()
#endif
cygheap_max = cygheap;
- (void) _csbrk (sizeof (*cygheap));
+ _csbrk (sizeof (*cygheap));
}
if (!cygheap->fdtab)
cygheap->fdtab.init ();
@@ -304,7 +304,7 @@ extern "C" void __stdcall
cfree (void *s)
{
assert (!inheap (s));
- (void) _cfree (tocygheap (s));
+ _cfree (tocygheap (s));
MALLOC_CHECK;
}
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index f96908c..80fa454 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -258,8 +258,8 @@ cygthread::terminate_thread ()
if (!inuse)
goto force_notterminated;
- (void) TerminateThread (h, 0);
- (void) WaitForSingleObject (h, INFINITE);
+ TerminateThread (h, 0);
+ WaitForSingleObject (h, INFINITE);
CloseHandle (h);
if (!inuse || exiting)
@@ -270,7 +270,7 @@ cygthread::terminate_thread ()
MEMORY_BASIC_INFORMATION m;
memset (&m, 0, sizeof (m));
- (void) VirtualQuery (stack_ptr, &m, sizeof m);
+ VirtualQuery (stack_ptr, &m, sizeof m);
if (!m.RegionSize)
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 */
HANDLE hth = GetCurrentThread ();
LONG prio = GetThreadPriority (hth);
- (void) ::SetThreadPriority (hth, THREAD_PRIORITY_BELOW_NORMAL);
+ ::SetThreadPriority (hth, THREAD_PRIORITY_BELOW_NORMAL);
HANDLE w4[2];
unsigned n = 2;
@@ -363,7 +363,7 @@ cygthread::detach (HANDLE sigwait)
/* WAIT_OBJECT_0 means that the thread successfully read something,
so wait for the cygthread to "terminate". */
if (res == WAIT_OBJECT_0)
- (void) WaitForSingleObject (*this, INFINITE);
+ WaitForSingleObject (*this, INFINITE);
else
{
/* Thread didn't terminate on its own, so maybe we have to
@@ -378,7 +378,7 @@ cygthread::detach (HANDLE sigwait)
set_sig_errno (EINTR);
thread_was_reset = true;
}
- (void) ::SetThreadPriority (hth, prio);
+ ::SetThreadPriority (hth, prio);
}
thread_printf ("%s returns %d, id %p", sigwait ? "WFMO" : "WFSO",
@@ -395,7 +395,7 @@ cygthread::detach (HANDLE sigwait)
{
ResetEvent (*this);
/* Mark the thread as available by setting inuse to zero */
- (void) InterlockedExchange (&inuse, 0);
+ InterlockedExchange (&inuse, 0);
}
}
return signalled;
diff --git a/winsup/cygwin/cygthread.h b/winsup/cygwin/cygthread.h
index 6d504f1..9da8d1c 100644
--- a/winsup/cygwin/cygthread.h
+++ b/winsup/cygwin/cygthread.h
@@ -46,7 +46,7 @@ class cygthread
bool SetThreadPriority (int nPriority) {return ::SetThreadPriority (h, nPriority);}
void zap_h ()
{
- (void) CloseHandle (h);
+ CloseHandle (h);
h = NULL;
}
};
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index b55aeca..d15fca4 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -648,7 +648,7 @@ dll_crt0_0 ()
if (wincap.has_security ())
OpenProcessToken (hMainProc, MAXIMUM_ALLOWED, &hProcToken);
- (void) SetErrorMode (SEM_FAILCRITICALERRORS);
+ SetErrorMode (SEM_FAILCRITICALERRORS);
device::init ();
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.");
else
{
- (void) WaitForSingleObject (sync_startup, INFINITE);
+ WaitForSingleObject (sync_startup, INFINITE);
CloseHandle (sync_startup);
}
@@ -1155,7 +1155,7 @@ __api_fatal (const char *fmt, ...)
strcat (buf, "\n");
int len = strlen (buf);
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
a serious error. */
@@ -1165,14 +1165,14 @@ __api_fatal (const char *fmt, ...)
FILE_SHARE_WRITE | FILE_SHARE_WRITE,
&sec_none, OPEN_EXISTING, 0, 0);
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
our process_state. */
sigproc_terminate ();
#ifdef DEBUGGING
- (void) try_to_debug ();
+ try_to_debug ();
#endif
myself.exit (1);
}
diff --git a/winsup/cygwin/debug.h b/winsup/cygwin/debug.h
index 796eeec..94d4c5a 100644
--- a/winsup/cygwin/debug.h
+++ b/winsup/cygwin/debug.h
@@ -13,7 +13,7 @@ details. */
#include "dlmalloc.h"
#define MALLOC_CHECK ({\
debug_printf ("checking malloc pool");\
- (void) mallinfo ();\
+ mallinfo ();\
})
#endif
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 099dcae..33c6c78 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -106,13 +106,13 @@ win_env::add_cache (const char *in_posix, const char *in_native)
if (in_native)
{
native = (char *) realloc (native, namelen + 1 + strlen (in_native));
- (void) strcpy (native, name);
- (void) strcpy (native + namelen, in_native);
+ strcpy (native, name);
+ strcpy (native + namelen, in_native);
}
else
{
native = (char *) realloc (native, namelen + 1 + win32_len (in_posix));
- (void) strcpy (native, name);
+ strcpy (native, name);
towin32 (in_posix, native + namelen);
}
MALLOC_CHECK;
@@ -897,7 +897,7 @@ spenv::retrieve (bool no_envblock, const char *const env)
return env_dontadd;
char *s = (char *) cmalloc (HEAP_1_STR, namelen + strlen (p) + 1);
strcpy (s, name);
- (void) strcpy (s + namelen, p);
+ strcpy (s + namelen, p);
debug_printf ("using computed value for '%s'", name);
return s;
}
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index be3c020..4f9a55e 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -123,7 +123,7 @@ void
init_console_handler (BOOL install_handler)
{
BOOL res;
- (void) SetConsoleCtrlHandler (ctrl_c_handler, FALSE);
+ SetConsoleCtrlHandler (ctrl_c_handler, FALSE);
if (install_handler)
res = SetConsoleCtrlHandler (ctrl_c_handler, TRUE);
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 */
if (res)
{
- (void) ResumeThread (hth);
+ ResumeThread (hth);
break;
}
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
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. */
- (void) SetThreadPriority (hMainThread, THREAD_PRIORITY_IDLE);
- (void) SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL);
+ SetThreadPriority (hMainThread, THREAD_PRIORITY_IDLE);
+ SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL);
user_data->resourcelocks->Delete ();
user_data->resourcelocks->Init ();
@@ -1157,7 +1157,7 @@ signal_exit (int rc)
}
sigproc_printf ("about to call do_exit (%x)", rc);
- (void) SetEvent (signal_arrived);
+ SetEvent (signal_arrived);
do_exit (rc);
}
@@ -1179,7 +1179,7 @@ events_init ()
ProtectHandle (tty_mutex);
mask_sync.init ("mask_sync");
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');
if (end == windows_system_directory)
api_fatal ("can't find windows system directory");
@@ -1212,7 +1212,7 @@ _cygtls::call_signal_handler ()
int thissig = sig;
void (*sigfunc) (int) = func;
- (void) pop ();
+ pop ();
reset_signal_arrived ();
sigset_t this_oldmask = set_process_mask_delta ();
int this_errno = saved_errno;
@@ -1232,7 +1232,7 @@ extern "C" void __stdcall
reset_signal_arrived ()
{
// NEEDED? WaitForSingleObject (signal_arrived, 10);
- (void) ResetEvent (signal_arrived);
+ ResetEvent (signal_arrived);
sigproc_printf ("reset signal_arrived");
if (_my_tls.stackptr > _my_tls.stack)
debug_printf ("stackptr[-1] %p", _my_tls.stackptr[-1]);
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index b619b28..e5e14fc 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -230,14 +230,14 @@ fhandler_base::raw_read (void *ptr, size_t& ulen)
{
h = GetCurrentThread ();
prio = GetThreadPriority (h);
- (void) SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
+ SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
signal_read_state (1);
}
BOOL res = ReadFile (get_handle (), ptr, len, (DWORD *) &ulen, 0);
if (read_state)
{
signal_read_state (1);
- (void) SetThreadPriority (h, prio);
+ SetThreadPriority (h, prio);
}
if (!res)
{
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 0165c28..7d4f6ce 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -213,7 +213,7 @@ class fhandler_base
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; }
diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_clipboard.cc
index 41313cc..84a6590 100644
--- a/winsup/cygwin/fhandler_clipboard.cc
+++ b/winsup/cygwin/fhandler_clipboard.cc
@@ -273,5 +273,5 @@ fhandler_dev_clipboard::close ()
void
fhandler_dev_clipboard::fixup_after_exec ()
{
- (void) close ();
+ close ();
}
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 3dcea84..405dbb6 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -121,7 +121,7 @@ fhandler_console::get_tty_stuff (int flags = 0)
void
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
@@ -590,7 +590,7 @@ fhandler_console::scroll_screen (int x1, int y1, int x2, int y2, int xn, int yn)
CHAR_INFO fill;
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;
if (y1 == 0)
sr1.Top = dev_state->info.winTop;
@@ -745,7 +745,7 @@ fhandler_console::ioctl (unsigned int cmd, void *buf)
}
return 0;
case TIOCSWINSZ:
- (void) bg_check (SIGTTOU);
+ bg_check (SIGTTOU);
return 0;
case TIOCLINUX:
if (* (int *) buf == 6)
@@ -969,7 +969,7 @@ fhandler_console::clear_screen (int x1, int y1, int x2, int y2)
DWORD done;
int num;
- (void) dev_state->fillin_info (get_output_handle ());
+ dev_state->fillin_info (get_output_handle ());
if (x1 < 0)
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;
- (void) dev_state->fillin_info (get_output_handle ());
+ dev_state->fillin_info (get_output_handle ());
if (y > dev_state->info.winBottom)
y = dev_state->info.winBottom;
else if (y < 0)
@@ -1029,7 +1029,7 @@ fhandler_console::cursor_set (bool rel_to_top, int x, int y)
void
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;
y += dev_state->info.dwCursorPosition.Y;
cursor_set (false, x, y);
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 491b559..368df37 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -414,7 +414,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
pc.set_exec ();
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))
{
DWORD lasterr = GetLastError ();
- (void) FindClose (dir->__handle);
+ FindClose (dir->__handle);
dir->__handle = INVALID_HANDLE_VALUE;
/* POSIX says you shouldn't set errno when readdir can't
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. */
if (pc.isencoded ())
- (void) fnunmunge (dir->__d_dirent->d_name, buf.cFileName);
+ fnunmunge (dir->__d_dirent->d_name, buf.cFileName);
else
strcpy (dir->__d_dirent->d_name, buf.cFileName);
@@ -1394,7 +1394,7 @@ fhandler_disk_file::rewinddir (DIR *dir)
{
if (dir->__handle != INVALID_HANDLE_VALUE)
{
- (void) FindClose (dir->__handle);
+ FindClose (dir->__handle);
dir->__handle = INVALID_HANDLE_VALUE;
}
dir->__d_position = 0;
diff --git a/winsup/cygwin/fhandler_netdrive.cc b/winsup/cygwin/fhandler_netdrive.cc
index 8249673..f1cc897 100644
--- a/winsup/cygwin/fhandler_netdrive.cc
+++ b/winsup/cygwin/fhandler_netdrive.cc
@@ -140,7 +140,7 @@ fhandler_netdrive::fstat (struct __stat64 *buf)
const char *path = get_name ();
debug_printf ("fstat (%s)", path);
- (void) fhandler_base::fstat (buf);
+ fhandler_base::fstat (buf);
buf->st_mode = S_IFDIR | STD_RBITS | STD_XBITS;
diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index ce9fbc1..07ae13e 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -163,7 +163,7 @@ fhandler_proc::fstat (struct __stat64 *buf)
debug_printf ("fstat (%s)", path);
path += proc_len;
- (void) fhandler_base::fstat (buf);
+ fhandler_base::fstat (buf);
buf->st_mode &= ~_IFMT & NO_W;
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 710c63d..7dca217 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -142,7 +142,7 @@ fhandler_process::fstat (struct __stat64 *buf)
{
const char *path = get_name ();
int file_type = exists ();
- (void) fhandler_base::fstat (buf);
+ fhandler_base::fstat (buf);
path += proc_len + 1;
pid = atoi (path);
pinfo p (pid);
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc
index a7a0e29..41ff072 100644
--- a/winsup/cygwin/fhandler_registry.cc
+++ b/winsup/cygwin/fhandler_registry.cc
@@ -374,7 +374,7 @@ fhandler_registry::rewinddir (DIR * dir)
{
if (dir->__handle != INVALID_HANDLE_VALUE)
{
- (void) RegCloseKey ((HKEY) dir->__handle);
+ RegCloseKey ((HKEY) dir->__handle);
dir->__handle = INVALID_HANDLE_VALUE;
}
dir->__d_position = 0;
diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc
index 4c587c9..3c6a3bc 100644
--- a/winsup/cygwin/fhandler_serial.cc
+++ b/winsup/cygwin/fhandler_serial.cc
@@ -53,7 +53,7 @@ fhandler_serial::raw_read (void *ptr, size_t& ulen)
io_status.hEvent);
if (!overlapped_armed)
{
- (void) SetCommMask (get_handle (), EV_RXCHAR);
+ SetCommMask (get_handle (), EV_RXCHAR);
ResetEvent (io_status.hEvent);
}
@@ -200,7 +200,7 @@ err:
void
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
@@ -218,14 +218,14 @@ fhandler_serial::open (int flags, mode_t mode)
res = 1;
- (void) SetCommMask (get_handle (), EV_RXCHAR);
+ SetCommMask (get_handle (), EV_RXCHAR);
uninterruptible_io (true); // Handled explicitly in read code
overlapped_setup ();
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
on open for better behavior under Win 95.
@@ -295,7 +295,7 @@ fhandler_serial::open (int flags, mode_t mode)
int
fhandler_serial::close ()
{
- (void) ForceCloseHandle (io_status.hEvent);
+ ForceCloseHandle (io_status.hEvent);
return fhandler_base::close ();
}
diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc
index 640d5dd..f2e1e34 100644
--- a/winsup/cygwin/fhandler_termios.cc
+++ b/winsup/cygwin/fhandler_termios.cc
@@ -122,7 +122,7 @@ tty_min::kill_pgrp (int sig)
if (p == myself)
killself++;
else
- (void) sig_send (p, si);
+ sig_send (p, si);
}
if (killself)
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))
{
termios_printf ("EOF");
- (void) accept_input ();
+ accept_input ();
ret = line_edit_input_done;
continue;
}
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 9fe3c5e..3d5a567 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -167,7 +167,7 @@ fhandler_pty_master::accept_input ()
DWORD bytes_left;
int ret = 1;
- (void) WaitForSingleObject (input_mutex, INFINITE);
+ WaitForSingleObject (input_mutex, INFINITE);
bytes_left = eat_readahead (-1);
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 504af29..e3b6066 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -233,7 +233,7 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls)
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 ();
sigproc_init ();
@@ -487,7 +487,7 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_
goto cleanup;
}
/* Start the child up again. */
- (void) resume_child (forker_finished);
+ resume_child (forker_finished);
}
ForceCloseHandle (pi.hThread);
diff --git a/winsup/cygwin/hookapi.cc b/winsup/cygwin/hookapi.cc
index 9fe6238..6542a6e 100644
--- a/winsup/cygwin/hookapi.cc
+++ b/winsup/cygwin/hookapi.cc
@@ -59,7 +59,7 @@ putmem (PIMAGE_THUNK_DATA pi, const void *hookfn)
void *origfn = (void *) pi->u1.Function;
pi->u1.Function = (DWORD) hookfn;
- (void) VirtualProtect (pi, sizeof (PVOID), flOldProtect, &flDontCare);
+ VirtualProtect (pi, sizeof (PVOID), flOldProtect, &flDontCare);
return origfn;
}
diff --git a/winsup/cygwin/localtime.cc b/winsup/cygwin/localtime.cc
index aba2f7b..58c96c0 100644
--- a/winsup/cygwin/localtime.cc
+++ b/winsup/cygwin/localtime.cc
@@ -730,9 +730,9 @@ tzload(const char *name, struct state *sp)
return -1;
if ((strlen(p) + strlen(name) + 1) >= sizeof fullname)
return -1;
- (void) strcpy(fullname, p);
- (void) strcat(fullname, "/");
- (void) strcat(fullname, name);
+ strcpy(fullname, p);
+ strcat(fullname, "/");
+ strcat(fullname, 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)
return -1;
cp = sp->chars;
- (void) strncpy(cp, stdname, stdlen);
+ strncpy(cp, stdname, stdlen);
cp += stdlen;
*cp++ = '\0';
if (dstlen != 0) {
- (void) strncpy(cp, dstname, dstlen);
+ strncpy(cp, dstname, dstlen);
*(cp + dstlen) = '\0';
}
return 0;
@@ -1360,7 +1360,7 @@ static void
gmtload(struct state *sp)
{
if (tzload(gmt, sp) != 0)
- (void) tzparse(gmt, sp, true);
+ tzparse(gmt, sp, true);
}
#ifndef STD_INSPIRED
@@ -1479,7 +1479,7 @@ tzset P((void))
return;
lcl_is_set = (strlen(name) < sizeof (lcl_TZname));
if (lcl_is_set)
- (void) strcpy(lcl_TZname, name);
+ strcpy(lcl_TZname, name);
#ifdef ALL_STATE
if (lclptr == NULL) {
@@ -1498,10 +1498,10 @@ tzset P((void))
lclptr->timecnt = 0;
lclptr->ttis[0].tt_gmtoff = 0;
lclptr->ttis[0].tt_abbrind = 0;
- (void) strcpy(lclptr->chars, gmt);
+ strcpy(lclptr->chars, gmt);
} else if (tzload(name, lclptr) != 0) {
if (name[0] == ':' || tzparse(name, lclptr, false) != 0)
- (void) gmtload(lclptr);
+ gmtload(lclptr);
}
settzname();
}
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 531d2b1..18e8bb1 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -193,7 +193,7 @@ check_iovec (const struct iovec *iov, int iovcnt, bool forwrite)
else if (!forwrite)
*p = dummytest (p);
else
- (void) dummytest (p);
+ dummytest (p);
iov++;
iovcnt--;
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index 12eed33..d85186f 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -1203,7 +1203,7 @@ fhandler_disk_file::fixup_mmap_after_fork (HANDLE h, DWORD access, int flags,
if (base != address)
{
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",
address, base, m.AllocationBase, m.State, m.RegionSize);
}
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc
index 3175d92..d8593bf 100644
--- a/winsup/cygwin/passwd.cc
+++ b/winsup/cygwin/passwd.cc
@@ -79,7 +79,7 @@ pwdgrp::read_passwd ()
{
static char linebuf[1024]; // must be static and
// 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",
cygheap->user.name (),
myself->uid == ILLEGAL_UID ? UNKNOWN_UID : myself->uid,
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index bba75b0..c62d702 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1325,7 +1325,7 @@ special_name (const char *s, int inc = 1)
|| strncasematch (s, "con", 3))
p = s + n;
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 == '.'))
return -1;
@@ -2682,7 +2682,7 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
{
strcpy (w32oldpath, oldpath);
create_how = CREATE_ALWAYS;
- (void) SetFileAttributes (win32_path, FILE_ATTRIBUTE_NORMAL);
+ SetFileAttributes (win32_path, FILE_ATTRIBUTE_NORMAL);
}
else
{
@@ -3998,7 +3998,7 @@ etc::init (int n, const char *etc_fn)
fn[n] = etc_fn;
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);
return n;
}
@@ -4052,7 +4052,7 @@ etc::dir_changed (int n)
change_possible[n] = true;
else if (WaitForSingleObject (changed_h, 0) == WAIT_OBJECT_0)
{
- (void) FindNextChangeNotification (changed_h);
+ FindNextChangeNotification (changed_h);
memset (change_possible, true, sizeof change_possible);
}
}
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 9e5dd4e..4aab2f0 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -53,7 +53,7 @@ set_myself (HANDLE h)
myself->process_state |= PID_IN_USE;
myself->dwProcessId = GetCurrentProcessId ();
- (void) GetModuleFileName (NULL, myself->progname, sizeof (myself->progname));
+ GetModuleFileName (NULL, myself->progname, sizeof (myself->progname));
if (!strace.active)
strace.hello ();
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
that may want to manipulate the current directory before this
process has completely exited. */
- (void) SetCurrentDirectory (windows_system_directory);
+ SetCurrentDirectory (windows_system_directory);
}
void
@@ -610,7 +610,7 @@ _pinfo::commune_recv ()
sigproc_printf ("WriteFile read handle failed, %E");
}
- (void) ReadFile (__fromthem, &nr, sizeof (nr), &nr, NULL);
+ ReadFile (__fromthem, &nr, sizeof (nr), &nr, NULL);
break;
}
}
@@ -761,7 +761,7 @@ _pinfo::commune_send (DWORD code, ...)
}
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)
goto err;
diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc
index 0d9c0cd..c094311 100644
--- a/winsup/cygwin/pipe.cc
+++ b/winsup/cygwin/pipe.cc
@@ -185,7 +185,7 @@ fhandler_pipe::read (void *in_ptr, size_t& in_len)
if (th->detach (read_state) && !in_len)
in_len = (size_t) -1; /* received a signal */
}
- (void) ReleaseMutex (guard);
+ ReleaseMutex (guard);
return;
}
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 13913c9..7c146fe 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -976,7 +976,7 @@ peek_serial (select_record *s, bool)
goto out;
}
- (void) SetCommMask (h, EV_RXCHAR);
+ SetCommMask (h, EV_RXCHAR);
if (!fh->overlapped_armed)
{
@@ -1166,7 +1166,7 @@ fhandler_base::ready_for_read (int fd, DWORD howlong)
me.fd = fd;
while (!avail)
{
- (void) select_read (&me);
+ select_read (&me);
avail = me.read_ready ?: me.peek (&me, false);
if (fd >= 0 && cygheap->fdtab.not_open (fd))
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index b1b4dc4..fd20766 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -86,7 +86,7 @@ open_shared (const char *name, int n, HANDLE& shared_h, DWORD size,
else
{
addr = offsets[m];
- (void) VirtualFree (addr, 0, MEM_RELEASE);
+ VirtualFree (addr, 0, MEM_RELEASE);
}
if (shared_h)
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index b3a0e31..5df1925 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -94,7 +94,7 @@ nanosleep (const struct timespec *rqtp, struct timespec *rmtp)
rem = 0;
if (rc == WAIT_OBJECT_0)
{
- (void) _my_tls.call_signal_handler ();
+ _my_tls.call_signal_handler ();
set_errno (EINTR);
res = -1;
}
@@ -172,7 +172,7 @@ handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& op
newmask = *set;
break;
}
- (void) set_signal_mask (newmask, opmask);
+ set_signal_mask (newmask, opmask);
}
return 0;
}
@@ -208,7 +208,7 @@ _pinfo::kill (siginfo_t& si)
si2.si_signo = SIGCONT;
si2.si_code = SI_KERNEL;
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,
@@ -332,7 +332,7 @@ abort (void)
set_signal_mask (sig_mask);
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. */
}
@@ -466,7 +466,7 @@ extern "C" int
siginterrupt (int sig, int flag)
{
struct sigaction act;
- (void) sigaction(sig, NULL, &act);
+ sigaction(sig, NULL, &act);
if (flag)
act.sa_flags &= ~SA_RESTART;
else
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 93844c4..d85064b 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -129,9 +129,9 @@ wait_for_sigthread ()
{
sigproc_printf ("wait_sig_inited %p", wait_sig_inited);
HANDLE hsig_inited = wait_sig_inited;
- (void) WaitForSingleObject (hsig_inited, INFINITE);
+ WaitForSingleObject (hsig_inited, INFINITE);
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
@@ -389,7 +389,7 @@ proc_terminate (void)
{
sync_proc_subproc.acquire (WPSP);
- (void) proc_subproc (PROC_CLEARWAIT, 1);
+ proc_subproc (PROC_CLEARWAIT, 1);
/* Clean out proc processes from the pid list. */
int i;
@@ -457,7 +457,7 @@ sig_dispatch_pending (bool fast)
#ifdef DEBUGGING
sigproc_printf ("flushing");
#endif
- (void) sig_send (myself, fast ? __SIGFLUSHFAST : __SIGFLUSH);
+ sig_send (myself, fast ? __SIGFLUSHFAST : __SIGFLUSH);
}
void __stdcall
@@ -1000,7 +1000,7 @@ wait_sig (VOID *self)
Static bool holding_signals;
/* Initialization */
- (void) SetThreadPriority (GetCurrentThread (), WAIT_SIG_PRIORITY);
+ SetThreadPriority (GetCurrentThread (), WAIT_SIG_PRIORITY);
if (!CreatePipe (&readsig, &myself->sendsig, sec_user_nih (sa_buf), 0))
api_fatal ("couldn't create signal pipe, %E");
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 6aef5fe..2a85b70 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -772,7 +772,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
cleanup.oldquit = signal (SIGQUIT, SIG_IGN);
sigemptyset (&child_block);
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);
@@ -819,7 +819,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
just in case we've been previously
execed. */
myself.zap_cwd ();
- (void) myself->dup_proc_pipe (pi.hProcess);
+ myself->dup_proc_pipe (pi.hProcess);
}
}
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
is not a brief period during which the pid is not available.
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);
child->start_time = time (NULL); /* Register child's starting time. */
child->nice = myself->nice;
diff --git a/winsup/cygwin/sync.cc b/winsup/cygwin/sync.cc
index 797deed..e539e38 100644
--- a/winsup/cygwin/sync.cc
+++ b/winsup/cygwin/sync.cc
@@ -135,12 +135,12 @@ muto::release ()
if (!--visits)
{
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.
Decrement it now. If it is >= 0 then there are possibly other
threads waiting for the lock, so trigger bruteforce. */
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 == '!')
{
CloseHandle (bruteforce); /* If *name == '!' and there are no
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 6f06bb1..37f3b74 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -202,7 +202,7 @@ unlink (const char *ourname)
if (h != INVALID_HANDLE_VALUE)
{
if (wincap.has_hard_links () && setattrs)
- (void) SetFileAttributes (win32_name, (DWORD) win32_name);
+ SetFileAttributes (win32_name, (DWORD) win32_name);
BOOL res = CloseHandle (h);
syscall_printf ("%d = CloseHandle (%p)", res, h);
if (GetFileAttributes (win32_name) == INVALID_FILE_ATTRIBUTES
@@ -230,7 +230,7 @@ unlink (const char *ourname)
DWORD lasterr;
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
violation. So, set lasterr to ERROR_SHARING_VIOLATION in this case
diff --git a/winsup/cygwin/termios.cc b/winsup/cygwin/termios.cc
index c33054a..6e0ab3e 100644
--- a/winsup/cygwin/termios.cc
+++ b/winsup/cygwin/termios.cc
@@ -179,7 +179,7 @@ tcgetattr (int fd, struct termios *in_t)
else if (!cfd->is_tty ())
set_errno (ENOTTY);
else if ((res = cfd->tcgetattr (t)) == 0)
- (void) __toapp_termios (in_t, t);
+ __toapp_termios (in_t, t);
if (res)
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);
int res = setspeed (tp->c_ospeed, speed);
- (void) __toapp_termios (in_tp, tp);
+ __toapp_termios (in_tp, tp);
return res;
}
@@ -301,6 +301,6 @@ cfsetispeed (struct termios *in_tp, speed_t speed)
{
struct termios *tp = __tonew_termios (in_tp);
int res = setspeed (tp->c_ispeed, speed);
- (void) __toapp_termios (in_tp, tp);
+ __toapp_termios (in_tp, tp);
return res;
}
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 5ecf64e..ea4f649 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -1660,7 +1660,7 @@ pthread_mutex::_lock (pthread_t self)
set_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);
}
else
diff --git a/winsup/cygwin/timer.cc b/winsup/cygwin/timer.cc
index b6f1b4c..552e56f 100644
--- a/winsup/cygwin/timer.cc
+++ b/winsup/cygwin/timer.cc
@@ -245,7 +245,7 @@ timer_tracker::settime (int in_flags, const itimerspec *value, itimerspec *ovalu
syncthread = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
else
ResetEvent (syncthread);
- (void) new cygthread (timer_thread, this, "itimer", syncthread);
+ new cygthread (timer_thread, this, "itimer", syncthread);
}
return 0;
diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc
index 78fce27..bbc6f21 100644
--- a/winsup/cygwin/tty.cc
+++ b/winsup/cygwin/tty.cc
@@ -88,7 +88,7 @@ create_tty_master (int ttynum)
DWORD len = sizeof our_utmp.ut_host;
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));
GetComputerName (our_utmp.ut_host, &len);
__small_sprintf (our_utmp.ut_line, "tty%d", ttynum);
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 0e0da14..c8995bd 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -126,7 +126,7 @@ internal_getlogin (cygheap_user &user)
debug_printf ("gsid not found in augmented /etc/group");
}
}
- (void) cygheap->user.ontherange (CH_HOME, pw);
+ cygheap->user.ontherange (CH_HOME, pw);
return;
}
@@ -440,7 +440,7 @@ const char *
cygheap_user::env_name (const char *name, size_t namelen)
{
if (!test_uid (pwinname, name, namelen))
- (void) domain ();
+ domain ();
return pwinname;
}