switch to long tpye for ntohl
Stefan Schuermans

Stefan Schuermans commited on 2012-04-04 22:28:01
Showing 1 changed files, with 8 additions and 8 deletions.

... ...
@@ -6,14 +6,14 @@
6 6
                   ((unsigned short)(n) & 0x00FF) << 8)
7 7
 #define htons(h) (((unsigned short)(h) & 0xFF00) >> 8 | \
8 8
                   ((unsigned short)(h) & 0x00FF) << 8)
9
-#define ntohl(n) (((unsigned int)(n) & 0xFF000000) >> 24 | \
10
-                  ((unsigned int)(n) & 0x00FF0000) >> 8 | \
11
-                  ((unsigned int)(n) & 0x0000FF00) << 8 | \
12
-                  ((unsigned int)(n) & 0x000000FF) << 24)
13
-#define htonl(h) (((unsigned int)(h) & 0xFF000000) >> 24 | \
14
-                  ((unsigned int)(h) & 0x00FF0000) >> 8 | \
15
-                  ((unsigned int)(h) & 0x0000FF00) << 8 | \
16
-                  ((unsigned int)(h) & 0x000000FF) << 24)
9
+#define ntohl(n) (((unsigned long)(n) & 0xFF000000) >> 24 | \
10
+                  ((unsigned long)(n) & 0x00FF0000) >> 8 | \
11
+                  ((unsigned long)(n) & 0x0000FF00) << 8 | \
12
+                  ((unsigned long)(n) & 0x000000FF) << 24)
13
+#define htonl(h) (((unsigned long)(h) & 0xFF000000) >> 24 | \
14
+                  ((unsigned long)(h) & 0x00FF0000) >> 8 | \
15
+                  ((unsigned long)(h) & 0x0000FF00) << 8 | \
16
+                  ((unsigned long)(h) & 0x000000FF) << 24)
17 17
 
18 18
 // comparing MACs and IPs
19 19
 #define mac_eq(a, b) ((a)[0] == (b)[0] && (a)[1] == (b)[1] && \
20 20