summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-01-11 17:48:15 -0500
committerBernard Normier <bernard@zeroc.com>2017-01-11 17:48:15 -0500
commit05485a47ea107737ada8b0941a7a066c6a075f40 (patch)
tree8bf8a5fee750b20a631f02f60e6db21788ecc14f /cpp
parentMoved UniquePtr to IceInternal (diff)
downloadice-05485a47ea107737ada8b0941a7a066c6a075f40.tar.bz2
ice-05485a47ea107737ada8b0941a7a066c6a075f40.tar.xz
ice-05485a47ea107737ada8b0941a7a066c6a075f40.zip
Replace NULL by ICE_NULLPTR
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/IceUtil/StringUtil.h2
-rwxr-xr-xcpp/src/Ice/Network.cpp20
-rw-r--r--cpp/src/Ice/PropertiesI.cpp6
-rw-r--r--cpp/src/Ice/Selector.cpp6
-rwxr-xr-xcpp/src/Ice/StreamSocket.cpp4
-rwxr-xr-xcpp/src/Ice/TcpAcceptor.cpp6
-rwxr-xr-xcpp/src/Ice/UdpTransceiver.cpp8
-rw-r--r--cpp/src/Ice/ios/StreamAcceptor.cpp2
-rw-r--r--cpp/src/Ice/ios/StreamConnector.cpp6
-rw-r--r--cpp/src/Ice/ios/StreamEndpointI.cpp2
-rw-r--r--cpp/src/Ice/ios/StreamTransceiver.cpp2
-rw-r--r--cpp/src/IceGrid/Activator.cpp24
-rwxr-xr-xcpp/src/IceSSL/Certificate.cpp8
-rwxr-xr-xcpp/src/IceSSL/Util.cpp6
-rw-r--r--cpp/src/IceSSL/Util.h2
-rw-r--r--cpp/src/IceUtil/FileUtil.cpp6
-rw-r--r--cpp/src/IceUtil/StringUtil.cpp8
-rw-r--r--cpp/src/IceUtil/UtilException.cpp2
-rw-r--r--cpp/src/IceXML/Parser.cpp2
-rw-r--r--cpp/src/Slice/Python.cpp2
-rw-r--r--cpp/src/Slice/Ruby.cpp2
-rw-r--r--cpp/src/slice2confluence/ConfluenceOutput.cpp4
-rw-r--r--cpp/src/slice2confluence/Main.cpp2
-rw-r--r--cpp/src/slice2cpp/Main.cpp2
-rw-r--r--cpp/src/slice2cs/Main.cpp2
-rw-r--r--cpp/src/slice2html/Main.cpp2
-rw-r--r--cpp/src/slice2java/Main.cpp2
-rw-r--r--cpp/src/slice2js/Main.cpp2
-rw-r--r--cpp/src/slice2objc/Main.cpp2
-rw-r--r--cpp/src/slice2php/Main.cpp2
-rw-r--r--cpp/test/IceSSL/configuration/AllTests.cpp2
-rw-r--r--cpp/test/IceUtil/stacktrace/Client.cpp2
32 files changed, 75 insertions, 75 deletions
diff --git a/cpp/include/IceUtil/StringUtil.h b/cpp/include/IceUtil/StringUtil.h
index 2c8e2d8b549..43c58d1625a 100644
--- a/cpp/include/IceUtil/StringUtil.h
+++ b/cpp/include/IceUtil/StringUtil.h
@@ -77,7 +77,7 @@ ICE_API bool match(const std::string&, const std::string&, bool = false);
//
ICE_API std::string lastErrorToString();
#ifdef _WIN32
-ICE_API std::string errorToString(int, LPCVOID = NULL);
+ICE_API std::string errorToString(int, LPCVOID = ICE_NULLPTR);
#else
ICE_API std::string errorToString(int);
#endif
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index 95e9a49249d..c89bc020c2a 100755
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -182,7 +182,7 @@ setTcpLoopbackFastPath(SOCKET fd)
DWORD NumberOfBytesReturned = 0;
int status =
- WSAIoctl(fd, SIO_LOOPBACK_FAST_PATH, &OptionValue, sizeof(OptionValue), NULL, 0, &NumberOfBytesReturned, 0, 0);
+ WSAIoctl(fd, SIO_LOOPBACK_FAST_PATH, &OptionValue, sizeof(OptionValue), ICE_NULLPTR, 0, &NumberOfBytesReturned, 0, 0);
if(status == SOCKET_ERROR)
{
// On platforms that do not support fast path (< Windows 8), WSAEONOTSUPP is expected.
@@ -283,16 +283,16 @@ getLocalAddresses(ProtocolSupport protocol, bool includeLoopback)
}
DWORD size;
- DWORD rv = GetAdaptersAddresses(family, 0, NULL, NULL, &size);
+ DWORD rv = GetAdaptersAddresses(family, 0, ICE_NULLPTR, ICE_NULLPTR, &size);
if(rv == ERROR_BUFFER_OVERFLOW)
{
PIP_ADAPTER_ADDRESSES adapter_addresses = (PIP_ADAPTER_ADDRESSES) malloc(size);
- rv = GetAdaptersAddresses(family, 0, NULL, adapter_addresses, &size);
+ rv = GetAdaptersAddresses(family, 0, ICE_NULLPTR, adapter_addresses, &size);
if(rv == ERROR_SUCCESS)
{
- for(PIP_ADAPTER_ADDRESSES aa = adapter_addresses; aa != NULL; aa = aa->Next)
+ for(PIP_ADAPTER_ADDRESSES aa = adapter_addresses; aa != ICE_NULLPTR; aa = aa->Next)
{
- for(PIP_ADAPTER_UNICAST_ADDRESS ua = aa->FirstUnicastAddress; ua != NULL; ua = ua->Next)
+ for(PIP_ADAPTER_UNICAST_ADDRESS ua = aa->FirstUnicastAddress; ua != ICE_NULLPTR; ua = ua->Next)
{
Address addr;
memcpy(&addr.saStorage, ua->Address.lpSockaddr, ua->Address.iSockaddrLength);
@@ -1105,7 +1105,7 @@ IceInternal::getAddresses(const string& host, int port, ProtocolSupport protocol
throw ex;
}
- for(struct addrinfo* p = info; p != NULL; p = p->ai_next)
+ for(struct addrinfo* p = info; p != ICE_NULLPTR; p = p->ai_next)
{
memcpy(&addr.saStorage, p->ai_addr, p->ai_addrlen);
if(p->ai_family == PF_INET)
@@ -2910,7 +2910,7 @@ IceInternal::doConnectAsync(SOCKET fd, const Address& addr, const Address& sourc
throw ex;
}
- LPFN_CONNECTEX ConnectEx = NULL; // a pointer to the 'ConnectEx()' function
+ LPFN_CONNECTEX ConnectEx = ICE_NULLPTR; // a pointer to the 'ConnectEx()' function
GUID GuidConnectEx = WSAID_CONNECTEX; // The Guid
DWORD dwBytes;
if(WSAIoctl(fd,
@@ -2920,8 +2920,8 @@ IceInternal::doConnectAsync(SOCKET fd, const Address& addr, const Address& sourc
&ConnectEx,
sizeof(ConnectEx),
&dwBytes,
- NULL,
- NULL) == SOCKET_ERROR)
+ ICE_NULLPTR,
+ ICE_NULLPTR) == SOCKET_ERROR)
{
SocketException ex(__FILE__, __LINE__);
ex.error = getSocketErrno();
@@ -2985,7 +2985,7 @@ IceInternal::doFinishConnectAsync(SOCKET fd, AsyncInfo& info)
}
}
- if(setsockopt(fd, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0) == SOCKET_ERROR)
+ if(setsockopt(fd, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, ICE_NULLPTR, 0) == SOCKET_ERROR)
{
SocketException ex(__FILE__, __LINE__);
ex.error = getSocketErrno();
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index 27de7af6881..8c77d470e8a 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -319,8 +319,8 @@ Ice::PropertiesI::load(const std::string& file)
DWORD numValues;
try
{
- err = RegQueryInfoKey(iceKey, NULL, NULL, NULL, NULL, NULL, NULL, &numValues, &maxNameSize, &maxDataSize,
- NULL, NULL);
+ err = RegQueryInfoKey(iceKey, ICE_NULLPTR, ICE_NULLPTR, ICE_NULLPTR, ICE_NULLPTR, ICE_NULLPTR, ICE_NULLPTR, &numValues, &maxNameSize, &maxDataSize,
+ ICE_NULLPTR, ICE_NULLPTR);
if(err != ERROR_SUCCESS)
{
InitializationException ex(__FILE__, __LINE__);
@@ -336,7 +336,7 @@ Ice::PropertiesI::load(const std::string& file)
DWORD keyType;
DWORD nameBufSize = static_cast<DWORD>(nameBuf.size());
DWORD dataBufSize = static_cast<DWORD>(dataBuf.size());
- err = RegEnumValueW(iceKey, i, &nameBuf[0], &nameBufSize, NULL, &keyType, &dataBuf[0], &dataBufSize);
+ err = RegEnumValueW(iceKey, i, &nameBuf[0], &nameBufSize, ICE_NULLPTR, &keyType, &dataBuf[0], &dataBufSize);
if(err != ERROR_SUCCESS || nameBufSize == 0)
{
ostringstream os;
diff --git a/cpp/src/Ice/Selector.cpp b/cpp/src/Ice/Selector.cpp
index 41bce57d1c0..e421d7271e1 100644
--- a/cpp/src/Ice/Selector.cpp
+++ b/cpp/src/Ice/Selector.cpp
@@ -49,8 +49,8 @@ Selector::~Selector()
void
Selector::setup(int sizeIO)
{
- _handle = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, sizeIO);
- if(_handle == NULL)
+ _handle = CreateIoCompletionPort(INVALID_HANDLE_VALUE, ICE_NULLPTR, 0, sizeIO);
+ if(_handle == ICE_NULLPTR)
{
Ice::SocketException ex(__FILE__, __LINE__);
ex.error = GetLastError();
@@ -76,7 +76,7 @@ Selector::initialize(EventHandler* handler)
}
#ifdef ICE_USE_IOCP
HANDLE socket = reinterpret_cast<HANDLE>(handler->getNativeInfo()->fd());
- if(CreateIoCompletionPort(socket, _handle, reinterpret_cast<ULONG_PTR>(handler), 0) == NULL)
+ if(CreateIoCompletionPort(socket, _handle, reinterpret_cast<ULONG_PTR>(handler), 0) == ICE_NULLPTR)
{
Ice::SocketException ex(__FILE__, __LINE__);
ex.error = GetLastError();
diff --git a/cpp/src/Ice/StreamSocket.cpp b/cpp/src/Ice/StreamSocket.cpp
index 5b6d6eb36d1..26562b09f3e 100755
--- a/cpp/src/Ice/StreamSocket.cpp
+++ b/cpp/src/Ice/StreamSocket.cpp
@@ -402,7 +402,7 @@ StreamSocket::startWrite(Buffer& buf)
_write.buf.len = static_cast<DWORD>(packetSize);
_write.buf.buf = reinterpret_cast<char*>(&*buf.i);
- int err = WSASend(_fd, &_write.buf, 1, &_write.count, 0, &_write, NULL);
+ int err = WSASend(_fd, &_write.buf, 1, &_write.count, 0, &_write, ICE_NULLPTR);
if(err == SOCKET_ERROR)
{
if(!wouldBlock())
@@ -465,7 +465,7 @@ StreamSocket::startRead(Buffer& buf)
size_t packetSize = getRecvPacketSize(length);
_read.buf.len = static_cast<DWORD>(packetSize);
_read.buf.buf = reinterpret_cast<char*>(&*buf.i);
- int err = WSARecv(_fd, &_read.buf, 1, &_read.count, &_read.flags, &_read, NULL);
+ int err = WSARecv(_fd, &_read.buf, 1, &_read.count, &_read.flags, &_read, ICE_NULLPTR);
if(err == SOCKET_ERROR)
{
if(!wouldBlock())
diff --git a/cpp/src/Ice/TcpAcceptor.cpp b/cpp/src/Ice/TcpAcceptor.cpp
index e601c3418db..3af1acbe40a 100755
--- a/cpp/src/Ice/TcpAcceptor.cpp
+++ b/cpp/src/Ice/TcpAcceptor.cpp
@@ -105,7 +105,7 @@ IceInternal::TcpAcceptor::getAsyncInfo(SocketOperation)
void
IceInternal::TcpAcceptor::startAccept()
{
- LPFN_ACCEPTEX AcceptEx = NULL; // a pointer to the 'AcceptEx()' function
+ LPFN_ACCEPTEX AcceptEx = ICE_NULLPTR; // a pointer to the 'AcceptEx()' function
GUID GuidAcceptEx = WSAID_ACCEPTEX; // The Guid
DWORD dwBytes;
if(WSAIoctl(_fd,
@@ -115,8 +115,8 @@ IceInternal::TcpAcceptor::startAccept()
&AcceptEx,
sizeof(AcceptEx),
&dwBytes,
- NULL,
- NULL) == SOCKET_ERROR)
+ ICE_NULLPTR,
+ ICE_NULLPTR) == SOCKET_ERROR)
{
SocketException ex(__FILE__, __LINE__);
ex.error = getSocketErrno();
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp
index 00c035b557a..6f3ee3540c9 100755
--- a/cpp/src/Ice/UdpTransceiver.cpp
+++ b/cpp/src/Ice/UdpTransceiver.cpp
@@ -503,7 +503,7 @@ IceInternal::UdpTransceiver::startWrite(Buffer& buf)
int err;
if(_state == StateConnected)
{
- err = WSASend(_fd, &_write.buf, 1, &_write.count, 0, &_write, NULL);
+ err = WSASend(_fd, &_write.buf, 1, &_write.count, 0, &_write, ICE_NULLPTR);
}
else
{
@@ -524,7 +524,7 @@ IceInternal::UdpTransceiver::startWrite(Buffer& buf)
throw ex;
}
err = WSASendTo(_fd, &_write.buf, 1, &_write.count, 0, &_peerAddr.sa,
- len, &_write, NULL);
+ len, &_write, ICE_NULLPTR);
}
if(err == SOCKET_ERROR)
@@ -595,7 +595,7 @@ IceInternal::UdpTransceiver::startRead(Buffer& buf)
int err;
if(_state == StateConnected)
{
- err = WSARecv(_fd, &_read.buf, 1, &_read.count, &_read.flags, &_read, NULL);
+ err = WSARecv(_fd, &_read.buf, 1, &_read.count, &_read.flags, &_read, ICE_NULLPTR);
}
else
{
@@ -603,7 +603,7 @@ IceInternal::UdpTransceiver::startRead(Buffer& buf)
_readAddrLen = static_cast<socklen_t>(sizeof(sockaddr_storage));
err = WSARecvFrom(_fd, &_read.buf, 1, &_read.count, &_read.flags,
- &_readAddr.sa, &_readAddrLen, &_read, NULL);
+ &_readAddr.sa, &_readAddrLen, &_read, ICE_NULLPTR);
}
if(err == SOCKET_ERROR)
diff --git a/cpp/src/Ice/ios/StreamAcceptor.cpp b/cpp/src/Ice/ios/StreamAcceptor.cpp
index 8b3ca41041a..bd3e7e88a33 100644
--- a/cpp/src/Ice/ios/StreamAcceptor.cpp
+++ b/cpp/src/Ice/ios/StreamAcceptor.cpp
@@ -72,7 +72,7 @@ IceObjC::StreamAcceptor::accept()
CFWriteStreamRef writeStream = nil;
try
{
- CFStreamCreatePairWithSocket(NULL, fd, &readStream, &writeStream);
+ CFStreamCreatePairWithSocket(ICE_NULLPTR, fd, &readStream, &writeStream);
_instance->setupStreams(readStream, writeStream, true, "");
return new StreamTransceiver(_instance, readStream, writeStream, fd);
}
diff --git a/cpp/src/Ice/ios/StreamConnector.cpp b/cpp/src/Ice/ios/StreamConnector.cpp
index 70b604fc92d..3863e29b63a 100644
--- a/cpp/src/Ice/ios/StreamConnector.cpp
+++ b/cpp/src/Ice/ios/StreamConnector.cpp
@@ -29,10 +29,10 @@ IceObjC::StreamConnector::connect()
CFWriteStreamRef writeStream = nil;
try
{
- CFStringRef h = CFStringCreateWithCString(NULL, _host.c_str(), kCFStringEncodingUTF8);
- CFHostRef host = CFHostCreateWithName(NULL, h);
+ CFStringRef h = CFStringCreateWithCString(ICE_NULLPTR, _host.c_str(), kCFStringEncodingUTF8);
+ CFHostRef host = CFHostCreateWithName(ICE_NULLPTR, h);
CFRelease(h);
- CFStreamCreatePairWithSocketToCFHost(NULL, host, _port, &readStream, &writeStream);
+ CFStreamCreatePairWithSocketToCFHost(ICE_NULLPTR, host, _port, &readStream, &writeStream);
CFRelease(host);
_instance->setupStreams(readStream, writeStream, false, _host);
diff --git a/cpp/src/Ice/ios/StreamEndpointI.cpp b/cpp/src/Ice/ios/StreamEndpointI.cpp
index 676210ee493..5643ee51124 100644
--- a/cpp/src/Ice/ios/StreamEndpointI.cpp
+++ b/cpp/src/Ice/ios/StreamEndpointI.cpp
@@ -49,7 +49,7 @@ namespace
inline CFStringRef
toCFString(const string& s)
{
- return CFStringCreateWithCString(NULL, s.c_str(), kCFStringEncodingUTF8);
+ return CFStringCreateWithCString(ICE_NULLPTR, s.c_str(), kCFStringEncodingUTF8);
}
}
diff --git a/cpp/src/Ice/ios/StreamTransceiver.cpp b/cpp/src/Ice/ios/StreamTransceiver.cpp
index 863428190d1..ba367dccf74 100644
--- a/cpp/src/Ice/ios/StreamTransceiver.cpp
+++ b/cpp/src/Ice/ios/StreamTransceiver.cpp
@@ -240,7 +240,7 @@ IceObjC::StreamTransceiver::initialize(Buffer& readBuffer, Buffer& writeBuffer)
{
if(_error)
{
- CFErrorRef err = NULL;
+ CFErrorRef err = ICE_NULLPTR;
if(CFWriteStreamGetStatus(_writeStream) == kCFStreamStatusError)
{
err = CFWriteStreamCopyError(_writeStream);
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp
index afcca9685e5..7e7224c142e 100644
--- a/cpp/src/IceGrid/Activator.cpp
+++ b/cpp/src/IceGrid/Activator.cpp
@@ -302,13 +302,13 @@ Activator::Activator(const TraceLevelsPtr& traceLevels) :
{
#ifdef _WIN32
_hIntr = CreateEvent(
- NULL, // Security attributes
+ ICE_NULLPTR, // Security attributes
TRUE, // Manual reset
FALSE, // Initial state is nonsignaled
- NULL // Unnamed
+ ICE_NULLPTR // Unnamed
);
- if(_hIntr == NULL)
+ if(_hIntr == ICE_NULLPTR)
{
SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
@@ -337,7 +337,7 @@ Activator::~Activator()
assert(!_thread);
#ifdef _WIN32
- if(_hIntr != NULL)
+ if(_hIntr != ICE_NULLPTR)
{
CloseHandle(_hIntr);
}
@@ -389,7 +389,7 @@ Activator::activate(const string& name,
// IceGrid doesn't support to use string converters, so don't need to use
// any string converter in wstringToString conversions.
//
- if(SearchPathW(NULL, stringToWstring(path).c_str(), ext.c_str(), _MAX_PATH, absbuf, &fPart) == 0)
+ if(SearchPathW(ICE_NULLPTR, stringToWstring(path).c_str(), ext.c_str(), _MAX_PATH, absbuf, &fPart) == 0)
{
if(_traceLevels->activator > 0)
{
@@ -416,7 +416,7 @@ Activator::activate(const string& name,
if(!pwd.empty())
{
wchar_t absbuf[_MAX_PATH];
- if(_wfullpath(absbuf, stringToWstring(pwd).c_str(), _MAX_PATH) == NULL)
+ if(_wfullpath(absbuf, stringToWstring(pwd).c_str(), _MAX_PATH) == ICE_NULLPTR)
{
if(_traceLevels->activator > 0)
{
@@ -505,7 +505,7 @@ Activator::activate(const string& name,
// any string converter in stringToWstring conversions.
//
wstring wpwd = stringToWstring(pwd);
- const wchar_t* dir = !wpwd.empty() ? wpwd.c_str() : NULL;
+ const wchar_t* dir = !wpwd.empty() ? wpwd.c_str() : ICE_NULLPTR;
//
// Make a copy of the command line.
@@ -518,7 +518,7 @@ Activator::activate(const string& name,
// Since Windows is case insensitive wrt environment variables we convert the keys to
// uppercase to ensure matches are found.
//
- const wchar_t* env = NULL;
+ const wchar_t* env = ICE_NULLPTR;
wstring envbuf;
if(!envs.empty())
{
@@ -582,10 +582,10 @@ Activator::activate(const string& name,
PROCESS_INFORMATION pi;
ZeroMemory(&pi, sizeof(pi));
BOOL b = CreateProcessW(
- NULL, // Executable
+ ICE_NULLPTR, // Executable
cmdbuf, // Command line
- NULL, // Process attributes
- NULL, // Thread attributes
+ ICE_NULLPTR, // Process attributes
+ ICE_NULLPTR, // Thread attributes
FALSE, // Do NOT inherit handles
CREATE_NEW_PROCESS_GROUP | CREATE_UNICODE_ENVIRONMENT, // Process creation flags
(LPVOID)env, // Process environment
@@ -981,7 +981,7 @@ Activator::sendSignal(const string& name, int signal)
else if(signal == SIGKILL)
{
HANDLE hnd = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
- if(hnd == NULL)
+ if(hnd == ICE_NULLPTR)
{
SyscallException ex(__FILE__, __LINE__);
ex.error = getSystemErrno();
diff --git a/cpp/src/IceSSL/Certificate.cpp b/cpp/src/IceSSL/Certificate.cpp
index fe0e85aef94..dd15ff928a6 100755
--- a/cpp/src/IceSSL/Certificate.cpp
+++ b/cpp/src/IceSSL/Certificate.cpp
@@ -1129,8 +1129,8 @@ Certificate::load(const string& file)
throw CertificateReadException(__FILE__, __LINE__, "error opening file");
}
- X509CertificateRef x = PEM_read_bio_X509_AUX(cert, NULL, NULL, NULL);
- if(x == NULL)
+ X509CertificateRef x = PEM_read_bio_X509_AUX(cert, ICE_NULLPTR, ICE_NULLPTR, ICE_NULLPTR);
+ if(x == ICE_NULLPTR)
{
BIO_free(cert);
throw CertificateReadException(__FILE__, __LINE__, "error reading file:\n" + getSslErrors(false));
@@ -1218,8 +1218,8 @@ Certificate::decode(const string& encoding)
return ICE_MAKE_SHARED(Certificate, cert);
#elif defined(ICE_USE_OPENSSL)
BIO *cert = BIO_new_mem_buf(static_cast<void*>(const_cast<char*>(&encoding[0])), static_cast<int>(encoding.size()));
- X509CertificateRef x = PEM_read_bio_X509_AUX(cert, NULL, NULL, NULL);
- if(x == NULL)
+ X509CertificateRef x = PEM_read_bio_X509_AUX(cert, ICE_NULLPTR, ICE_NULLPTR, ICE_NULLPTR);
+ if(x == ICE_NULLPTR)
{
BIO_free(cert);
throw CertificateEncodingException(__FILE__, __LINE__, getSslErrors(false));
diff --git a/cpp/src/IceSSL/Util.cpp b/cpp/src/IceSSL/Util.cpp
index 5a0f815b12d..26608354fa2 100755
--- a/cpp/src/IceSSL/Util.cpp
+++ b/cpp/src/IceSSL/Util.cpp
@@ -556,7 +556,7 @@ IceSSL::getSslErrors(bool verbose)
else
{
const char* reason = ERR_reason_error_string(err);
- ostr << (reason == NULL ? "unknown reason" : reason);
+ ostr << (reason == ICE_NULLPTR ? "unknown reason" : reason);
if(flags & ERR_TXT_STRING)
{
ostr << ": " << data;
@@ -622,7 +622,7 @@ IceSSL::fromCFString(CFStringRef v)
CFDictionaryRef
IceSSL::getCertificateProperty(SecCertificateRef cert, CFTypeRef key)
{
- CFArrayRef keys = CFArrayCreate(NULL, &key , 1, &kCFTypeArrayCallBacks);
+ CFArrayRef keys = CFArrayCreate(ICE_NULLPTR, &key , 1, &kCFTypeArrayCallBacks);
CFErrorRef err = 0;
CFDictionaryRef values = SecCertificateCopyValues(cert, keys, &err);
CFRelease(keys);
@@ -1409,7 +1409,7 @@ IceSSL::findCertificateChain(const std::string& keychainPath, const std::string&
err = SecItemCopyMatching(query.get(), (CFTypeRef*)&identity);
if(err == noErr)
{
- SecCertificateRef cert2 = NULL;
+ SecCertificateRef cert2 = ICE_NULLPTR;
if((err = SecIdentityCopyCertificate(identity, &cert2)) == noErr)
{
err = CFEqual(cert2, cert) ? noErr : errSecItemNotFound;
diff --git a/cpp/src/IceSSL/Util.h b/cpp/src/IceSSL/Util.h
index fc6af1020cc..3208452366c 100644
--- a/cpp/src/IceSSL/Util.h
+++ b/cpp/src/IceSSL/Util.h
@@ -175,7 +175,7 @@ std::string fromCFString(CFStringRef);
inline CFStringRef
toCFString(const std::string& s)
{
- return CFStringCreateWithCString(NULL, s.c_str(), kCFStringEncodingUTF8);
+ return CFStringCreateWithCString(ICE_NULLPTR, s.c_str(), kCFStringEncodingUTF8);
}
std::string errorToString(CFErrorRef);
diff --git a/cpp/src/IceUtil/FileUtil.cpp b/cpp/src/IceUtil/FileUtil.cpp
index 6c7203d7c87..8ddef052585 100644
--- a/cpp/src/IceUtil/FileUtil.cpp
+++ b/cpp/src/IceUtil/FileUtil.cpp
@@ -254,7 +254,7 @@ IceUtilInternal::getcwd(string& cwd)
// from Windows API.
//
wchar_t cwdbuf[_MAX_PATH];
- if(_wgetcwd(cwdbuf, _MAX_PATH) == NULL)
+ if(_wgetcwd(cwdbuf, _MAX_PATH) == ICE_NULLPTR)
{
return -1;
}
@@ -293,7 +293,7 @@ IceUtilInternal::FileLock::FileLock(const std::string& path) :
//
#ifndef ICE_OS_UWP
_fd = ::CreateFileW(stringToWstring(path, IceUtil::getProcessStringConverter()).c_str(),
- GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ GENERIC_WRITE, 0, ICE_NULLPTR, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, ICE_NULLPTR);
#else
CREATEFILE2_EXTENDED_PARAMETERS params;
params.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
@@ -411,7 +411,7 @@ int
IceUtilInternal::getcwd(string& cwd)
{
char cwdbuf[PATH_MAX];
- if(::getcwd(cwdbuf, PATH_MAX) == NULL)
+ if(::getcwd(cwdbuf, PATH_MAX) == ICE_NULLPTR)
{
return -1;
}
diff --git a/cpp/src/IceUtil/StringUtil.cpp b/cpp/src/IceUtil/StringUtil.cpp
index 6c87d8d7148..5ed73e29faf 100644
--- a/cpp/src/IceUtil/StringUtil.cpp
+++ b/cpp/src/IceUtil/StringUtil.cpp
@@ -826,13 +826,13 @@ IceUtilInternal::errorToString(int error, LPCVOID source)
stored = FormatMessageW(
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS |
- (source != NULL ? FORMAT_MESSAGE_FROM_HMODULE : 0),
+ (source != ICE_NULLPTR ? FORMAT_MESSAGE_FROM_HMODULE : 0),
source,
error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
const_cast<wchar_t*>(lpMsgBuf.data()),
static_cast<int>(lpMsgBuf.size()),
- NULL);
+ ICE_NULLPTR);
if(stored == 0)
{
@@ -864,13 +864,13 @@ IceUtilInternal::errorToString(int error, LPCVOID source)
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS |
- (source != NULL ? FORMAT_MESSAGE_FROM_HMODULE : 0),
+ (source != ICE_NULLPTR ? FORMAT_MESSAGE_FROM_HMODULE : 0),
source,
error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
reinterpret_cast<LPWSTR>(&msg),
0,
- NULL);
+ ICE_NULLPTR);
#endif
if(stored > 0)
diff --git a/cpp/src/IceUtil/UtilException.cpp b/cpp/src/IceUtil/UtilException.cpp
index eb416b268ac..e87c764154c 100644
--- a/cpp/src/IceUtil/UtilException.cpp
+++ b/cpp/src/IceUtil/UtilException.cpp
@@ -391,7 +391,7 @@ getStackTrace(const vector<void*>& stackFrames)
"startHook",
&myModule);
//
- // If GetModuleHandleEx fails, myModule is NULL, i.e. we'll locate the current exe's directory.
+ // If GetModuleHandleEx fails, myModule is ICE_NULLPTR, i.e. we'll locate the current exe's directory.
//
TCHAR myFilename[MAX_PATH];
diff --git a/cpp/src/IceXML/Parser.cpp b/cpp/src/IceXML/Parser.cpp
index 180545bea67..3525e9b4e99 100644
--- a/cpp/src/IceXML/Parser.cpp
+++ b/cpp/src/IceXML/Parser.cpp
@@ -409,7 +409,7 @@ IceXML::Parser::parse(const string& file, Handler& handler) // The given filenam
void
IceXML::Parser::parse(istream& in, Handler& handler)
{
- XML_Parser parser = XML_ParserCreate(NULL);
+ XML_Parser parser = XML_ParserCreate(ICE_NULLPTR);
CallbackData cb;
cb.parser = parser;
cb.handler = &handler;
diff --git a/cpp/src/Slice/Python.cpp b/cpp/src/Slice/Python.cpp
index 6080c23d3c0..bc1da962d70 100644
--- a/cpp/src/Slice/Python.cpp
+++ b/cpp/src/Slice/Python.cpp
@@ -588,7 +588,7 @@ Slice::Python::compile(const vector<string>& argv)
if(preprocess)
{
char buf[4096];
- while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != ICE_NULLPTR)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/Slice/Ruby.cpp b/cpp/src/Slice/Ruby.cpp
index d53fc353b5a..7861bcb8c0b 100644
--- a/cpp/src/Slice/Ruby.cpp
+++ b/cpp/src/Slice/Ruby.cpp
@@ -248,7 +248,7 @@ Slice::Ruby::compile(const vector<string>& argv)
if(preprocess)
{
char buf[4096];
- while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != ICE_NULLPTR)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2confluence/ConfluenceOutput.cpp b/cpp/src/slice2confluence/ConfluenceOutput.cpp
index cac2dc645e4..0c2135d869c 100644
--- a/cpp/src/slice2confluence/ConfluenceOutput.cpp
+++ b/cpp/src/slice2confluence/ConfluenceOutput.cpp
@@ -138,7 +138,7 @@ Confluence::ConfluenceOutput::escapeComment(string comment)
// For each position of a found escape character
while(pos != string::npos)
{
- pair<unsigned int,unsigned int> *region = NULL;
+ pair<unsigned int,unsigned int> *region = ICE_NULLPTR;
// Is this pos in an escaped section?
for(list<pair<unsigned int,unsigned int> >::iterator i = escaperLimits.begin(); i != escaperLimits.end();
@@ -151,7 +151,7 @@ Confluence::ConfluenceOutput::escapeComment(string comment)
}
}
- if(region == NULL)
+ if(region == ICE_NULLPTR)
{
comment.replace(pos, c.size(), replacement);
pos = comment.find(c, pos + replacement.size());
diff --git a/cpp/src/slice2confluence/Main.cpp b/cpp/src/slice2confluence/Main.cpp
index 38a38ff8d87..8eeca1c303b 100644
--- a/cpp/src/slice2confluence/Main.cpp
+++ b/cpp/src/slice2confluence/Main.cpp
@@ -283,7 +283,7 @@ compile(const vector<string>& argv)
if(preprocess)
{
char buf[4096];
- while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != ICE_NULLPTR)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index c082b103c06..7378da1b118 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -297,7 +297,7 @@ compile(const vector<string>& argv)
if(preprocess)
{
char buf[4096];
- while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != ICE_NULLPTR)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2cs/Main.cpp b/cpp/src/slice2cs/Main.cpp
index f4b3e009a68..21738ba6f83 100644
--- a/cpp/src/slice2cs/Main.cpp
+++ b/cpp/src/slice2cs/Main.cpp
@@ -278,7 +278,7 @@ compile(const vector<string>& argv)
if(preprocess)
{
char buf[4096];
- while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != ICE_NULLPTR)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2html/Main.cpp b/cpp/src/slice2html/Main.cpp
index 012f4bffb61..ae2bfaa75ff 100644
--- a/cpp/src/slice2html/Main.cpp
+++ b/cpp/src/slice2html/Main.cpp
@@ -255,7 +255,7 @@ compile(const vector<string>& argv)
if(preprocess)
{
char buf[4096];
- while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != ICE_NULLPTR)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp
index 27845a76994..86b07bf60d5 100644
--- a/cpp/src/slice2java/Main.cpp
+++ b/cpp/src/slice2java/Main.cpp
@@ -316,7 +316,7 @@ compile(const vector<string>& argv)
if(preprocess)
{
char buf[4096];
- while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != ICE_NULLPTR)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2js/Main.cpp b/cpp/src/slice2js/Main.cpp
index 158e31efd00..a73738fcee9 100644
--- a/cpp/src/slice2js/Main.cpp
+++ b/cpp/src/slice2js/Main.cpp
@@ -302,7 +302,7 @@ compile(const vector<string>& argv)
if(preprocess)
{
char buf[4096];
- while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != ICE_NULLPTR)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2objc/Main.cpp b/cpp/src/slice2objc/Main.cpp
index ed999c32067..24ac096d92c 100644
--- a/cpp/src/slice2objc/Main.cpp
+++ b/cpp/src/slice2objc/Main.cpp
@@ -254,7 +254,7 @@ compile(const vector<string>& argv)
if(preprocess)
{
char buf[4096];
- while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != ICE_NULLPTR)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp
index 312091ecde1..2817fdab3d6 100644
--- a/cpp/src/slice2php/Main.cpp
+++ b/cpp/src/slice2php/Main.cpp
@@ -1726,7 +1726,7 @@ compile(const vector<string>& argv)
if(preprocess)
{
char buf[4096];
- while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != ICE_NULLPTR)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/test/IceSSL/configuration/AllTests.cpp b/cpp/test/IceSSL/configuration/AllTests.cpp
index 0ca99b5224e..573eb4ce66d 100644
--- a/cpp/test/IceSSL/configuration/AllTests.cpp
+++ b/cpp/test/IceSSL/configuration/AllTests.cpp
@@ -657,7 +657,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12)
bool isElCapitanOrGreater = false;
vector<char> s(256);
size_t size = s.size();
- int ret = sysctlbyname("kern.osrelease", &s[0], &size, NULL, 0);
+ int ret = sysctlbyname("kern.osrelease", &s[0], &size, ICE_NULLPTR, 0);
if(ret == 0)
{
// version format is x.y.z
diff --git a/cpp/test/IceUtil/stacktrace/Client.cpp b/cpp/test/IceUtil/stacktrace/Client.cpp
index 3284dc0ee62..ffafedbb9ec 100644
--- a/cpp/test/IceUtil/stacktrace/Client.cpp
+++ b/cpp/test/IceUtil/stacktrace/Client.cpp
@@ -92,7 +92,7 @@ getIceHome()
WCHAR buf[512];
DWORD bufSize = sizeof(buf);
- if(RegQueryValueExW(hKey, L"InstallDir", 0, NULL, (LPBYTE)buf, &bufSize) != ERROR_SUCCESS)
+ if(RegQueryValueExW(hKey, L"InstallDir", 0, ICE_NULLPTR, (LPBYTE)buf, &bufSize) != ERROR_SUCCESS)
{
return "";
}