Apply patch #5745: Fix "Constant is long" warnings with 16bit

compilers.  Contributed by avatar@mmlab.cse.yzu.edu.tw
This commit is contained in:
kieranm
2007-04-11 13:32:41 +00:00
parent 712a22e18c
commit 05909d6fa7
6 changed files with 26 additions and 21 deletions

View File

@@ -434,7 +434,7 @@ inet_aton(const char *cp, struct in_addr *addr)
break;
case 2: /* a.b -- 8.24 bits */
if (val > 0xffffff)
if (val > 0xffffffUL)
return (0);
val |= parts[0] << 24;
break;
@@ -524,8 +524,8 @@ htonl(u32_t n)
{
return ((n & 0xff) << 24) |
((n & 0xff00) << 8) |
((n & 0xff0000) >> 8) |
((n & 0xff000000) >> 24);
((n & 0xff0000UL) >> 8) |
((n & 0xff000000UL) >> 24);
}
u32_t