]> git.karo-electronics.de Git - mdnsd.git/commitdiff
Cosmetic
authorOle Reinhardt <ole.reinhardt@kernelconcepts.de>
Wed, 1 May 2013 16:43:57 +0000 (18:43 +0200)
committerOle Reinhardt <ole.reinhardt@kernelconcepts.de>
Wed, 1 May 2013 16:43:57 +0000 (18:43 +0200)
mdnsd.c
mhttp.c

diff --git a/mdnsd.c b/mdnsd.c
index 1ef5b85e9db3fcbc91ab2da75d3a129474231fe1..e2da31e8471594a23934850c145160825da505eb 100644 (file)
--- a/mdnsd.c
+++ b/mdnsd.c
 
 static int NameHash(const char *str)
 {
-    const char *name = (const char *)str;
+       /* ELF hash uses uint8_ts and unsigned arithmetic for portability */
+    const uint8_t *name = (uint8_t *)str;
     uint32_t hash = 0;
     uint32_t g;
 
     while (*name) {
         /* do some fancy bitwanking on the string */
         hash = (hash << 4) + (unsigned long)(tolower (*name++));
-        if ((g = (hash & 0xF0000000UL))!=0)
+        if ((g = (hash & 0xF0000000UL))!=0) {
             hash ^= (g >> 24);
+               }
         hash &= ~g;
     }
 
diff --git a/mhttp.c b/mhttp.c
index 4da7ff2b4e8aa4aa0413b65da7c510ba3d7176be..6333163c1df7d86f9d127b0ee1598d38ffa0baf8 100644 (file)
--- a/mhttp.c
+++ b/mhttp.c
@@ -202,7 +202,7 @@ void request_ip_addresses (ServiceInfo *info)
                 info->host_to_ip  = MdnsdAllocUnique(info->mdnsd, hostlocal,
                                                              QTYPE_A, 120, handle_conflict, info);
             }
-            MdnsdSetRaw (info->mdnsd, info->host_to_ip, (uint8_t *) &ip, 4);
+            MdnsdSetRaw (info->mdnsd, info->host_to_ip, (char *) &ip, 4);
 
             if (!info->ip_to_host) {
                 info->ip_to_host  = MdnsdAllocUnique(info->mdnsd, revlookup,