diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/YAMN/src/proto/netlib.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/YAMN/src/proto/netlib.cpp')
-rw-r--r-- | plugins/YAMN/src/proto/netlib.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/YAMN/src/proto/netlib.cpp b/plugins/YAMN/src/proto/netlib.cpp index 24485fe871..7e4227ad91 100644 --- a/plugins/YAMN/src/proto/netlib.cpp +++ b/plugins/YAMN/src/proto/netlib.cpp @@ -10,7 +10,7 @@ //--------------------------------------------------------------------------------------------------
BOOL SSLLoaded = FALSE;
-HNETLIBUSER hNetlibUser = NULL;
+HNETLIBUSER hNetlibUser = nullptr;
void __stdcall SSL_DebugLog(const char *fmt, ...)
{
@@ -67,7 +67,7 @@ void CNLClient::SSLify() throw(DWORD) #ifdef DEBUG_COMM
SSL_DebugLog("Staring netlib core SSL");
#endif
- if (Netlib_StartSsl(hConnection, NULL)) {
+ if (Netlib_StartSsl(hConnection, nullptr)) {
#ifdef DEBUG_COMM
SSL_DebugLog("Netlib core SSL started");
#endif
@@ -97,7 +97,7 @@ void CNLClient::Connect(const char* servername, const int port) throw(DWORD) nloc.szHost = servername;
nloc.wPort = port;
nloc.flags = 0;
- if (NULL == (hConnection = Netlib_OpenConnection(hNetlibUser, &nloc))) {
+ if (nullptr == (hConnection = Netlib_OpenConnection(hNetlibUser, &nloc))) {
SystemError = WSAGetLastError();
throw NetworkError = (DWORD)ENL_CONNECT;
}
@@ -125,9 +125,9 @@ void CNLClient::Send(const char *query) throw(DWORD) {
unsigned int Sent;
- if (NULL == query)
+ if (nullptr == query)
return;
- if (hConnection == NULL)
+ if (hConnection == nullptr)
return;
#ifdef DEBUG_COMM
DebugLog(CommFile, "<send>%s", query);
@@ -174,9 +174,9 @@ char* CNLClient::Recv(char *buf, int buflen) throw(DWORD) DebugLog(CommFile, "<reading>");
#endif
try {
- if (buf == NULL)
+ if (buf == nullptr)
buf = (char *)malloc(sizeof(char)*(buflen + 1));
- if (buf == NULL)
+ if (buf == nullptr)
throw NetworkError = (DWORD)ENL_RECVALLOC;
if (!isTLSed) {
@@ -224,7 +224,7 @@ char* CNLClient::Recv(char *buf, int buflen) throw(DWORD) void CNLClient::Disconnect()
{
Netlib_CloseHandle(hConnection);
- hConnection = NULL;
+ hConnection = nullptr;
}
//Uninitializes netlib library
@@ -235,7 +235,7 @@ void UnregisterNLClient() #endif
Netlib_CloseHandle(hNetlibUser);
- hNetlibUser = NULL;
+ hNetlibUser = nullptr;
#ifdef DEBUG_COMM
DebugLog(CommFile, "</Unregister PROXY support>\n");
#endif
|