Replace NULL with nullptr in C++ files

This commit is contained in:
Gymnasiast
2018-01-29 17:06:01 +01:00
committed by Richard Jenkins
parent 6bd0b2baea
commit 5cc21fd21b
26 changed files with 184 additions and 184 deletions

View File

@@ -92,7 +92,7 @@ void large_scenery_paint(paint_session * session, uint8 direction, uint16 height
Ride *get_ride(int index) {
if (index < 0 || index >= MAX_RIDES) {
log_error("invalid index %d for ride", index);
return NULL;
return nullptr;
}
return &gRideList[index];
}
@@ -100,7 +100,7 @@ Ride *get_ride(int index) {
rct_ride_entry *get_ride_entry(int index) {
if (index < 0 || index >= object_entry_group_counts[OBJECT_TYPE_RIDE]) {
log_error("invalid index %d for ride type", index);
return NULL;
return nullptr;
}
return gRideEntries[index];
@@ -108,7 +108,7 @@ rct_ride_entry *get_ride_entry(int index) {
rct_ride_entry *get_ride_entry_by_ride(Ride *ride) {
rct_ride_entry * type = get_ride_entry(ride->subtype);
if (type == NULL) {
if (type == nullptr) {
log_error("Invalid ride subtype for ride");
}
return type;
@@ -138,7 +138,7 @@ int tile_element_get_direction_with_offset(const rct_tile_element *element, uint
rct_tile_element *map_get_first_element_at(int x, int y) {
if (x < 0 || y < 0 || x > 255 || y > 255) {
log_error("Trying to access element outside of range");
return NULL;
return nullptr;
}
return gTileElementTilePointers[x + y * 256];
}

View File

@@ -45,11 +45,11 @@ namespace Utils {
bool rideSupportsTrackType(uint8 rideType, uint8 trackType) {
TRACK_PAINT_FUNCTION_GETTER newPaintGetter = RideTypeTrackPaintFunctions[rideType];
if (newPaintGetter == NULL) {
if (newPaintGetter == nullptr) {
return false;
}
if (newPaintGetter(trackType, 0) == NULL) {
if (newPaintGetter(trackType, 0) == nullptr) {
return false;
}

View File

@@ -1046,7 +1046,7 @@ private:
}
}
WriteLine(1, "}");
WriteLine(1, "return NULL;");
WriteLine(1, "return nullptr;");
WriteLine(0, "}");
}

View File

@@ -101,7 +101,7 @@ static const char* GetAnsiColorCode(CLIColour color) {
case GREEN: return "2";
case YELLOW:
return "3";
default: return NULL;
default: return nullptr;
};
}
@@ -189,7 +189,7 @@ int main(int argc, char *argv[]);
#define OPENRCT2_DLL_MODULE_NAME "openrct2.dll"
static HMODULE _dllModule = NULL;
static HMODULE _dllModule = nullptr;
utf8 *utf8_write_codepoint(utf8 *dst, uint32 codepoint)
{
@@ -256,7 +256,7 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
__declspec(dllexport) int StartOpenRCT(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
if (_dllModule == NULL) {
if (_dllModule == nullptr) {
_dllModule = GetModuleHandleA(OPENRCT2_DLL_MODULE_NAME);
}