]> sourceware.org Git - newlib-cygwin.git/commitdiff
Eliminate (void) cast on standalone function calls throughout.
authorChristopher Faylor <me@cgf.cx>
Wed, 6 Jul 2005 20:05:03 +0000 (20:05 +0000)
committerChristopher Faylor <me@cgf.cx>
Wed, 6 Jul 2005 20:05:03 +0000 (20:05 +0000)
41 files changed:
winsup/cygwin/ChangeLog
winsup/cygwin/cygheap.cc
winsup/cygwin/cygthread.cc
winsup/cygwin/cygthread.h
winsup/cygwin/dcrt0.cc
winsup/cygwin/debug.h
winsup/cygwin/environ.cc
winsup/cygwin/exceptions.cc
winsup/cygwin/fhandler.cc
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_clipboard.cc
winsup/cygwin/fhandler_console.cc
winsup/cygwin/fhandler_disk_file.cc
winsup/cygwin/fhandler_netdrive.cc
winsup/cygwin/fhandler_proc.cc
winsup/cygwin/fhandler_process.cc
winsup/cygwin/fhandler_registry.cc
winsup/cygwin/fhandler_serial.cc
winsup/cygwin/fhandler_termios.cc
winsup/cygwin/fhandler_tty.cc
winsup/cygwin/fork.cc
winsup/cygwin/hookapi.cc
winsup/cygwin/localtime.cc
winsup/cygwin/miscfuncs.cc
winsup/cygwin/mmap.cc
winsup/cygwin/passwd.cc
winsup/cygwin/path.cc
winsup/cygwin/pinfo.cc
winsup/cygwin/pipe.cc
winsup/cygwin/select.cc
winsup/cygwin/shared.cc
winsup/cygwin/signal.cc
winsup/cygwin/sigproc.cc
winsup/cygwin/spawn.cc
winsup/cygwin/sync.cc
winsup/cygwin/syscalls.cc
winsup/cygwin/termios.cc
winsup/cygwin/thread.cc
winsup/cygwin/timer.cc
winsup/cygwin/tty.cc
winsup/cygwin/uinfo.cc

index 706f7f2d513fd7f57da62f668c70b328408c2d31..c42dc5975c53729ac6366ada502d42321040f0fe 100644 (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>
 
        * dcrt0.cc (cygwin_exit): Mark as "noreturn".
index 48262ca0612e2b26c30330b7cd139575a8d76756..633df7f0995c8bd5610fa8729c00eee191735fc6 100644 (file)
@@ -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;
 }
 
index f96908c0e2a72209390400f160c9e655da96b5c7..80fa4546d2317aa675d3b2c323ef5d7bee53d28c 100644 (file)
@@ -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;
index 6d504f1e440568b40caa92ad9e579c65c2d25101..9da8d1c52de0921886e2fbd11cd601ee8b5a287a 100644 (file)
@@ -46,7 +46,7 @@ class cygthread
   bool SetThreadPriority (int nPriority) {return ::SetThreadPriority (h, nPriority);}
   void zap_h ()
   {
-    (void) CloseHandle (h);
+    CloseHandle (h);
     h = NULL;
   }
 };
index b55aeca656a863013aeb529293094653cedbef06..d15fca4365ed35264db13fd3fb03a5885b280dcb 100644 (file)
@@ -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);
 }
index 796eeecb3e3ecae58db495828e2b5f748f860c96..94d4c5a2ba7b883e22f6956920fe833afa879221 100644 (file)
@@ -13,7 +13,7 @@ details. */
 #include "dlmalloc.h"
 #define MALLOC_CHECK ({\
   debug_printf ("checking malloc pool");\
-  (void) mallinfo ();\
+  mallinfo ();\
 })
 #endif
 
index 099dcaee5837ca64a82eda329e9a2eed97dbbc70..33c6c78fbb721c69db345d2222857ba69e749edb 100644 (file)
@@ -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;
     }
index be3c0209fe441fb1c6cab438798994003b6e26dc..4f9a55e3df60b17a7ac87233f5e3d3a88d2624ac 100644 (file)
@@ -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]);
index b619b28b319dcc6376b91dbc6c0166f46230097d..e5e14fc920c5f7d8bdb9cc0c6b4d62d3b2028684 100644 (file)
@@ -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)
     {
index 0165c28ffca4b9d701d8f49c1f15a005a90be3ea..7d4f6cee16310343bdeed82c3256edf62531f458 100644 (file)
@@ -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; }
index 41313cca7a247d13ff94f723ba907f6f174425f7..84a6590b639b5fdd02ae0ef3e8e99eb9df9eb758 100644 (file)
@@ -273,5 +273,5 @@ fhandler_dev_clipboard::close ()
 void
 fhandler_dev_clipboard::fixup_after_exec ()
 {
-  (void) close ();
+  close ();
 }
index 3dcea844df22ce8a676ce2747fe4965ca602a7c0..405dbb686144fd415c3e7683c5f81148c7cff889 100644 (file)
@@ -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);
index 491b559161ad23c1b6f6812f163035acb5babf04..368df374d5dfe1bcce118ca85d245edc5dd3b58b 100644 (file)
@@ -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;
index 8249673bebb7a7d0dde126c775488cd38a17dee0..f1cc897be47107394ec51376172f60fe28738aad 100644 (file)
@@ -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;
 
