Integrate C++11 branch into 5_1-new
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include "RageThreads.h"
|
||||
#include "RageTimer.h"
|
||||
#include "RageUtil.h"
|
||||
#include "Foreach.h"
|
||||
|
||||
|
||||
#if defined(WINDOWS)
|
||||
#include <windows.h>
|
||||
@@ -158,7 +158,7 @@ NetworkStream *CreateNetworkStream()
|
||||
WSADATA WSAData;
|
||||
WORD iVersionRequested = MAKEWORD(2,0);
|
||||
if( WSAStartup(iVersionRequested, &WSAData) != 0 )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return new NetworkStream_Win32;
|
||||
@@ -170,11 +170,11 @@ NetworkStream_Win32::NetworkStream_Win32():
|
||||
{
|
||||
m_iPort = -1;
|
||||
m_State = STATE_IDLE;
|
||||
m_Socket = NULL;
|
||||
m_Socket = nullptr;
|
||||
#if defined(WINDOWS)
|
||||
m_hResolve = NULL;
|
||||
m_hResolveHwnd = NULL;
|
||||
m_hCompletionEvent = CreateEvent( NULL, true, false, NULL );
|
||||
m_hResolve = nullptr;
|
||||
m_hResolveHwnd = nullptr;
|
||||
m_hCompletionEvent = CreateEvent( nullptr, true, false, nullptr );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ void NetworkStream_Win32::Open( const RString &sHost, int iPort, ConnectionType
|
||||
m_iPort = iPort;
|
||||
|
||||
// Look up the hostname.
|
||||
hostent *pHost = NULL;
|
||||
hostent *pHost = nullptr;
|
||||
char pBuf[MAXGETHOSTSTRUCT];
|
||||
{
|
||||
pHost = (hostent *) pBuf;
|
||||
@@ -374,8 +374,8 @@ void NetworkStream_Win32::Open( const RString &sHost, int iPort, ConnectionType
|
||||
mw.Run();
|
||||
|
||||
m_Mutex.Lock();
|
||||
m_hResolve = NULL;
|
||||
m_hResolveHwnd = NULL;
|
||||
m_hResolve = nullptr;
|
||||
m_hResolveHwnd = nullptr;
|
||||
if( m_State == STATE_CANCELLED )
|
||||
{
|
||||
m_Mutex.Unlock();
|
||||
@@ -475,7 +475,7 @@ void NetworkStream_Win32::Cancel()
|
||||
m_State = STATE_CANCELLED;
|
||||
|
||||
// If resolving, abort the resolve.
|
||||
if( m_hResolve != NULL )
|
||||
if( m_hResolve != nullptr )
|
||||
{
|
||||
/* When we cancel the request, no message at all will be sent to the window,
|
||||
* so we need to do it ourself to inform it that it was cancelled. Be sure
|
||||
@@ -588,18 +588,18 @@ void NetworkPostData::CreateMimeData( const map<RString,RString> &mapNameToData,
|
||||
while(1)
|
||||
{
|
||||
sMimeBoundaryOut = ssprintf( "--%08i", rand() );
|
||||
FOREACHM_CONST( RString, RString, mapNameToData, d )
|
||||
if( d->second.find(sMimeBoundaryOut) != RString::npos )
|
||||
for (auto const &d : mapNameToData)
|
||||
if( d.second.find(sMimeBoundaryOut) != RString::npos )
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
FOREACHM_CONST( RString, RString, mapNameToData, d )
|
||||
for (auto const &d : mapNameToData)
|
||||
{
|
||||
sOut += "--" + sMimeBoundaryOut + "\r\n";
|
||||
sOut += ssprintf( "Content-Disposition: form-data; name=\"%s\"\r\n", d->first.c_str() );
|
||||
sOut += ssprintf( "Content-Disposition: form-data; name=\"%s\"\r\n", d.first.c_str() );
|
||||
sOut += "\r\n";
|
||||
sOut += d->second;
|
||||
sOut += d.second;
|
||||
sOut += "\r\n";
|
||||
}
|
||||
if( sOut.size() )
|
||||
|
||||
Reference in New Issue
Block a user