Changeset - r28335:7107f9cc6900
[Not reviewed]
master
0 5 0
Rubidium - 4 months ago 2023-12-25 23:24:59
rubidium@openttd.org
Codechange: replace NULL with nullptr
5 files changed with 16 insertions and 16 deletions:
0 comments (0 inline, 0 general)
src/network/core/http_winhttp.cpp
Show inline comments
 
@@ -67,7 +67,7 @@ static std::string GetLastErrorAsString(
 
	DWORD error_code = GetLastError();
 

	
 
	if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS, GetModuleHandleA("winhttp.dll"), error_code,
 
		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buffer, sizeof(buffer), NULL) == 0) {
 
		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buffer, sizeof(buffer), nullptr) == 0) {
 
		return fmt::format("unknown error {}", error_code);
 
	}
 

	
src/network/core/os_abstraction.cpp
Show inline comments
 
@@ -81,8 +81,8 @@ const std::string &NetworkError::AsStrin
 
	if (this->message.empty()) {
 
#if defined(_WIN32)
 
		char buffer[512];
 
		if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, this->error,
 
			MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buffer, sizeof(buffer), NULL) == 0) {
 
		if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, this->error,
 
			MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buffer, sizeof(buffer), nullptr) == 0) {
 
			this->message.assign(fmt::format("Unknown error {}", this->error));
 
		} else {
 
			this->message.assign(buffer);
src/video/cocoa/cocoa_v.mm
Show inline comments
 
@@ -664,7 +664,7 @@ void VideoDriver_CocoaQuartz::AllocateBa
 
		kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host
 
	);
 

	
 
	assert(this->cgcontext != NULL);
 
	assert(this->cgcontext != nullptr);
 
	CGContextSetShouldAntialias(this->cgcontext, FALSE);
 
	CGContextSetAllowsAntialiasing(this->cgcontext, FALSE);
 
	CGContextSetInterpolationQuality(this->cgcontext, kCGInterpolationNone);
src/video/cocoa/cocoa_wnd.mm
Show inline comments
 
@@ -929,16 +929,16 @@ void CocoaDialog(const char *title, cons
 

	
 
	NSString *s = [ aString isKindOfClass:[ NSAttributedString class ] ] ? [ aString string ] : (NSString *)aString;
 

	
 
	const char *insert_point = NULL;
 
	const char *replace_range = NULL;
 
	const char *insert_point = nullptr;
 
	const char *replace_range = nullptr;
 
	if (replacementRange.location != NSNotFound) {
 
		/* Calculate the part to be replaced. */
 
		insert_point = Utf8AdvanceByUtf16Units(_focused_window->GetFocusedTextbuf()->GetText(), replacementRange.location);
 
		replace_range = Utf8AdvanceByUtf16Units(insert_point, replacementRange.length);
 
	}
 

	
 
	HandleTextInput(NULL, true);
 
	HandleTextInput([ s UTF8String ], false, NULL, insert_point, replace_range);
 
	HandleTextInput(nullptr, true);
 
	HandleTextInput([ s UTF8String ], false, nullptr, insert_point, replace_range);
 
}
 

	
 
/** Insert the given text at the caret. */
 
@@ -955,9 +955,9 @@ void CocoaDialog(const char *title, cons
 
	NSString *s = [ aString isKindOfClass:[ NSAttributedString class ] ] ? [ aString string ] : (NSString *)aString;
 

	
 
	const char *utf8 = [ s UTF8String ];
 
	if (utf8 != NULL) {
 
		const char *insert_point = NULL;
 
		const char *replace_range = NULL;
 
	if (utf8 != nullptr) {
 
		const char *insert_point = nullptr;
 
		const char *replace_range = nullptr;
 
		if (replacementRange.location != NSNotFound) {
 
			/* Calculate the part to be replaced. */
 
			NSRange marked = [ self markedRange ];
src/video/win32_v.cpp
Show inline comments
 
@@ -275,7 +275,7 @@ static bool DrawIMECompositionString()
 
static void SetCompositionPos(HWND hwnd)
 
{
 
	HIMC hIMC = ImmGetContext(hwnd);
 
	if (hIMC != NULL) {
 
	if (hIMC != nullptr) {
 
		COMPOSITIONFORM cf;
 
		cf.dwStyle = CFS_POINT;
 

	
 
@@ -297,7 +297,7 @@ static void SetCompositionPos(HWND hwnd)
 
static void SetCandidatePos(HWND hwnd)
 
{
 
	HIMC hIMC = ImmGetContext(hwnd);
 
	if (hIMC != NULL) {
 
	if (hIMC != nullptr) {
 
		CANDIDATEFORM cf;
 
		cf.dwIndex = 0;
 
		cf.dwStyle = CFS_EXCLUDE;
 
@@ -332,7 +332,7 @@ static LRESULT HandleIMEComposition(HWND
 
{
 
	HIMC hIMC = ImmGetContext(hwnd);
 

	
 
	if (hIMC != NULL) {
 
	if (hIMC != nullptr) {
 
		if (lParam & GCS_RESULTSTR) {
 
			/* Read result string from the IME. */
 
			LONG len = ImmGetCompositionString(hIMC, GCS_RESULTSTR, nullptr, 0); // Length is always in bytes, even in UNICODE build.
 
@@ -391,7 +391,7 @@ static LRESULT HandleIMEComposition(HWND
 
static void CancelIMEComposition(HWND hwnd)
 
{
 
	HIMC hIMC = ImmGetContext(hwnd);
 
	if (hIMC != NULL) ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
 
	if (hIMC != nullptr) ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
 
	ImmReleaseContext(hwnd, hIMC);
 
	/* Clear any marked string from the current edit box. */
 
	HandleTextInput(nullptr, true);
 
@@ -688,7 +688,7 @@ LRESULT CALLBACK WndProcGdi(HWND hwnd, U
 
			/* Resize the window to match the new DPI setting. */
 
			RECT *prcNewWindow = (RECT *)lParam;
 
			SetWindowPos(hwnd,
 
				NULL,
 
				nullptr,
 
				prcNewWindow->left,
 
				prcNewWindow->top,
 
				prcNewWindow->right - prcNewWindow->left,
0 comments (0 inline, 0 general)