Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-09-11 08:58:45 +0400
committerChristopher Faylor <me@cgf.cx>2008-09-11 08:58:45 +0400
commit81ba2b77dee701a135e6f075f1798a76a41bbad7 (patch)
treea7910496d900a004028eddcf815a6eaf657798a6
parente3cbf1cc486e0771bf6ee2ebec4d38cebcf9e0d3 (diff)
* net.cc (in6addr_any, in6addr_loopback): Add appropriate number of braces
around initializer. (dup_ent): Try harder to coerce the first argument to deal with more stringent compiler. (get_2k_ifs): Remove extraneous typedef. (get_2k_ifs): Reorganize expression to avoid a compiler warning. (get_xp_ifs): Ditto. (get_nt_ifs): Ditto.
-rw-r--r--winsup/cygwin/ChangeLog11
-rw-r--r--winsup/cygwin/mount.cc2
-rw-r--r--winsup/cygwin/net.cc16
3 files changed, 20 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f2b30de75..35bf5361f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,16 @@
2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
+ * net.cc (in6addr_any, in6addr_loopback): Add appropriate number of
+ braces around initializer.
+ (dup_ent): Try harder to coerce the first argument to deal with more
+ stringent compiler.
+ (get_2k_ifs): Remove extraneous typedef.
+ (get_2k_ifs): Reorganize expression to avoid a compiler warning.
+ (get_xp_ifs): Ditto.
+ (get_nt_ifs): Ditto.
+
+2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
+
* fhandler.h (fhandler_pipe::raw_read): Remove __stdcall decoration.
* pipe.cc (fhandler_pipe::raw_read): Ditto.
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 03b6ff80c..2ba459956 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -606,7 +606,7 @@ inline char *
conv_fstab_spaces (char *field)
{
register char *sp = field;
- while (sp = strstr (sp, "\\040"))
+ while ((sp = strstr (sp, "\\040")) != NULL)
{
*sp++ = ' ';
memmove (sp, sp + 3, strlen (sp + 3) + 1);
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 09194ce8b..5ed7b3f4e 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -54,8 +54,8 @@ extern "C"
const char *cygwin_inet_ntop (int, const void *, char *, socklen_t);
} /* End of "C" section */
-const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
-const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
+const struct in6_addr in6addr_any = {{IN6ADDR_ANY_INIT}};
+const struct in6_addr in6addr_loopback = {{IN6ADDR_LOOPBACK_INIT}};
static fhandler_socket *
get (const int fd)
@@ -322,7 +322,8 @@ static const char *entnames[] = {"host", "proto", "serv"};
The 'unionent' struct is a union of all of the currently used
*ent structure. */
-#define dup_ent(old, src, type) __dup_ent ((unionent *&) (_my_tls.locals.old), (unionent *) (src), type)
+/* FIXME: Use an overloaded function or template here. */
+#define dup_ent(old, src, type) __dup_ent ((unionent *&) *((unionent *) _my_tls.locals.old), (unionent *) (src), type)
#ifdef DEBUGGING
static void *
#else
@@ -1426,7 +1427,7 @@ get_xp_ifs (ULONG family)
if_sin = (struct sockaddr_in *) &ifp->ifa_brddstaddr;
uint32_t mask =
((struct sockaddr_in *) &ifp->ifa_netmask)->sin_addr.s_addr;
- if_sin->sin_addr.s_addr = sin->sin_addr.s_addr & mask | ~mask;
+ if_sin->sin_addr.s_addr = (sin->sin_addr.s_addr & mask) | ~mask;
if_sin->sin_family = AF_INET;
ifp->ifa_ifa.ifa_broadaddr = (struct sockaddr *)
&ifp->ifa_brddstaddr;
@@ -1489,7 +1490,7 @@ get_2k_ifs ()
struct ifall *ifret = NULL, *ifp = NULL;
struct sockaddr_in *if_sin;
- typedef struct ifcount_t
+ struct ifcount_t
{
DWORD ifIndex;
size_t count;
@@ -1636,8 +1637,7 @@ get_2k_ifs ()
if_sin->sin_addr.s_addr = ipt->table[ip_cnt].dwBCastAddr;
#else
uint32_t mask = ipt->table[ip_cnt].dwMask;
- if_sin->sin_addr.s_addr = ipt->table[ip_cnt].dwAddr
- & mask | ~mask;
+ if_sin->sin_addr.s_addr = (ipt->table[ip_cnt].dwAddr & mask) | ~mask;
#endif
ifp->ifa_ifa.ifa_broadaddr = (struct sockaddr *)
&ifp->ifa_brddstaddr;
@@ -1889,7 +1889,7 @@ get_nt_ifs ()
lip = cygwin_inet_addr (dhcp ? dhcpaddress : ip);
lnp = cygwin_inet_addr (dhcp ? dhcpnetmask : np);
sin = (struct sockaddr_in *) &ifp->ifa_brddstaddr;
- sin->sin_addr.s_addr = lip & lnp | ~lnp;
+ sin->sin_addr.s_addr = (lip & lnp) | ~lnp;
sin->sin_family = AF_INET;
ifp->ifa_ifa.ifa_broadaddr = (struct sockaddr *)
&ifp->ifa_brddstaddr;