Changeset - r17389:80d374d6031a
[Not reviewed]
master
0 14 0
alberth - 13 years ago 2011-02-25 22:04:38
alberth@openttd.org
(svn r22145) -Codechange: Do explicit test for non-bool values.
14 files changed with 31 insertions and 31 deletions:
0 comments (0 inline, 0 general)
src/ai/api/ai_rail.cpp
Show inline comments
 
@@ -291,7 +291,7 @@ static uint32 SimulateDrag(TileIndex fro
 
		} else {
 
			p2 |= (TRACK_LEFT << 4);
 
		}
 
		if (diag_offset) {
 
		if (diag_offset != 0) {
 
			*to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1);
 
		} else {
 
			*to -= ::MapSizeX() * Clamp((int)::TileY(*to) - (int)::TileY(tile), -1, 1);
 
@@ -302,7 +302,7 @@ static uint32 SimulateDrag(TileIndex fro
 
		} else {
 
			p2 |= (TRACK_LOWER << 4);
 
		}
 
		if (diag_offset) {
 
		if (diag_offset != 0) {
 
			*to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1);
 
		} else {
 
			*to -= ::MapSizeX() * Clamp((int)::TileY(*to) - (int)::TileY(tile), -1, 1);
 
@@ -313,7 +313,7 @@ static uint32 SimulateDrag(TileIndex fro
 
		} else {
 
			p2 |= (TRACK_RIGHT << 4);
 
		}
 
		if (!diag_offset) {
 
		if (diag_offset == 0) {
 
			*to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1);
 
		} else {
 
			*to -= ::MapSizeX() * Clamp((int)::TileY(*to) - (int)::TileY(tile), -1, 1);
 
@@ -324,7 +324,7 @@ static uint32 SimulateDrag(TileIndex fro
 
		} else {
 
			p2 |= (TRACK_LOWER << 4);
 
		}
 
		if (!diag_offset) {
 
		if (diag_offset == 0) {
 
			*to -= Clamp((int)::TileX(*to) - (int)::TileX(tile), -1, 1);
 
		} else {
 
			*to -= ::MapSizeX() * Clamp((int)::TileY(*to) - (int)::TileY(tile), -1, 1);
src/autoreplace.cpp
Show inline comments
 
@@ -26,7 +26,7 @@ static EngineRenew *GetEngineReplacement
 
{
 
	EngineRenew *er = (EngineRenew *)erl;
 

	
 
	while (er) {
 
	while (er != NULL) {
 
		if (er->from == engine && er->group_id == group) return er;
 
		er = er->next;
 
	}
 
@@ -114,7 +114,7 @@ CommandCost RemoveEngineReplacement(Engi
 
	EngineRenew *er = (EngineRenew *)(*erl);
 
	EngineRenew *prev = NULL;
 

	
 
	while (er) {
 
	while (er != NULL) {
 
		if (er->from == engine && er->group_id == group) {
 
			if (flags & DC_EXEC) {
 
				if (prev == NULL) { // First element
src/gfx.cpp
Show inline comments
 
@@ -1699,7 +1699,7 @@ void SetDirtyBlocks(int left, int top, i
 
	do {
 
		int i = width;
 

	
 
		do b[--i] = 0xFF; while (i);
 
		do b[--i] = 0xFF; while (i != 0);
 

	
 
		b += _dirty_bytes_per_line;
 
	} while (--height != 0);
src/ini.cpp
Show inline comments
 
@@ -268,11 +268,11 @@ void IniFile::LoadFromDisk(const char *f
 
			}
 
			s++; // skip [
 
			group = new IniGroup(this, s, e - s);
 
			if (comment_size) {
 
			if (comment_size != 0) {
 
				group->comment = strndup(comment, comment_size);
 
				comment_size = 0;
 
			}
 
		} else if (group) {
 
		} else if (group != NULL) {
 
			char *t;
 
			/* find end of keyname */
 
			if (*s == '\"') {
 
@@ -285,7 +285,7 @@ void IniFile::LoadFromDisk(const char *f
 

	
 
			/* it's an item in an existing group */
 
			IniItem *item = new IniItem(group, s, t - s);
 
			if (comment_size) {
 
			if (comment_size != 0) {
 
				item->comment = strndup(comment, comment_size);
 
				comment_size = 0;
 
			}
src/misc/countedptr.hpp
Show inline comments
 
@@ -96,10 +96,10 @@ FORCEINLINE void CCountedPtr<Tcls_>::Ass
 
{
 
	/* if they are the same, we do nothing */
 
	if (pT != m_pT) {
 
		if (pT) pT->AddRef();        // AddRef new pointer if any
 
		Tcls *pTold = m_pT;          // save original ptr
 
		m_pT = pT;                   // update m_pT to new value
 
		if (pTold) pTold->Release(); // release old ptr if any
 
		if (pT != NULL) pT->AddRef();        // AddRef new pointer if any
 
		Tcls *pTold = m_pT;                  // save original ptr
 
		m_pT = pT;                           // update m_pT to new value
 
		if (pTold != NULL) pTold->Release(); // release old ptr if any
 
	}
 
}
 

	
src/openttd.cpp
Show inline comments
 
@@ -547,11 +547,11 @@ int ttd_main(int argc, char *argv[])
 

	
 
#if defined(ENABLE_NETWORK)
 
	if (dedicated) DEBUG(net, 0, "Starting dedicated version %s", _openttd_revision);
 
	if (dedicated_host) {
 
	if (dedicated_host != NULL) {
 
		_network_bind_list.Clear();
 
		*_network_bind_list.Append() = strdup(dedicated_host);
 
	}
 
	if (dedicated_port) _settings_client.network.server_port = dedicated_port;
 
	if (dedicated_port != 0) _settings_client.network.server_port = dedicated_port;
 
	if (_dedicated_forks && !dedicated) _dedicated_forks = false;
 
#endif /* ENABLE_NETWORK */
 

	
src/os/windows/crashlog_win.cpp
Show inline comments
 
@@ -526,7 +526,7 @@ static LONG WINAPI ExceptionHandler(EXCE
 
	/* Close any possible log files */
 
	CloseConsoleLogIfActive();
 

	
 
	if (_safe_esp) {
 
	if (_safe_esp != NULL) {
 
#ifdef _M_AMD64
 
		ep->ContextRecord->Rip = (DWORD64)ShowCrashlogWindow;
 
		ep->ContextRecord->Rsp = (DWORD64)_safe_esp;
 
@@ -605,7 +605,7 @@ static void SetWndSize(HWND wnd, int mod
 
	if (mode >= 0) {
 
		GetWindowRect(GetDlgItem(wnd, 11), &r2);
 
		int offs = r2.bottom - r2.top + 10;
 
		if (!mode) offs = -offs;
 
		if (mode == 0) offs = -offs;
 
		SetWindowPos(wnd, HWND_TOPMOST, 0, 0,
 
			r.right - r.left, r.bottom - r.top + offs, SWP_NOMOVE | SWP_NOZORDER);
 
	} else {
src/pathfinder/follow_track.hpp
Show inline comments
 
@@ -456,7 +456,7 @@ public:
 
		}
 

	
 
		/* if min speed was requested, return it */
 
		if (pmin_speed) *pmin_speed = min_speed;
 
		if (pmin_speed != NULL) *pmin_speed = min_speed;
 
		return max_speed;
 
	}
 
};
src/pathfinder/npf/npf.cpp
Show inline comments
 
@@ -981,7 +981,7 @@ static NPFFoundTargetData NPFRouteIntern
 
	start1->user_data[NPF_NODE_FLAGS] = 0;
 
	NPFSetFlag(start1, NPF_FLAG_IGNORE_START_TILE, ignore_start_tile1);
 
	_npf_aystar.AddStartNode(start1, 0);
 
	if (start2) {
 
	if (start2 != NULL) {
 
		start2->user_data[NPF_TRACKDIR_CHOICE] = INVALID_TRACKDIR;
 
		start2->user_data[NPF_NODE_FLAGS] = 0;
 
		NPFSetFlag(start2, NPF_FLAG_IGNORE_START_TILE, ignore_start_tile2);
src/settings.cpp
Show inline comments
 
@@ -781,7 +781,7 @@ static bool CheckInterval(int32 p1)
 
		vds = &Company::Get(_current_company)->settings.vehicle;
 
	}
 

	
 
	if (p1) {
 
	if (p1 != 0) {
 
		vds->servint_trains   = 50;
 
		vds->servint_roadveh  = 50;
 
		vds->servint_aircraft = 50;
src/strgen/strgen.cpp
Show inline comments
 
@@ -724,7 +724,7 @@ static void HandleString(char *str, bool
 
	/* Check if the string has a case..
 
	 * The syntax for cases is IDENTNAME.case */
 
	char *casep = strchr(str, '.');
 
	if (casep) *casep++ = '\0';
 
	if (casep != NULL) *casep++ = '\0';
 

	
 
	/* Check if this string already exists.. */
 
	LangString *ent = HashFind(str);
 
@@ -901,7 +901,7 @@ bool CompareFiles(const char *n1, const 
 
			fclose(f1);
 
			return false;
 
		}
 
	} while (l1);
 
	} while (l1 != 0);
 

	
 
	fclose(f2);
 
	fclose(f1);
 
@@ -1320,7 +1320,7 @@ int CDECL main(int argc, char *argv[])
 
		_masterlang = true;
 
		ParseFile(pathbuf, true);
 
		MakeHashOfStrings();
 
		if (_errors) return 1;
 
		if (_errors != 0) return 1;
 

	
 
		/* write strings.h */
 
		ottd_mkdir(dest_dir);
 
@@ -1336,7 +1336,7 @@ int CDECL main(int argc, char *argv[])
 
		ParseFile(pathbuf, true);
 
		MakeHashOfStrings();
 
		ParseFile(replace_pathsep(mgo.argv[0]), false); // target file
 
		if (_errors) return 1;
 
		if (_errors != 0) return 1;
 

	
 
		/* get the targetfile, strip any directories and append to destination path */
 
		r = strrchr(mgo.argv[0], PATHSEPCHAR);
src/train_cmd.cpp
Show inline comments
 
@@ -2213,8 +2213,8 @@ static PBSTileInfo ExtendTrainReservatio
 
			if (ft.m_tiles_skipped != 0) ft.m_new_tile -= TileOffsByDiagDir(ft.m_exitdir) * ft.m_tiles_skipped;
 

	
 
			/* Choice found, path valid but not okay. Save info about the choice tile as well. */
 
			if (new_tracks) *new_tracks = TrackdirBitsToTrackBits(ft.m_new_td_bits);
 
			if (enterdir) *enterdir = ft.m_exitdir;
 
			if (new_tracks != NULL) *new_tracks = TrackdirBitsToTrackBits(ft.m_new_td_bits);
 
			if (enterdir != NULL) *enterdir = ft.m_exitdir;
 
			return PBSTileInfo(ft.m_new_tile, ft.m_old_td, false);
 
		}
 

	
src/video/win32_v.cpp
Show inline comments
 
@@ -379,7 +379,7 @@ static LRESULT CALLBACK WndProcGdi(HWND 
 

	
 
			SelectPalette(hDC, hOldPalette, TRUE);
 
			ReleaseDC(hwnd, hDC);
 
			if (nChanged) InvalidateRect(hwnd, NULL, FALSE);
 
			if (nChanged != 0) InvalidateRect(hwnd, NULL, FALSE);
 
			return 0;
 
		}
 

	
src/widget.cpp
Show inline comments
 
@@ -2559,9 +2559,9 @@ static int MakeWidgetTree(const NWidgetP
 
		}
 

	
 
		/* Add sub_widget to parent container if available, otherwise return the widget to the caller. */
 
		if (nwid_cont) nwid_cont->Add(sub_widget);
 
		if (nwid_parent) nwid_parent->Add(sub_widget);
 
		if (!nwid_cont && !nwid_parent) {
 
		if (nwid_cont != NULL) nwid_cont->Add(sub_widget);
 
		if (nwid_parent != NULL) nwid_parent->Add(sub_widget);
 
		if (nwid_cont == NULL && nwid_parent == NULL) {
 
			*parent = sub_widget;
 
			return total_used;
 
		}
0 comments (0 inline, 0 general)