changeset 2627:ebd36467d309 draft

(svn r3169) Little bit of coding style fixing, and change from value to lengthof()
author peter1138 <peter1138@openttd.org>
date Sat, 12 Nov 2005 08:51:46 +0000
parents b7dcc839a38f
children 0ef14a0f3916
files newgrf.c rail_gui.c
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/newgrf.c
+++ b/newgrf.c
@@ -2392,13 +2392,12 @@
 static void ResetCustomStations(void)
 {
 	GRFFile *file;
-	int i;
+	uint i;
 	CargoID c;
 
 	for (file = _first_grffile; file != NULL; file = file->next) {
-		for (i = 0; i < 256; i++) {
-			if (file->stations[i].grfid != file->grfid)
-				continue;
+		for (i = 0; i < lengthof(file->stations); i++) {
+			if (file->stations[i].grfid != file->grfid) continue;
 
 			// TODO: Release renderdata, platforms and layouts
 
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -833,9 +833,10 @@
 		w->click_state = (1 << 3) << (_cur_waypoint_type - w->hscroll.pos);
 		DrawWindowWidgets(w);
 
-		for (i = 0; i < 5; i++)
-			if(w->hscroll.pos + i < _waypoint_count)
+		for (i = 0; i < 5; i++) {
+			if (w->hscroll.pos + i < _waypoint_count)
 				DrawWaypointSprite(2 + i * 68, 25, w->hscroll.pos + i, _cur_railtype);
+		}
 
 		break;
 	}