From: Amos Jeffries Date: Wed, 4 Apr 2012 22:16:12 +0000 (+1200) Subject: Bug 3527: EUI compile errors on Mac OS X 10.5.8 PPC X-Git-Tag: BumpSslServerFirst.take08~7^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9461a7bf70c670af64ee46c09cb467d3dce3a8c5;p=thirdparty%2Fsquid.git Bug 3527: EUI compile errors on Mac OS X 10.5.8 PPC --- diff --git a/src/eui/Eui48.cc b/src/eui/Eui48.cc index b05f8c3fe3..2176108880 100644 --- a/src/eui/Eui48.cc +++ b/src/eui/Eui48.cc @@ -158,9 +158,7 @@ Eui::Eui48::encode(char *buf, const int len) bool Eui::Eui48::lookup(const Ip::Address &c) { - struct arpreq arpReq; #if !_SQUID_WINDOWS_ - struct sockaddr_in *sa = NULL; #endif /* !_SQUID_WINDOWS_ */ Ip::Address ipAddr = c; @@ -192,9 +190,10 @@ Eui::Eui48::lookup(const Ip::Address &c) /* * Set up structures for ARP lookup with blank interface name */ + struct arpreq arpReq; memset(&arpReq, '\0', sizeof(arpReq)); - sa = (sockaddr_in*)&arpReq.arp_pa; + struct sockaddr_in *sa = static_cast(&arpReq.arp_pa); ipAddr.GetSockAddr(*sa); /* Query ARP table */ @@ -316,10 +315,10 @@ Eui::Eui48::lookup(const Ip::Address &c) int tmpSocket = socket(AF_INET,SOCK_STREAM,0); /* Set up structures for ARP lookup with blank interface name */ - + struct arpreq arpReq; memset(&arpReq, '\0', sizeof(arpReq)); - sa = (sockaddr_in*)&arpReq.arp_pa; + struct sockaddr_in *sa = static_cast(&arpReq.arp_pa); ipAddr.GetSockAddr(*sa); /* Query ARP table */ @@ -368,10 +367,10 @@ Eui::Eui48::lookup(const Ip::Address &c) /* * Set up structures for ARP lookup with blank interface name */ - + struct arpreq arpReq; memset(&arpReq, '\0', sizeof(arpReq)); - sa = (struct sockaddr_in*) &arpReq.arp_pa; + struct sockaddr_in *sa = static_cast(&arpReq.arp_pa); ipAddr.GetSockAddr(*sa); /* Query ARP table */ @@ -460,6 +459,7 @@ Eui::Eui48::lookup(const Ip::Address &c) DWORD i; + struct arpreq arpReq; memset(&arpReq, '\0', sizeof(arpReq)); /* Get size of Windows ARP table */