From 9cec3d45aa1e7c7b3aed4559aa8bef57d24612d9 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 21 Feb 2000 05:20:38 +0000 Subject: [PATCH] Respond to a multitude of g++ warnings. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/dcrt0.cc | 14 +++++++------- winsup/cygwin/environ.cc | 4 ++-- winsup/cygwin/exceptions.cc | 2 +- winsup/cygwin/fhandler.cc | 18 +++++++++--------- winsup/cygwin/fhandler.h | 16 ++++++++-------- winsup/cygwin/fhandler_console.cc | 4 ++-- winsup/cygwin/fhandler_floppy.cc | 2 +- winsup/cygwin/fhandler_termios.cc | 2 +- winsup/cygwin/fhandler_tty.cc | 30 ++++++++++++++++-------------- winsup/cygwin/fhandler_zero.cc | 6 +++--- winsup/cygwin/fork.cc | 7 +++---- winsup/cygwin/grp.cc | 2 +- winsup/cygwin/heap.cc | 2 +- winsup/cygwin/init.cc | 2 +- winsup/cygwin/localtime.c | 6 ++---- winsup/cygwin/malloc_wrapper.cc | 4 ++-- winsup/cygwin/net.cc | 2 +- winsup/cygwin/passwd.cc | 26 +++++++++----------------- winsup/cygwin/path.cc | 2 +- winsup/cygwin/path.h | 7 ++++--- winsup/cygwin/regexp/regexp.c | 2 +- winsup/cygwin/security.cc | 4 ++-- winsup/cygwin/select.cc | 11 +++++------ winsup/cygwin/shared.h | 10 ++++++---- winsup/cygwin/sigproc.cc | 8 ++++---- winsup/cygwin/strace.cc | 2 +- winsup/cygwin/sync.h | 4 ++-- winsup/cygwin/syscalls.cc | 10 +++++----- winsup/cygwin/window.cc | 2 +- 30 files changed, 106 insertions(+), 109 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2054f7989..aea5b378b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +Mon Feb 21 00:19:40 2000 Christopher Faylor + + Respond to a multitude of new g++ warnings. + Sun Feb 20 22:10:21 2000 Christopher Faylor * environ.cc (getwinenv): Make __stdcall. diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 10652044e..a0bd58e13 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -22,8 +22,8 @@ details. */ HANDLE NO_COPY hMainProc = NULL; HANDLE NO_COPY hMainThread = NULL; -static per_process dummy_user_data = {0}; -per_process NO_COPY *user_data = &dummy_user_data; +static NO_COPY char dummy_user_data[sizeof (per_process)] = {0}; +per_process NO_COPY *user_data = (per_process *) &dummy_user_data; per_thread_waitq NO_COPY waitq_storage; per_thread_vfork NO_COPY vfork_storage; @@ -94,7 +94,7 @@ do_global_ctors (void (**in_pfunc)(), int force) while (--pfunc > in_pfunc) (*pfunc) (); - if (user_data != &dummy_user_data) + if (user_data != (per_process *) &dummy_user_data) atexit (do_global_dtors); } @@ -260,7 +260,7 @@ isquote (char c) /* Step over a run of characters delimited by quotes */ static __inline char * -quoted (char *word, char *cmd, int winshell) +quoted (char *cmd, int winshell) { char *p; char quote = *cmd; @@ -418,7 +418,7 @@ build_argv (char *cmd, char **&argv, int &argc, int winshell) /* Skip over characters until the closing quote */ { sawquote = cmd; - cmd = quoted (word, cmd, winshell); + cmd = quoted (cmd, winshell); } if (issep (*cmd)) // End of argument if space break; @@ -502,7 +502,7 @@ static MEMORY_BASIC_INFORMATION sm; #define EBP 6 #define ESP 7 -extern void __inline__ +extern __inline__ void alloc_stack_hard_way (child_info_fork *ci, volatile char *b) { void *new_stack_pointer; @@ -535,7 +535,7 @@ alloc_stack_hard_way (child_info_fork *ci, volatile char *b) /* extend the stack prior to fork longjmp */ -extern void __inline__ +extern __inline__ void alloc_stack (child_info_fork *ci) { /* FIXME: adding 16384 seems to avoid a stack copy problem during diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index e59802c81..56ec6d847 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -42,7 +42,7 @@ static win_env conv_envvars[] = return_MAX_PATH, return_MAX_PATH}, {"LD_LIBRARY_PATH=", 16, NULL, NULL, cygwin_conv_to_full_posix_path, cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH}, - {NULL} + {NULL, 0, NULL, NULL, NULL, NULL, 0, 0} }; void @@ -260,7 +260,7 @@ unsetenv (const char *name) /* Turn environment variable part of a=b string into uppercase. */ -static void __inline +static __inline__ void ucenv (char *p, char *eq) { /* Amazingly, NT has a case sensitive environment name list, diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index fad70f887..198824c42 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -439,7 +439,7 @@ stackdump (HANDLE hproc, HANDLE hthread, EXCEPTION_RECORD *e, CONTEXT *in) /* Main exception handler. */ static int -handle_exceptions (EXCEPTION_RECORD *e, void *arg, CONTEXT *in, void *x) +handle_exceptions (EXCEPTION_RECORD *e, void *, CONTEXT *in, void *) { int sig; diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index c0f0ed74d..a7014e132 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -84,7 +84,7 @@ fhandler_base::eat_readahead (int n) n = ralen; if (n > 0 && ralen) { - if ((ralen -= n) < 0) + if ((int) (ralen -= n) < 0) ralen = 0; if (raixget >= ralen) @@ -1059,14 +1059,14 @@ fhandler_base::dup (fhandler_base *child) /* Base terminal handlers. These just return errors. */ int -fhandler_base::tcflush (int queue) +fhandler_base::tcflush (int) { set_errno (ENOTTY); return -1; } int -fhandler_base::tcsendbreak (int duration) +fhandler_base::tcsendbreak (int) { set_errno (ENOTTY); return -1; @@ -1080,28 +1080,28 @@ fhandler_base::tcdrain (void) } int -fhandler_base::tcflow (int action) +fhandler_base::tcflow (int) { set_errno (ENOTTY); return -1; } int -fhandler_base::tcsetattr (int a, const struct termios *t) +fhandler_base::tcsetattr (int, const struct termios *) { set_errno (ENOTTY); return -1; } int -fhandler_base::tcgetattr (struct termios *t) +fhandler_base::tcgetattr (struct termios *) { set_errno (ENOTTY); return -1; } int -fhandler_base::tcsetpgrp (const pid_t pid) +fhandler_base::tcsetpgrp (const pid_t) { set_errno (ENOTTY); return -1; @@ -1293,7 +1293,7 @@ fhandler_disk_file::lock (int cmd, struct flock *fl) startpos = 0; break; case SEEK_CUR: - if ((startpos = lseek (0, SEEK_CUR)) < 0) + if ((off_t) (startpos = lseek (0, SEEK_CUR)) == (off_t)-1) return -1; break; case SEEK_END: @@ -1453,7 +1453,7 @@ fhandler_pipe::lseek (off_t offset, int whence) } void __stdcall -set_inheritance (HANDLE &h, int not_inheriting, const char *name) +set_inheritance (HANDLE &h, int not_inheriting, const char *) { HANDLE newh; diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index cf1924809..94a4bdbb6 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -295,7 +295,7 @@ public: { return windows_device_names[FHDEVN (status)]; } - virtual int bg_check (int, int x = 0) {return 1;} + virtual int bg_check (int) {return 1;} }; class fhandler_socket: public fhandler_base @@ -311,7 +311,7 @@ public: int write (const void *ptr, size_t len); int read (void *ptr, size_t len); int ioctl (unsigned int cmd, void *); - off_t lseek (off_t offset, int whence) { return 0; } + off_t lseek (off_t, int) { return 0; } int close (); select_record *select_read (select_record *s); @@ -479,7 +479,7 @@ public: int tcflow (int); int tcsetattr (int a, const struct termios *t); int tcgetattr (struct termios *t); - off_t lseek (off_t offset, int whence) { return 0; } + off_t lseek (off_t, int) { return 0; } int tcflush (int); void dump (); int is_tty () { return 1; } @@ -501,7 +501,7 @@ class fhandler_termios: public fhandler_base { protected: HANDLE output_handle; - virtual void doecho (const void *str, DWORD len) {}; + virtual void doecho (const void *, DWORD) {}; virtual int accept_input () {return 1;}; public: tty_min *tc; @@ -519,7 +519,7 @@ public: int tcgetpgrp (); int tcsetpgrp (int pid); void set_ctty (int ttynum, int flags); - int bg_check (int sig, int blocksigs = 1); + int bg_check (int sig); }; /* This is a input and output console handle */ @@ -656,7 +656,7 @@ public: int tcflush (int); int ioctl (unsigned int cmd, void *); - off_t lseek (off_t offset, int whence) { return 0; } + off_t lseek (off_t, int) { return 0; } }; class fhandler_pty_master: public fhandler_tty_common @@ -681,7 +681,7 @@ public: int tcflush (int); int ioctl (unsigned int cmd, void *); - off_t lseek (off_t offset, int whence) { return 0; } + off_t lseek (off_t, int) { return 0; } char *ptsname (); void set_close_on_exec (int val); @@ -739,7 +739,7 @@ public: int write (const void *ptr, size_t len); int read (void *ptr, size_t len); int ioctl (unsigned int cmd, void *); - off_t lseek (off_t offset, int whence) { return 0; } + off_t lseek (off_t, int) { return 0; } int close (void) { return 0; } void set_close_on_exec (int val); diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 188c79c56..40e2954ee 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -407,7 +407,7 @@ fhandler_console::ioctl (unsigned int cmd, void *buf) } return 0; case TIOCSWINSZ: - (void) bg_check (SIGTTOU, 0); + (void) bg_check (SIGTTOU); return 0; } @@ -1323,7 +1323,7 @@ fhandler_console::set_close_on_exec (int val) } void -fhandler_console::fixup_after_fork (HANDLE parent) +fhandler_console::fixup_after_fork (HANDLE) { HANDLE h = get_handle (); HANDLE oh = get_output_handle (); diff --git a/winsup/cygwin/fhandler_floppy.cc b/winsup/cygwin/fhandler_floppy.cc index 7c589824d..ed1c7b6e5 100644 --- a/winsup/cygwin/fhandler_floppy.cc +++ b/winsup/cygwin/fhandler_floppy.cc @@ -28,7 +28,7 @@ fhandler_dev_floppy::is_eom (int win_error) } int -fhandler_dev_floppy::is_eof (int win_error) +fhandler_dev_floppy::is_eof (int) { int ret = 0; if (ret) diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc index 5c34178e6..6036cd66c 100644 --- a/winsup/cygwin/fhandler_termios.cc +++ b/winsup/cygwin/fhandler_termios.cc @@ -102,7 +102,7 @@ fhandler_termios::set_ctty (int ttynum, int flags) } int -fhandler_termios::bg_check (int sig, int blocksigs) +fhandler_termios::bg_check (int sig) { if (!myself->pgid || tc->getpgid () == myself->pgid || myself->ctty != tc->ntty || diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index c4ede333a..7ae872e49 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -182,7 +182,7 @@ fhandler_pty_master::accept_input () } static DWORD WINAPI -process_input (void *arg) +process_input (void *) { char rawbuf[INP_BUFFER_SIZE]; @@ -346,7 +346,7 @@ again: } static DWORD WINAPI -process_output (void *arg) +process_output (void *) { char buf[OUT_BUFFER_SIZE*2]; int n; @@ -374,7 +374,7 @@ process_output (void *arg) /* Process tty ioctl requests */ static DWORD WINAPI -process_ioctl (void *arg) +process_ioctl (void *) { while (1) { @@ -500,7 +500,7 @@ fhandler_tty_slave::open (const char *, int flags, mode_t) } void -fhandler_tty_slave::init (HANDLE f, DWORD a, mode_t) +fhandler_tty_slave::init (HANDLE, DWORD a, mode_t) { int mode = 0; @@ -733,7 +733,7 @@ fhandler_tty_slave::tcgetattr (struct termios *t) } int -fhandler_tty_slave::tcsetattr (int a, const struct termios *t) +fhandler_tty_slave::tcsetattr (int, const struct termios *t) { acquire_output_mutex (INFINITE); get_ttyp ()->ti = *t; @@ -742,7 +742,7 @@ fhandler_tty_slave::tcsetattr (int a, const struct termios *t) } int -fhandler_tty_slave::tcflush (int a) +fhandler_tty_slave::tcflush (int) { return 0; } @@ -895,7 +895,7 @@ fhandler_pty_master::read (void *ptr, size_t len) DWORD n; char *cptr = (char *) ptr; - if (! PeekNamedPipe (get_handle (), NULL, 0, NULL, &n, NULL)) + if (!PeekNamedPipe (get_handle (), NULL, 0, NULL, &n, NULL)) { if (GetLastError () == ERROR_BROKEN_PIPE) { @@ -916,14 +916,16 @@ fhandler_pty_master::read (void *ptr, size_t len) *cptr++ = TIOCPKT_DATA; len--; } - n = process_slave_output (cptr, len); - if (n < 0) + + int x; + x = process_slave_output (cptr, len); + if (x < 0) return -1; if (output_done_event != NULL) SetEvent (output_done_event); - if (pktmode && n > 0) - n++; - return n; + if (pktmode && x > 0) + x++; + return x; } int @@ -934,14 +936,14 @@ fhandler_pty_master::tcgetattr (struct termios *t) } int -fhandler_pty_master::tcsetattr (int a, const struct termios *t) +fhandler_pty_master::tcsetattr (int, const struct termios *t) { cygwin_shared->tty[ttynum]->ti = *t; return 0; } int -fhandler_pty_master::tcflush (int a) +fhandler_pty_master::tcflush (int) { return 0; } diff --git a/winsup/cygwin/fhandler_zero.cc b/winsup/cygwin/fhandler_zero.cc index eb76037fb..29f01ab49 100644 --- a/winsup/cygwin/fhandler_zero.cc +++ b/winsup/cygwin/fhandler_zero.cc @@ -20,14 +20,14 @@ fhandler_dev_zero::fhandler_dev_zero (const char *name) } int -fhandler_dev_zero::open (const char *path, int flags, mode_t mode = 0) +fhandler_dev_zero::open (const char *, int flags, mode_t) { set_flags (flags); return 1; } int -fhandler_dev_zero::write (const void *ptr, size_t len) +fhandler_dev_zero::write (const void *, size_t len) { return len; } @@ -40,7 +40,7 @@ fhandler_dev_zero::read (void *ptr, size_t len) } off_t -fhandler_dev_zero::lseek (off_t offset, int whence) +fhandler_dev_zero::lseek (off_t, int) { return 0; } diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index c08eab292..a82d2dc76 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -169,8 +169,7 @@ sync_with_child (PROCESS_INFORMATION &pi, HANDLE subproc_ready, } static int -resume_child (PROCESS_INFORMATION &pi, HANDLE subproc_ready, - HANDLE forker_finished) +resume_child (PROCESS_INFORMATION &pi, HANDLE forker_finished) { int rc; @@ -454,7 +453,7 @@ fork () DllList::the().numberOfOpenedDlls(); /* Start thread, and wait for it to reload dlls. */ - if (!resume_child (pi, subproc_ready, forker_finished) || + if (!resume_child (pi, forker_finished) || !sync_with_child (pi, subproc_ready, load_dll, "child loading dlls")) goto cleanup; @@ -473,7 +472,7 @@ fork () } DLL_DONE; /* Start the child up again. */ - (void) resume_child (pi, subproc_ready, forker_finished); + (void) resume_child (pi, forker_finished); } ForceCloseHandle (subproc_ready); diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index 5263c536b..d8a0783cf 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -277,7 +277,7 @@ getgroups (int gidsetsize, gid_t *grouplist) extern "C" int -initgroups (const char *user, gid_t grp) +initgroups (const char *, gid_t) { return 0; } diff --git a/winsup/cygwin/heap.cc b/winsup/cygwin/heap.cc index 7bbe882d8..6c8ddae8f 100644 --- a/winsup/cygwin/heap.cc +++ b/winsup/cygwin/heap.cc @@ -20,7 +20,7 @@ details. */ static unsigned page_const = 0; -static int __inline +static __inline__ int getpagesize(void) { SYSTEM_INFO si; diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc index a159def55..3a33bd15b 100644 --- a/winsup/cygwin/init.cc +++ b/winsup/cygwin/init.cc @@ -27,7 +27,7 @@ extern void do_global_ctors (void (**in_pfunc)(), int force); int NO_COPY dynamically_loaded; int -WINAPI dll_entry (HANDLE hdll, DWORD reason, void *static_load) +WINAPI dll_entry (HANDLE, DWORD reason, void *static_load) { switch (reason) { diff --git a/winsup/cygwin/localtime.c b/winsup/cygwin/localtime.c index 5784f3cb0..a22d654e7 100644 --- a/winsup/cygwin/localtime.c +++ b/winsup/cygwin/localtime.c @@ -1560,10 +1560,8 @@ tzset P((void)) /*ARGSUSED*/ static void -localsub(timep, offset, tmp) -const time_t * const timep; -const long offset; -struct tm * const tmp; +localsub (const time_t * const timep, const long offset, + struct tm * const tmp) { register struct state * sp; register const struct ttinfo * ttisp; diff --git a/winsup/cygwin/malloc_wrapper.cc b/winsup/cygwin/malloc_wrapper.cc index b4babd901..3442c14d4 100644 --- a/winsup/cygwin/malloc_wrapper.cc +++ b/winsup/cygwin/malloc_wrapper.cc @@ -224,14 +224,14 @@ malloc_init () extern "C" void -__malloc_lock (struct _reent *ptr) +__malloc_lock (struct _reent *) { SetResourceLock(LOCK_MEMORY_LIST,WRITE_LOCK|READ_LOCK," __malloc_lock"); } extern "C" void -__malloc_unlock (struct _reent *ptr) +__malloc_unlock (struct _reent *) { ReleaseResourceLock(LOCK_MEMORY_LIST,WRITE_LOCK|READ_LOCK," __malloc_unlock"); } diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 1cff9b309..41cbb7ed9 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -904,7 +904,7 @@ cygwin_shutdown (int fd, int how) /* exported as herror: standards? */ extern "C" void -cygwin_herror (const char *p) +cygwin_herror (const char *) { debug_printf ("********%d*************", __LINE__); } diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc index 51c5450b4..f385b7d54 100644 --- a/winsup/cygwin/passwd.cc +++ b/winsup/cygwin/passwd.cc @@ -164,8 +164,7 @@ search_for (uid_t uid, const char *name) return default_pw; } -extern "C" -struct passwd * +extern "C" struct passwd * getpwuid (uid_t uid) { if (!passwd_in_memory_p) @@ -174,8 +173,7 @@ getpwuid (uid_t uid) return search_for (uid, 0); } -extern "C" -struct passwd * +extern "C" struct passwd * getpwnam (const char *name) { if (!passwd_in_memory_p) @@ -184,8 +182,7 @@ getpwnam (const char *name) return search_for (0, name); } -extern "C" -struct passwd * +extern "C" struct passwd * getpwent (void) { if (!passwd_in_memory_p) @@ -197,9 +194,8 @@ getpwent (void) return NULL; } -extern "C" -struct passwd * -getpwduid (uid_t uid) +extern "C" struct passwd * +getpwduid (uid_t) { if (!passwd_in_memory_p) read_etc_passwd(); @@ -207,8 +203,7 @@ getpwduid (uid_t uid) return NULL; } -extern "C" -void +extern "C" void setpwent (void) { if (!passwd_in_memory_p) @@ -217,8 +212,7 @@ setpwent (void) pw_pos = 0; } -extern "C" -void +extern "C" void endpwent (void) { if (!passwd_in_memory_p) @@ -227,8 +221,7 @@ endpwent (void) pw_pos = 0; } -extern "C" -int +extern "C" int setpassent () { if (!passwd_in_memory_p) @@ -237,8 +230,7 @@ setpassent () return 0; } -extern "C" -char * +extern "C" char * getpass (const char * prompt) { #ifdef _MT_SAFE diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 8fcfb4633..4613c63af 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2061,7 +2061,7 @@ has_suffix (const char *path, const suffix_info *suffixes) return NULL; } -static int __inline +static __inline__ int next_suffix (char *ext_here, const suffix_info *&suffixes) { if (!suffixes) diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index 3c0efccae..f0ab684b2 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -27,6 +27,7 @@ enum symlink_follow enum { + PATH_NOTHING = 0, PATH_SYMLINK = 1, PATH_BINARY = MOUNT_BINARY, PATH_EXEC = MOUNT_EXEC, @@ -51,8 +52,8 @@ class path_conv void set_binary () {path_flags |= PATH_BINARY;} void set_symlink () {path_flags |= PATH_SYMLINK;} - void set_exec (int x = 1) {path_flags |= x ? PATH_EXEC : 0;} - void set_has_acls (int x = 1) {path_flags |= x ? PATH_HASACLS : 0;} + void set_exec (int x = 1) {path_flags |= x ? PATH_EXEC : PATH_NOTHING;} + void set_has_acls (int x = 1) {path_flags |= x ? PATH_HASACLS : PATH_NOTHING;} char *known_suffix; @@ -66,7 +67,7 @@ class path_conv int use_full_path = 0, const suffix_info *suffixes = NULL); inline char *get_win32 () { return path; } BOOL is_device () {return devn != FH_BAD;} - DWORD get_devn () {return devn == FH_BAD ? FH_DISK : devn;} + DWORD get_devn () {return devn == FH_BAD ? (DWORD) FH_DISK : devn;} short get_unitn () {return devn == FH_BAD ? 0 : unit;} DWORD file_attributes () {return fileattr;} }; diff --git a/winsup/cygwin/regexp/regexp.c b/winsup/cygwin/regexp/regexp.c index 2f848655e..a20f8160a 100644 --- a/winsup/cygwin/regexp/regexp.c +++ b/winsup/cygwin/regexp/regexp.c @@ -278,7 +278,7 @@ const char *exp; longest = NULL; len = 0; for (; scan != NULL; scan = regnext(scan)) - if (OP(scan) == EXACTLY && strlen(OPERAND(scan)) >= len) { + if (OP(scan) == EXACTLY && (int) strlen(OPERAND(scan)) >= len) { longest = OPERAND(scan); len = strlen(OPERAND(scan)); } diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index df62f1a7d..6778fb20b 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -1782,7 +1782,7 @@ int acecmp (const void *a1, const void *a2) extern "C" int -aclsort (int nentries, int calclass, aclent_t *aclbufp) +aclsort (int nentries, int, aclent_t *aclbufp) { if (aclcheck (aclbufp, nentries, NULL)) return -1; @@ -1975,7 +1975,7 @@ permfromstr (char *perm) extern "C" aclent_t * -aclfromtext (char *acltextp, int *aclcnt) +aclfromtext (char *acltextp, int *) { if (!acltextp) { diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 84518e1b2..69f1ec9e1 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -371,8 +371,7 @@ set_bits (select_record *me, fd_set *readfds, fd_set *writefds, } static int -verify_true (select_record *me, fd_set *readfds, fd_set *writefds, - fd_set *exceptfds) +verify_true (select_record *, fd_set *, fd_set *, fd_set *) { return 1; } @@ -385,7 +384,7 @@ verify_ok (select_record *me, fd_set *readfds, fd_set *writefds, } static int -no_startup (select_record *me, select_stuff *stuff) +no_startup (select_record *, select_stuff *) { return 1; } @@ -522,7 +521,7 @@ start_thread_pipe (select_record *me, select_stuff *stuff) } static void -pipe_cleanup (select_record *me, select_stuff *stuff) +pipe_cleanup (select_record *, select_stuff *stuff) { pipeinf *pi = (pipeinf *)stuff->device_specific[FHDEVN(FH_PIPE)]; if (pi && pi->thread) @@ -902,7 +901,7 @@ start_thread_serial (select_record *me, select_stuff *stuff) } static void -serial_cleanup (select_record *me, select_stuff *stuff) +serial_cleanup (select_record *, select_stuff *stuff) { serialinf *si = (serialinf *)stuff->device_specific[FHDEVN(FH_SERIAL)]; if (si && si->thread) @@ -1225,7 +1224,7 @@ err: } void -socket_cleanup (select_record *me, select_stuff *stuff) +socket_cleanup (select_record *, select_stuff *stuff) { socketinf *si = (socketinf *)stuff->device_specific[FHDEVN(FH_SOCKET)]; select_printf ("si %p si->thread %p", si, si ? si->thread : NULL); diff --git a/winsup/cygwin/shared.h b/winsup/cygwin/shared.h index 036ca8815..100eb2a15 100644 --- a/winsup/cygwin/shared.h +++ b/winsup/cygwin/shared.h @@ -530,12 +530,13 @@ extern int __stdcall set_console_state_for_spawn (); void __stdcall shared_init (void); void __stdcall shared_terminate (void); -/* This is for programs that want to access the shared data. */ -extern "C" class shared_info *cygwin_getshared (void); - char *__stdcall shared_name (const char *, int); void *__stdcall open_shared (const char *name, HANDLE &shared_h, DWORD size, void *addr); +extern "C" { +/* This is for programs that want to access the shared data. */ +class shared_info *cygwin_getshared (void); + struct cygwin_version_info { unsigned short api_major; @@ -545,8 +546,9 @@ struct cygwin_version_info unsigned short shared_data; unsigned short mount_registry; const char *dll_build_date; - const char shared_id[sizeof (CYGWIN_VERSION_DLL_IDENTIFIER) + 64]; + char shared_id[sizeof (CYGWIN_VERSION_DLL_IDENTIFIER) + 64]; }; +} extern cygwin_version_info cygwin_version; extern const char *cygwin_version_strings; diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 97a0f3a35..b4bd1ef1e 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -108,7 +108,7 @@ int NO_COPY pending_signals = 0; // TRUE if signals pending /* Functions */ static int __stdcall checkstate (waitq *); -static BOOL __inline get_proc_lock (DWORD, DWORD); +static __inline__ BOOL get_proc_lock (DWORD, DWORD); static HANDLE __stdcall getsem (pinfo *, const char *, int, int); static void __stdcall remove_child (int); static void __stdcall remove_zombie (int); @@ -992,7 +992,7 @@ getsem (pinfo *p, const char *str, int init, int max) * Attempt to handle case where process is exiting as we try to grab * the mutex. */ -static BOOL __inline +static __inline__ BOOL get_proc_lock (DWORD what, DWORD val) { Static int lastwhat = -1; @@ -1123,7 +1123,7 @@ stopped_or_terminated (waitq *parent_w, pinfo *child) * has been handled, as per POSIX. */ static DWORD WINAPI -wait_sig (VOID *arg) +wait_sig (VOID *) { /* Initialization */ (void) SetThreadPriority (hwait_sig, WAIT_SIG_PRIORITY); @@ -1292,7 +1292,7 @@ wait_sig (VOID *arg) /* Wait for subprocesses to terminate. Executes in a separate thread. */ static DWORD WINAPI -wait_subproc (VOID *arg) +wait_subproc (VOID *) { sip_printf ("starting"); int errloop = 0; diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc index d66d9c7b2..742feaed1 100644 --- a/winsup/cygwin/strace.cc +++ b/winsup/cygwin/strace.cc @@ -183,7 +183,7 @@ strace_printf (unsigned category, const char *fmt,...) } void __stdcall -mark (const char *fn, int i) +mark (const char *, int) { } diff --git a/winsup/cygwin/sync.h b/winsup/cygwin/sync.h index 18cff7800..37efbe54f 100644 --- a/winsup/cygwin/sync.h +++ b/winsup/cygwin/sync.h @@ -21,8 +21,8 @@ class muto DWORD tid; /* Thread Id of lock owner. */ public: void *operator new (size_t, void *p) {return p;} - void *operator new (size_t n) {return ::new muto; } - void operator delete (void *p) {;} /* can't handle allocated mutos + void *operator new (size_t) {return ::new muto; } + void operator delete (void *) {;} /* can't handle allocated mutos currently */ /* This simple constructor is used for cases where no bruteforce diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 650f71566..922206ad6 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -149,7 +149,7 @@ setsid (void) } static int -read_handler (int fd, void *ptr, size_t len, int blocksigs) +read_handler (int fd, void *ptr, size_t len) { int res; fhandler_base *fh = dtable[fd]; @@ -169,7 +169,7 @@ read_handler (int fd, void *ptr, size_t len, int blocksigs) /* Check to see if this is a background read from a "tty", sending a SIGTTIN, if appropriate */ - res = fh->bg_check (SIGTTIN, blocksigs); + res = fh->bg_check (SIGTTIN); if (res > 0) { myself->process_state |= PID_TTYIN; @@ -198,11 +198,11 @@ _read (int fd, void *ptr, size_t len) fh->get_r_no_interrupt ()) { debug_printf ("non-interruptible read\n"); - return read_handler (fd, ptr, len, 0); + return read_handler (fd, ptr, len); } if (fh->ready_for_read (fd, INFINITE, 0)) - return read_handler (fd, ptr, len, 1); + return read_handler (fd, ptr, len); set_sig_errno (EINTR); syscall_printf ("%d = read (%d<%s>, %p, %d), errno %d", -1, fd, fh->get_name (), @@ -232,7 +232,7 @@ _write (int fd, const void *ptr, size_t len) fhandler_base *fh; fh = dtable[fd]; - res = fh->bg_check (SIGTTOU, 0); + res = fh->bg_check (SIGTTOU); if (res > 0) { myself->process_state |= PID_TTYOU; diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc index 567d9a806..336196d39 100644 --- a/winsup/cygwin/window.cc +++ b/winsup/cygwin/window.cc @@ -63,7 +63,7 @@ WndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) static HANDLE window_started; static DWORD WINAPI -Winmain (VOID *arg) +Winmain (VOID *) { MSG msg; WNDCLASS wc;