]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use an _actual_ fix for the byte-reverse warning.
authorNick Mathewson <nickm@torproject.org>
Tue, 1 Sep 2009 19:51:09 +0000 (15:51 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 1 Sep 2009 19:51:09 +0000 (15:51 -0400)
(Given that we're pretty much assuming that int is 32 bits, and given that
hex values are always unsigned, taking out the "ul" from 0xff000000 should
be fine.)

src/common/address.c

index 3e0ea25d909d0c4979d781311f323d399cbf7269..2fe013a2cd188af0b776492af101b699fb5d2b0c 100644 (file)
@@ -374,10 +374,10 @@ tor_addr_parse_reverse_lookup_name(tor_addr_t *result, const char *address,
 
     /* reverse the bytes */
     inaddr.s_addr = (uint32_t)
-      (((inaddr.s_addr & 0x000000fful) << 24)
-       |((inaddr.s_addr & 0x0000ff00ul) << 8)
-       |((inaddr.s_addr & 0x00ff0000ul) >> 8)
-       |((inaddr.s_addr & 0xff000000ul) >> 24));
+      (((inaddr.s_addr & 0x000000ff) << 24)
+       |((inaddr.s_addr & 0x0000ff00) << 8)
+       |((inaddr.s_addr & 0x00ff0000) >> 8)
+       |((inaddr.s_addr & 0xff000000) >> 24));
 
     if (result) {
       tor_addr_from_in(result, &inaddr);