gcc-6: error: left shift of negative value [-Werror=shift-negative-value]

This commit is contained in:
Alam Ed Arias 2016-05-28 21:23:09 -04:00
parent 35b254feaa
commit 4956be2bd4
1 changed files with 1 additions and 1 deletions

View File

@ -466,7 +466,7 @@ static boolean SOCK_cmpaddr(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
UINT32 bitmask = INADDR_NONE;
if (mask && mask < 32)
bitmask = htonl(-1 << (32 - mask));
bitmask = htonl((UINT32)(-1) << (32 - mask));
if (b->any.sa_family == AF_INET)
return (a->ip4.sin_addr.s_addr & bitmask) == (b->ip4.sin_addr.s_addr & bitmask)