Changeset - r17388:4c1f53028687
[Not reviewed]
master
0 11 0
alberth - 14 years ago 2011-02-25 21:53:43
alberth@openttd.org
(svn r22144) -Codechange: Unify 'while (true)' to 'for (;;)'
11 files changed with 14 insertions and 14 deletions:
0 comments (0 inline, 0 general)
src/depend/depend.cpp
Show inline comments
 
@@ -565,7 +565,7 @@ bool ExpressionAnd(Lexer *lexer, StringS
 
{
 
	bool value = ExpressionDefined(lexer, defines, verbose);
 

	
 
	while (true) {
 
	for (;;) {
 
		if (lexer->GetToken() != TOKEN_AND) return value;
 
		if (verbose) fprintf(stderr, " && ");
 
		lexer->Lex();
 
@@ -584,7 +584,7 @@ bool ExpressionOr(Lexer *lexer, StringSe
 
{
 
	bool value = ExpressionAnd(lexer, defines, verbose);
 

	
 
	while (true) {
 
	for (;;) {
 
		if (lexer->GetToken() != TOKEN_OR) return value;
 
		if (verbose) fprintf(stderr, " || ");
 
		lexer->Lex();
src/hotkeys.cpp
Show inline comments
 
@@ -90,7 +90,7 @@ static uint16 ParseKeycode(const char *s
 
{
 
	assert(start <= end);
 
	uint16 keycode = 0;
 
	while (true) {
 
	for (;;) {
 
		const char *cur = start;
 
		while (*cur != '+' && cur != end) cur++;
 
		uint16 code = ParseCode(start, cur);
src/misc/hashtable.hpp
Show inline comments
 
@@ -67,7 +67,7 @@ struct CHashTableSlotT
 
			return true;
 
		}
 
		Titem_ *pItem = m_pFirst;
 
		while (true) {
 
		for (;;) {
 
			if (pItem == NULL) {
 
				return false;
 
			}
src/network/network_content.cpp
Show inline comments
 
@@ -379,7 +379,7 @@ static bool GunzipFile(const ContentInfo
 
		ret = false;
 
	} else {
 
		byte buff[8192];
 
		while (1) {
 
		for (;;) {
 
			int read = gzread(fin, buff, sizeof(buff));
 
			if (read == 0) {
 
				/* If gzread() returns 0, either the end-of-file has been
src/newgrf_station.cpp
Show inline comments
 
@@ -151,7 +151,7 @@ static TileIndex FindRailStationEnd(Tile
 
	if (check_type) orig_type = GetCustomStationSpecIndex(tile);
 
	if (check_axis) orig_axis = GetRailStationAxis(tile);
 

	
 
	while (true) {
 
	for (;;) {
 
		TileIndex new_tile = TILE_ADD(tile, delta);
 

	
 
		if (!IsTileType(new_tile, MP_STATION) || GetStationIndex(new_tile) != sid) break;
src/pathfinder/yapf/yapf_base.hpp
Show inline comments
 
@@ -130,7 +130,7 @@ public:
 
		Yapf().PfSetStartupNodes();
 
		bool bDestFound = true;
 

	
 
		while (true) {
 
		for (;;) {
 
			m_num_steps++;
 
			Node *n = m_nodes.GetBestOpenNode();
 
			if (n == NULL) {
src/pathfinder/yapf/yapf_road.cpp
Show inline comments
 
@@ -107,7 +107,7 @@ public:
 
		/* start at n.m_key.m_tile / n.m_key.m_td and walk to the end of segment */
 
		TileIndex tile = n.m_key.m_tile;
 
		Trackdir trackdir = n.m_key.m_td;
 
		while (true) {
 
		for (;;) {
 
			/* base tile cost depending on distance between edges */
 
			segment_cost += Yapf().OneTileCost(tile, trackdir);
 

	
src/saveload/saveload.cpp
Show inline comments
 
@@ -761,7 +761,7 @@ int SlIterateArray()
 
	 * we must have read in all the data, so we must be at end of current block. */
 
	if (_next_offs != 0 && _sl.reader->GetSize() != _next_offs) SlErrorCorrupt("Invalid chunk size");
 

	
 
	while (true) {
 
	for (;;) {
 
		uint length = SlReadArrayLength();
 
		if (length == 0) {
 
			_next_offs = 0;
src/strings.cpp
Show inline comments
 
@@ -675,7 +675,7 @@ static char *FormatString(char *buff, co
 
	std::stack<const char *> str_stack;
 
	str_stack.push(str_arg);
 

	
 
	while (true) {
 
	for (;;) {
 
		while (!str_stack.empty() && (b = Utf8Consume(&str_stack.top())) == '\0') {
 
			str_stack.pop();
 
		}
src/video/dedicated_v.cpp
Show inline comments
 
@@ -97,7 +97,7 @@ static void WINAPI CheckForConsoleInput(
 
#else
 
	DWORD nb;
 
	HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
 
	while (true) {
 
	for (;;) {
 
		ReadFile(hStdin, _win_console_thread_buffer, lengthof(_win_console_thread_buffer), &nb, NULL);
 
		/* Signal input waiting that input is read and wait for it being handled
 
		 * SignalObjectAndWait() should be used here, but it's unsupported in Win98< */
src/widget.cpp
Show inline comments
 
@@ -1061,7 +1061,7 @@ void NWidgetHorizontal::SetupSmallestSiz
 
	/* 1b. Make the container higher if needed to accomadate all childs nicely. */
 
	uint max_smallest = this->smallest_y + 3 * max_vert_fill; // Upper limit to computing smallest height.
 
	uint cur_height = this->smallest_y;
 
	while (true) {
 
	for (;;) {
 
		for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
			uint step_size = child_wid->GetVerticalStepSize(ST_SMALLEST);
 
			uint child_height = child_wid->smallest_y + child_wid->padding_top + child_wid->padding_bottom;
 
@@ -1213,7 +1213,7 @@ void NWidgetVertical::SetupSmallestSize(
 
	/* 1b. Make the container wider if needed to accomadate all childs nicely. */
 
	uint max_smallest = this->smallest_x + 3 * max_hor_fill; // Upper limit to computing smallest height.
 
	uint cur_width = this->smallest_x;
 
	while (true) {
 
	for (;;) {
 
		for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
			uint step_size = child_wid->GetHorizontalStepSize(ST_SMALLEST);
 
			uint child_width = child_wid->smallest_x + child_wid->padding_left + child_wid->padding_right;
 
@@ -2538,7 +2538,7 @@ static int MakeWidgetTree(const NWidgetP
 
	assert(*parent == NULL || (nwid_cont != NULL && nwid_parent == NULL) || (nwid_cont == NULL && nwid_parent != NULL));
 

	
 
	int total_used = 0;
 
	while (true) {
 
	for (;;) {
 
		NWidgetBase *sub_widget = NULL;
 
		bool fill_sub = false;
 
		int num_used = MakeNWidget(parts, count - total_used, &sub_widget, &fill_sub, biggest_index);
0 comments (0 inline, 0 general)