Pull variable declarations to beginning of blocks to fix compile errors when building...
authorsherscher@apple.com <sherscher@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Tue, 17 Nov 2009 21:36:30 +0000 (21:36 +0000)
committersherscher@apple.com <sherscher@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Tue, 17 Nov 2009 21:36:30 +0000 (21:36 +0000)
git-svn-id: http://svn.macosforge.org/repository/mDNSResponder/trunk@6799 214c2c4a-bf3b-4dcf-9390-e4dd3010487d

mDNSCore/mDNS.c
mDNSCore/uDNS.c

index e932d4a..d7055a1 100755 (executable)
@@ -4909,6 +4909,7 @@ mDNSlocal void mDNSCoreReceiveResponse(mDNS *const m,
        int firstadditional = firstauthority  + response->h.numAuthorities;
        int totalrecords    = firstadditional + response->h.numAdditionals;
        const mDNSu8 *ptr   = response->data;
+       DNSServer *uDNSServer = mDNSNULL;
 
        debugf("Received Response from %#-15a addressed to %#-15a on %p with "
                "%2d Question%s %2d Answer%s %2d Authorit%s %2d Additional%s %d bytes LLQType %d",
@@ -5000,7 +5001,6 @@ mDNSlocal void mDNSCoreReceiveResponse(mDNS *const m,
                        }
                }
 
-       DNSServer *uDNSServer = mDNSNULL;
        for (i = 0; i < totalrecords && ptr && ptr < end; i++)
                {
                // All responses sent via LL multicast are acceptable for caching
@@ -6013,9 +6013,9 @@ mDNSinline mDNSs32 PenaltyTimeForServer(mDNS *m, DNSServer *server)
 // Return the next server to "prev" if it is a match and unpenalized
 mDNSlocal DNSServer *GetNextUnPenalizedServer(mDNS *m, DNSServer *prev, mDNSInterfaceID InterfaceID)
        {
-       (void)InterfaceID; //unused
        int curmatchlen = -1;
        DNSServer *curr = m->DNSServers;
+       (void)InterfaceID; //unused
 
        if (prev == mDNSNULL) return mDNSNULL;
 
@@ -6102,12 +6102,12 @@ mDNSlocal int BetterMatchForName(const domainname *name, int namecount, const do
 // that will come out of the penalty box soon
 mDNSlocal DNSServer *GetAnyBestServer(mDNS *m, const domainname *name, mDNSInterfaceID InterfaceID)
        {
-       (void)InterfaceID; //unused
        DNSServer *curmatch = mDNSNULL;
        int bestmatchlen = -1, namecount = name ? CountLabels(name) : 0;
        DNSServer *curr;
        mDNSs32 bestPenaltyTime;
        int bettermatch;
+       (void)InterfaceID; //unused
 
        bestmatchlen = -1;
        bestPenaltyTime = DNSSERVER_PENALTY_TIME + 1;
index 6019e40..c57b8ab 100755 (executable)
@@ -1121,6 +1121,7 @@ mDNSlocal void tcpCallback(TCPSocket *sock, void *context, mDNSBool ConnectionEs
                        mDNSu8     *end   = (mDNSu8 *)tcpInfo->reply + tcpInfo->replylen;
                        mDNSAddr    Addr  = tcpInfo->Addr;
                        mDNSIPPort  Port  = tcpInfo->Port;
+                       mDNSIPPort srcPort = zeroIPPort;
                        tcpInfo->numReplies++;
                        tcpInfo->reply    = mDNSNULL;   // Detach reply buffer from tcpInfo_t, to make sure client callback can't cause it to be disposed
                        tcpInfo->nread    = 0;
@@ -1132,7 +1133,6 @@ mDNSlocal void tcpCallback(TCPSocket *sock, void *context, mDNSBool ConnectionEs
                        // If we clear the tcp pointer in the question, mDNSCoreReceiveResponse cannot find a matching question. Hence
                        // we store the minimal information i.e., the source port of the connection in the question itself.
                        
-                       mDNSIPPort srcPort = zeroIPPort;
 
                        if (q && q->tcp) srcPort = q->tcp->SrcPort;
                        if (backpointer)