mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-10-05 20:13:29 -04:00
newer standards prefer nullptr over NULL - this is most of them but there are others too
This commit is contained in:
@@ -97,7 +97,7 @@ void Os::installCommon(void)
|
||||
mainThreadId = pthread_self();
|
||||
|
||||
// get the name of the executable
|
||||
//Can't find UNIX call for this: DWORD result = GetModuleFileName(NULL, programName, sizeof(programName));
|
||||
//Can't find UNIX call for this: DWORD result = GetModuleFileName(nullptr, programName, sizeof(programName));
|
||||
strcpy(programName, "TempName");
|
||||
DWORD result = 1;
|
||||
|
||||
@@ -119,7 +119,7 @@ void Os::installCommon(void)
|
||||
char buffer[512];
|
||||
while (!feof(f))
|
||||
{
|
||||
if (fgets(buffer, 512, f) != NULL) {
|
||||
if (fgets(buffer, 512, f) != nullptr) {
|
||||
if (strncmp(buffer, "processor\t: ", 12)==0)
|
||||
{
|
||||
processorCount = atoi(buffer+12)+1;
|
||||
@@ -165,13 +165,13 @@ void Os::abort(void)
|
||||
if (!isMainThread())
|
||||
{
|
||||
threadDied = true;
|
||||
pthread_exit(NULL);
|
||||
pthread_exit(nullptr);
|
||||
}
|
||||
|
||||
if (!shouldReturnFromAbort)
|
||||
{
|
||||
// let the C runtime deal with the abnormal termination
|
||||
int * dummy = NULL;
|
||||
int * dummy = nullptr;
|
||||
int forceCrash = *dummy;
|
||||
UNREF(forceCrash);
|
||||
for (;;)
|
||||
@@ -256,14 +256,14 @@ bool Os::writeFile(const char *fileName, const void *data, int length) // Le
|
||||
DWORD written;
|
||||
|
||||
// open the file for writing
|
||||
handle = CreateFile(fileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
handle = CreateFile(fileName, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
|
||||
// check if it was opened
|
||||
if (handle == INVALID_HANDLE_VALUE)
|
||||
return false;
|
||||
|
||||
// attempt to write the data
|
||||
result = WriteFile(handle, data, static_cast<DWORD>(length), &written, NULL);
|
||||
result = WriteFile(handle, data, static_cast<DWORD>(length), &written, nullptr);
|
||||
|
||||
// make sure the data was written okay
|
||||
if (!result || written != static_cast<DWORD>(length))
|
||||
|
||||
Reference in New Issue
Block a user