Changeset - r25707:226494aad20a
[Not reviewed]
master
0 8 0
Rubidium - 3 years ago 2021-06-16 19:12:08
rubidium@openttd.org
Cleanup: use nullptr instead of 0 or NULL
8 files changed with 9 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/main_gui.cpp
Show inline comments
 
@@ -306,13 +306,13 @@ struct MainWindow : Window
 
			case GHK_DELETE_WINDOWS: CloseNonVitalWindows(); break;
 
			case GHK_DELETE_NONVITAL_WINDOWS: CloseAllNonVitalWindows(); break;
 
			case GHK_DELETE_ALL_MESSAGES: DeleteAllMessages(); break;
 
			case GHK_REFRESH_SCREEN: MarkWholeScreenDirty(); break;
 

	
 
			case GHK_CRASH: // Crash the game
 
				*(volatile byte *)0 = 0;
 
				*(volatile byte *)nullptr = 0;
 
				break;
 

	
 
			case GHK_MONEY: // Gimme money
 
				/* You can only cheat for money in singleplayer mode. */
 
				if (!_networking) DoCommandP(0, 10000000, 0, CMD_MONEY_CHEAT);
 
				break;
src/network/core/tcp_connect.cpp
Show inline comments
 
@@ -265,13 +265,13 @@ bool TCPConnecter::CheckActivity()
 
		FD_SET(socket, &write_fd);
 
	}
 

	
 
	timeval tv;
 
	tv.tv_usec = 0;
 
	tv.tv_sec = 0;
 
	int n = select(FD_SETSIZE, NULL, &write_fd, NULL, &tv);
 
	int n = select(FD_SETSIZE, nullptr, &write_fd, nullptr, &tv);
 
	/* select() failed; hopefully next try it doesn't. */
 
	if (n < 0) {
 
		/* select() normally never fails; so hopefully it works next try! */
 
		Debug(net, 1, "select() failed: {}", NetworkError::GetLast().AsString());
 
		return false;
 
	}
src/network/network_command.cpp
Show inline comments
 
@@ -176,13 +176,13 @@ void NetworkSendCommand(TileIndex tile, 
 
 * @param cs The client to sync the queue to.
 
 */
 
void NetworkSyncCommandQueue(NetworkClientSocket *cs)
 
{
 
	for (CommandPacket *p = _local_execution_queue.Peek(); p != nullptr; p = p->next) {
 
		CommandPacket c = *p;
 
		c.callback = 0;
 
		c.callback = nullptr;
 
		cs->outgoing_queue.Append(&c);
 
	}
 
}
 

	
 
/**
 
 * Execute all commands on the local command queue that ought to be executed this frame.
src/newgrf_commons.h
Show inline comments
 
@@ -306,13 +306,13 @@ bool Convert8bitBooleanCallback(const st
 
/**
 
 * Data related to the handling of grf files.
 
 * @tparam Tcnt Number of spritegroups
 
 */
 
template <size_t Tcnt>
 
struct GRFFilePropsBase {
 
	GRFFilePropsBase() : local_id(0), grffile(0)
 
	GRFFilePropsBase() : local_id(0), grffile(nullptr)
 
	{
 
		/* The lack of some compilers to provide default constructors complying to the specs
 
		 * requires us to zero the stuff ourself. */
 
		memset(spritegroup, 0, sizeof(spritegroup));
 
	}
 

	
src/os/unix/font_unix.cpp
Show inline comments
 
@@ -48,16 +48,16 @@ FT_Error GetFontByFaceName(const char *f
 
			while (*font_style == ' ' || *font_style == '\t') font_style++;
 
		}
 

	
 
		/* Resolve the name and populate the information structure */
 
		pat = FcNameParse((FcChar8 *)font_family);
 
		if (font_style != nullptr) FcPatternAddString(pat, FC_STYLE, (FcChar8 *)font_style);
 
		FcConfigSubstitute(0, pat, FcMatchPattern);
 
		FcConfigSubstitute(nullptr, pat, FcMatchPattern);
 
		FcDefaultSubstitute(pat);
 
		fs = FcFontSetCreate();
 
		match = FcFontMatch(0, pat, &result);
 
		match = FcFontMatch(nullptr, pat, &result);
 

	
 
		if (fs != nullptr && match != nullptr) {
 
			int i;
 
			FcChar8 *family;
 
			FcChar8 *style;
 
			FcChar8 *file;
src/os/unix/unix.cpp
Show inline comments
 
@@ -274,13 +274,13 @@ bool GetClipboardContents(char *buffer, 
 
#ifdef WITH_SDL2
 
	if (SDL_HasClipboardText() == SDL_FALSE) {
 
		return false;
 
	}
 

	
 
	char *clip = SDL_GetClipboardText();
 
	if (clip != NULL) {
 
	if (clip != nullptr) {
 
		strecpy(buffer, clip, last);
 
		SDL_free(clip);
 
		return true;
 
	}
 
#endif
 

	
src/video/opengl.cpp
Show inline comments
 
@@ -1306,13 +1306,13 @@ void OpenGLBackend::RenderOglSprite(Open
 
		if (pal != this->last_sprite_pal) {
 
			/* Different remap palette in use, update texture. */
 
			_glBindBuffer(GL_PIXEL_UNPACK_BUFFER, OpenGLSprite::pal_pbo);
 
			_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
 

	
 
			_glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, 256, GetNonSprite(GB(pal, 0, PALETTE_WIDTH), ST_RECOLOUR) + 1);
 
			_glTexSubImage1D(GL_TEXTURE_1D, 0, 0, 256, GL_RED, GL_UNSIGNED_BYTE, 0);
 
			_glTexSubImage1D(GL_TEXTURE_1D, 0, 0, 256, GL_RED, GL_UNSIGNED_BYTE, nullptr);
 

	
 
			_glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
 

	
 
			this->last_sprite_pal = pal;
 
		}
 
	} else {
src/video/sdl2_v.cpp
Show inline comments
 
@@ -590,13 +590,13 @@ void VideoDriver_SDL_Base::Stop()
 
	}
 
}
 

	
 
void VideoDriver_SDL_Base::InputLoop()
 
{
 
	uint32 mod = SDL_GetModState();
 
	const Uint8 *keys = SDL_GetKeyboardState(NULL);
 
	const Uint8 *keys = SDL_GetKeyboardState(nullptr);
 

	
 
	bool old_ctrl_pressed = _ctrl_pressed;
 

	
 
	_ctrl_pressed  = !!(mod & KMOD_CTRL);
 
	_shift_pressed = !!(mod & KMOD_SHIFT);
 

	
0 comments (0 inline, 0 general)