11//
22// IPAddress.cpp
33//
4- // $Id: //poco/Main/Net/src/IPAddress.cpp#15 $
4+ // $Id: //poco/Main/Net/src/IPAddress.cpp#16 $
55//
66// Library: Net
77// Package: NetCore
4040#include " Poco/NumberFormatter.h"
4141#include " Poco/Types.h"
4242#include < algorithm>
43- #include < string.h >
43+ #include < cstring >
4444
4545
4646using Poco::RefCountedObject;
@@ -103,12 +103,12 @@ class IPv4AddressImpl: public IPAddressImpl
103103public:
104104 IPv4AddressImpl ()
105105 {
106- memset (&_addr, 0 , sizeof (_addr));
106+ std:: memset (&_addr, 0 , sizeof (_addr));
107107 }
108108
109109 IPv4AddressImpl (const void * addr)
110110 {
111- memcpy (&_addr, addr, sizeof (_addr));
111+ std:: memcpy (&_addr, addr, sizeof (_addr));
112112 }
113113
114114 std::string toString () const
@@ -260,12 +260,12 @@ class IPv6AddressImpl: public IPAddressImpl
260260public:
261261 IPv6AddressImpl ()
262262 {
263- memset (&_addr, 0 , sizeof (_addr));
263+ std:: memset (&_addr, 0 , sizeof (_addr));
264264 }
265265
266266 IPv6AddressImpl (const void * addr)
267267 {
268- memcpy (&_addr, addr, sizeof (_addr));
268+ std:: memcpy (&_addr, addr, sizeof (_addr));
269269 }
270270
271271 std::string toString () const
@@ -426,7 +426,7 @@ class IPv6AddressImpl: public IPAddressImpl
426426#if defined(_WIN32)
427427 struct addrinfo * pAI;
428428 struct addrinfo hints;
429- memset (&hints, 0 , sizeof (hints));
429+ std:: memset (&hints, 0 , sizeof (hints));
430430 hints.ai_flags = AI_NUMERICHOST;
431431 int rc = getaddrinfo (addr.c_str (), NULL , &hints, &pAI);
432432 if (rc == 0 )
@@ -651,7 +651,7 @@ bool IPAddress::operator == (const IPAddress& a) const
651651 poco_socklen_t l1 = length ();
652652 poco_socklen_t l2 = a.length ();
653653 if (l1 == l2)
654- return memcmp (addr (), a.addr (), l1) == 0 ;
654+ return std:: memcmp (addr (), a.addr (), l1) == 0 ;
655655 else
656656 return false ;
657657}
@@ -662,7 +662,7 @@ bool IPAddress::operator != (const IPAddress& a) const
662662 poco_socklen_t l1 = length ();
663663 poco_socklen_t l2 = a.length ();
664664 if (l1 == l2)
665- return memcmp (addr (), a.addr (), l1) != 0 ;
665+ return std:: memcmp (addr (), a.addr (), l1) != 0 ;
666666 else
667667 return true ;
668668}
@@ -673,7 +673,7 @@ bool IPAddress::operator < (const IPAddress& a) const
673673 poco_socklen_t l1 = length ();
674674 poco_socklen_t l2 = a.length ();
675675 if (l1 == l2)
676- return memcmp (addr (), a.addr (), l1) < 0 ;
676+ return std:: memcmp (addr (), a.addr (), l1) < 0 ;
677677 else
678678 return l1 < l2;
679679}
@@ -684,7 +684,7 @@ bool IPAddress::operator <= (const IPAddress& a) const
684684 poco_socklen_t l1 = length ();
685685 poco_socklen_t l2 = a.length ();
686686 if (l1 == l2)
687- return memcmp (addr (), a.addr (), l1) <= 0 ;
687+ return std:: memcmp (addr (), a.addr (), l1) <= 0 ;
688688 else
689689 return l1 < l2;
690690}
@@ -695,7 +695,7 @@ bool IPAddress::operator > (const IPAddress& a) const
695695 poco_socklen_t l1 = length ();
696696 poco_socklen_t l2 = a.length ();
697697 if (l1 == l2)
698- return memcmp (addr (), a.addr (), l1) > 0 ;
698+ return std:: memcmp (addr (), a.addr (), l1) > 0 ;
699699 else
700700 return l1 > l2;
701701}
@@ -706,7 +706,7 @@ bool IPAddress::operator >= (const IPAddress& a) const
706706 poco_socklen_t l1 = length ();
707707 poco_socklen_t l2 = a.length ();
708708 if (l1 == l2)
709- return memcmp (addr (), a.addr (), l1) >= 0 ;
709+ return std:: memcmp (addr (), a.addr (), l1) >= 0 ;
710710 else
711711 return l1 > l2;
712712}
0 commit comments