<rdar://problem/7344760> Fix compiler warnings when building mDNSResponder for AirPort
authorcheshire@apple.com <cheshire@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Wed, 25 Nov 2009 00:31:00 +0000 (00:31 +0000)
committercheshire@apple.com <cheshire@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Wed, 25 Nov 2009 00:31:00 +0000 (00:31 +0000)
git-svn-id: http://svn.macosforge.org/repository/mDNSResponder/trunk@6854 214c2c4a-bf3b-4dcf-9390-e4dd3010487d

mDNSMacOSX/daemon.c
mDNSMacOSX/helper.c
mDNSMacOSX/mDNSMacOSX.c
mDNSShared/dnssd_clientstub.c

index 1aacb4c..b6b2449 100644 (file)
@@ -35,6 +35,8 @@
 #include <mach/mach_error.h>
 #include <servers/bootstrap.h>
 #include <sys/types.h>
+#include <errno.h>
+#include <signal.h>
 #include <unistd.h>
 #include <paths.h>
 #include <fcntl.h>
index 06e37f6..efaf0e5 100644 (file)
 #include <netinet6/nd6.h>
 #include <netinet6/ipsec.h>
 #include <sys/ioctl.h>
+#include <sys/param.h>
 #include <sys/socket.h>
 #include <asl.h>
 #include <ctype.h>
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <signal.h>
 #include <stdarg.h>
 #include <stdbool.h>
 #include <string.h>
index 71cfe08..5377f63 100644 (file)
@@ -1882,7 +1882,7 @@ mDNSlocal void GetUserSpecifiedLocalHostName(domainlabel *const namelabel)
 mDNSexport mDNSBool DictionaryIsEnabled(CFDictionaryRef dict)
        {
        mDNSs32 val;
-       CFNumberRef state = CFDictionaryGetValue(dict, CFSTR("Enabled"));
+       CFNumberRef state = (CFNumberRef)CFDictionaryGetValue(dict, CFSTR("Enabled"));
        if (!state) return mDNSfalse;
        if (!CFNumberGetValue(state, kCFNumberSInt32Type, &val))
                { LogMsg("ERROR: DictionaryIsEnabled - CFNumberGetValue"); return mDNSfalse; }
@@ -3632,7 +3632,7 @@ mDNSexport void mDNSPlatformSetDNSConfig(mDNS *const m, mDNSBool setservers, mDN
                                        CFArrayRef values = CFDictionaryGetValue(dict, kSCPropNetDNSServerAddresses);
                                        if (values)
                                                {
-                                               LogInfo("DNS Server Address values: %d", CFArrayGetCount(values));
+                                               LogInfo("DNS Server Address values: %d", (int)CFArrayGetCount(values));
                                                for (i = 0; i < CFArrayGetCount(values); i++)
                                                        {
                                                        CFStringRef s = CFArrayGetValueAtIndex(values, i);
index b3a078a..5f45142 100644 (file)
@@ -150,7 +150,8 @@ static int write_all(dnssd_sock_t sd, char *buf, size_t len)
                        {
                        // Should never happen. If it does, it indicates some OS bug,
                        // or that the mDNSResponder daemon crashed (which should never happen).
-                       syslog(LOG_WARNING, "dnssd_clientstub write_all(%d) failed %ld/%d %d %s", sd, num_written, len,
+                       syslog(LOG_WARNING, "dnssd_clientstub write_all(%d) failed %ld/%ld %d %s", sd,
+                               (long)num_written, (long)len,
                                (num_written < 0) ? dnssd_errno                 : 0,
                                (num_written < 0) ? dnssd_strerror(dnssd_errno) : "");
                        return -1;
@@ -176,7 +177,8 @@ static int read_all(dnssd_sock_t sd, char *buf, int len)
                        {
                        // Should never happen. If it does, it indicates some OS bug,
                        // or that the mDNSResponder daemon crashed (which should never happen).
-                       syslog(LOG_WARNING, "dnssd_clientstub read_all(%d) failed %ld/%d %d %s", sd, num_read, len,
+                       syslog(LOG_WARNING, "dnssd_clientstub read_all(%d) failed %ld/%ld %d %s", sd,
+                               (long)num_read, (long)len,
                                (num_read < 0) ? dnssd_errno                 : 0,
                                (num_read < 0) ? dnssd_strerror(dnssd_errno) : "");
                        return (num_read < 0 && dnssd_errno == dnssd_EWOULDBLOCK) ? read_all_wouldblock : read_all_fail;