index ce9fbc180e5e319ecf8e67af1832896233df6d01..07ae13e0c0a9ea3fbaeef70c51e7e9584e73d19b 100644 (file)
@@ -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;
 
index 710c63d5d54353c1736f353adf30a22dfc916aaf..7dca217477d3e86cbd64d6b7494d97a26b70b336 100644 (file)
@@ -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);
index a7a0e2999dea23f580857052dced4d5355eda58f..41ff072a2cbc4de91c66b1a6091e290febe85554 100644 (file)
@@ -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;
index 4c587c9572f75d313366577358cac3439e60b5b3..3c6a3bcdcb32a3bd09cb3d52ad048666cf1c05ba 100644 (file)
@@ -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 ();
 }
 
index 640d5dd5e51d20e59652f2f90c5df7ff96a9155a..f2e1e3425bb37d63eceb2719edba1288b38df826 100644 (file)
@@ -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;
        }
index 9fe3c5ec2e9f388c7cba17b6ab99ee403e97a977..3d5a567dfd880d665ba87b79ee939b8f8eb928be 100644 (file)
@@ -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);
 
index 504af292cd68d53e5dcb6892b9290989651aaef5..e3b606607feb2ad47c32685101eba55454ea7c9d 100644 (file)
@@ -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);
index 9fe62383c783d2f5b3a9c639b43faea705c40d3f..6542a6ebe5758ce6f82622ad8256296c69df45ff 100644 (file)
@@ -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;
 }
 
index aba2f7b7969b098f800a452005be98e096a2383c..58c96c0e6c3e694f7a8e7defe6f95620c5370e43 100644 (file)
@@ -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();
 }
index 531d2b1f2f0c596d4e42e324aadfc3b51bff0735..18e8bb103f697cf749daf01087bb25ff5dd62c8b 100644 (file)
@@ -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--;
index 12eed3345a14e477d1004a485d6fc78519a6fdb8..d85186f8e17fc61bcab129dfc5c3bf7efaf1ebf1 100644 (file)
@@ -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);
     }
index 3175d92aab08585817fb3f1bacbb82395f475c5c..d8593bf01d6e13682e8211da5b9b9d7201e07661 100644 (file)
@@ -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,
index bba75b0e9e516efc074288bc914b785aa7805bb5..c62d70246ed43a7542bf5595aa1b0ed2ff517393 100644 (file)
@@ -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);
        }
     }
index 9e5dd4e971bd96279217abda7a8500c7af0c7ad3..4aab2f02004252fa7ce355dee2111cf0407be5f7 100644 (file)
@@ -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;
 
index 0d9c0cd9f974b67894c4fb275a8b8f59bbbb2988..c094311c186fb665420bc758d21a0b6230612a28 100644 (file)
@@ -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;
 }
 
index 13913c95ffae27079883dbaf400eef3624865401..7c146fe442248086e585944ab8fd566e064b0603 100644 (file)
@@ -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))
index b1b4dc41a49e530df84205a1b57f7fc3efb2a594..fd20766a38f470806d35ee99ff14d8539f52c97d 100644 (file)
@@ -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)
index b3a0e31c192e6bc176046580503d7d4574384991..5df1925cb5335287238676a47d988d40b5f00863 100644 (file)
@@ -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
index 93844c48a8e188687cf85f96aaeec6f6a12daa54..d85064b18b1c7e444c2187a933cac5004cb9514c 100644 (file)
@@ -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");
index 6aef5feb67371d22c3ddaa5693367e949c8f31ef..2a85b7088272183a9928ee02977912887c11f773 100644 (file)
@@ -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;
index 797deed4a956c68baa1a146676f4f86b149c438c..e539e38936cceb7bf9e1ab3228678b507ed01ab3 100644 (file)
@@ -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
index 6f06bb1d71c0f9c8b43ec9de5deab2d61e72e34f..37f3b74eb03b8a43069db16db7928d2ec0183fe2 100644 (file)
@@ -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
index c33054af5e6b43b32b832d8ef5f9fb3deb3b6e82..6e0ab3e9fbc2d0e38b10e71081efee23cff7fa19 100644 (file)
@@ -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;
 }
index 5ecf64e6d26ea0abf3fc654a1fa8b7d6726474cc..ea4f6493023423cdf8db970f2a6878575ae00dde 100644 (file)
@@ -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
index b6f1b4cdda15699b392d571ef857ddb2db4fcba8..552e56f6effb944bb1ec00b91d81f6699d2f0342 100644 (file)
@@ -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;
index 78fce27e875089ec268c40adc84de0b9e61220e0..bbc6f21e7be68894bacc1da3876c3e6226263869 100644 (file)
@@ -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);
index 0e0da14e599704f065d94f636dd654965e062111..c8995bdf41fc539cfbb971d8599e8c9b1c5acae3 100644 (file)
@@ -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;
 }
 
This page took 0.085829 seconds and 5 git commands to generate.