From: Christopher Faylor Date: Thu, 11 Sep 2008 05:43:11 +0000 (+0000) Subject: * localtime.cc (increment_overflow): Mark as non-inline to prevent compiler X-Git-Tag: multiprocess-20081120-branchpoint~113 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=cb7e1879ee3a55c91b8c85e6d2f879f392a2c995;p=newlib-cygwin.git * localtime.cc (increment_overflow): Mark as non-inline to prevent compiler from complaining about the very thing we're trying to test. * ntea.cc (read_ea): Reorganize to avoid a new compiler warning/error. * sched.cc (sched_rr_get_interval): Ditto. * select.cc (peek_serial): Ditto. * libc/rexec.cc (ruserpass): Ditto. * posix_ipc.cc (ipc_names): Make static to avoid a compiler warning (and it's the right thing to do anyway). --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 35bf5361f..fbd17fad3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,14 @@ +2008-09-11 Christopher Faylor + + * localtime.cc (increment_overflow): Mark as non-inline to prevent + compiler from complaining about the very thing we're trying to test. + * ntea.cc (read_ea): Reorganize to avoid a new compiler warning/error. + * sched.cc (sched_rr_get_interval): Ditto. + * select.cc (peek_serial): Ditto. + * libc/rexec.cc (ruserpass): Ditto. + * posix_ipc.cc (ipc_names): Make static to avoid a compiler warning + (and it's the right thing to do anyway). + 2008-09-11 Christopher Faylor * net.cc (in6addr_any, in6addr_loopback): Add appropriate number of diff --git a/winsup/cygwin/libc/rexec.cc b/winsup/cygwin/libc/rexec.cc index 99d76f68c..ca253f83e 100644 --- a/winsup/cygwin/libc/rexec.cc +++ b/winsup/cygwin/libc/rexec.cc @@ -206,7 +206,7 @@ next: while ((t = token()) && t != MACH && t != DEFAULT) switch(t) { case LOGIN: - if (token()) + if (token()) { if (*aname == 0) { *aname = (char *) malloc((unsigned) strlen(tokval) + 1); (void) strcpy(*aname, tokval); @@ -214,6 +214,7 @@ next: if (strcmp(*aname, tokval)) goto next; } + } break; case PASSWD: if ((*aname == 0 || strcmp(*aname, "anonymous")) && diff --git a/winsup/cygwin/localtime.cc b/winsup/cygwin/localtime.cc index d5f3622ec..3d5b29c46 100644 --- a/winsup/cygwin/localtime.cc +++ b/winsup/cygwin/localtime.cc @@ -1788,7 +1788,8 @@ ctime_r(const time_t *timep, char *buf) ** Simplified normalize logic courtesy Paul Eggert (eggert@twinsun.com). */ -static int +/* Mark as noinline to prevent a compiler warning. */ +static int __attribute__((noinline)) increment_overflow(int *number, int delta) { int number0; diff --git a/winsup/cygwin/ntea.cc b/winsup/cygwin/ntea.cc index e64dc4d99..5b4ec3b53 100644 --- a/winsup/cygwin/ntea.cc +++ b/winsup/cygwin/ntea.cc @@ -65,14 +65,15 @@ read_ea (HANDLE hdl, path_conv &pc, const char *name, char *value, size_t size) /* Samba hides the user namespace from Windows clients. If we try to retrieve a user namespace item, we remove the leading namespace from the name, otherwise the search fails. */ - if (pc.fs_is_samba ()) - if (ascii_strncasematch (name, "user.", 5)) - name += 5; - else - { - set_errno (ENOATTR); - goto out; - } + if (!pc.fs_is_samba ()) + /* nothing to do */; + else if (ascii_strncasematch (name, "user.", 5)) + name += 5; + else + { + set_errno (ENOATTR); + goto out; + } if ((nlen = strlen (name)) >= MAX_EA_NAME_LEN) { diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc index 53b887493..693b65498 100644 --- a/winsup/cygwin/posix_ipc.cc +++ b/winsup/cygwin/posix_ipc.cc @@ -26,7 +26,7 @@ details. */ /* The prefix_len is the length of the path prefix ncluding trailing "/" (or "/sem." for semaphores) as well as the trailing NUL. */ -struct +static struct { const char *prefix; const size_t prefix_len; diff --git a/winsup/cygwin/sched.cc b/winsup/cygwin/sched.cc index d894bf051..08f96833b 100644 --- a/winsup/cygwin/sched.cc +++ b/winsup/cygwin/sched.cc @@ -295,7 +295,7 @@ sched_rr_get_interval (pid_t pid, struct timespec *interval) qindex = 0; vfindex = ((prisep >> 2) & 3) % 3; if (vfindex == 0) - vfindex = wincap.is_server () || prisep & 3 == 0 ? 1 : 0; + vfindex = wincap.is_server () || (prisep & 3) == 0 ? 1 : 0; else vfindex -= 1; slindex = ((prisep >> 4) & 3) % 3; diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc index 6ce8e617c..753f8319d 100644 --- a/winsup/cygwin/sec_helper.cc +++ b/winsup/cygwin/sec_helper.cc @@ -140,7 +140,7 @@ PSID cygsid::get_sid (DWORD s, DWORD cnt, DWORD *r, bool well_known) { DWORD i; - SID_IDENTIFIER_AUTHORITY sid_auth = {0,0,0,0,0,0}; + SID_IDENTIFIER_AUTHORITY sid_auth = {{0,0,0,0,0,0}}; if (s > 255 || cnt < 1 || cnt > 8) { diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 48c6eeb3a..eceeeafcb 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -921,7 +921,7 @@ peek_serial (select_record *s, bool) set_handle_or_return_if_not_open (h, s); int ready = 0; - if (s->read_selected && s->read_ready || (s->write_selected && s->write_ready)) + if ((s->read_selected && s->read_ready) || (s->write_selected && s->write_ready)) { select_printf ("already ready"); ready = 1;