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;
}
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,