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.
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)
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
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;
struct ifall *ifret = NULL, *ifp = NULL;
struct sockaddr_in *if_sin;
- typedef struct ifcount_t
+ struct ifcount_t
{
DWORD ifIndex;
size_t count;
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;
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;