(svn r3298) Remove unused and write-only variables
authortron
Wed, 14 Dec 2005 06:28:48 +0000
changeset 2753 15012faaa68a
parent 2752 b5fe5a7e6282
child 2754 e919a241adde
(svn r3298) Remove unused and write-only variables
ai/default/default.c
gfx.c
main_gui.c
misc_gui.c
network_gui.c
rail_cmd.c
road_gui.c
roadveh_cmd.c
vehicle.c
vehicle_gui.c
--- a/ai/default/default.c	Wed Dec 14 06:20:23 2005 +0000
+++ b/ai/default/default.c	Wed Dec 14 06:28:48 2005 +0000
@@ -562,14 +562,11 @@
 
 static void AiFindRandomPassengerRoute(FoundRoute *fr)
 {
-	uint32 r;
 	Town *source, *dest;
 
 	// initially error
 	fr->distance = -1;
 
-	r = Random();
-
 	fr->from = source = AiFindRandomTown();
 	if (source == NULL || source->population < 400)
 		return;
@@ -2964,8 +2961,6 @@
 	arf->depth--;
 }
 
-int sw;
-
 
 static void AiBuildRoadConstruct(Player *p)
 {
@@ -3122,7 +3117,6 @@
 		swap_byte(&p->ai.start_dir_a, &p->ai.start_dir_b);
 		swap_byte(&p->ai.cur_dir_a, &p->ai.cur_dir_b);
 
-		sw ^= 1;
 		return;
 	}
 
--- a/gfx.c	Wed Dec 14 06:20:23 2005 +0000
+++ b/gfx.c	Wed Dec 14 06:28:48 2005 +0000
@@ -484,7 +484,7 @@
 {
 	char buffer[512];
 	uint32 tmp;
-	int num, w, mt;
+	int num, mt;
 	const char *src;
 	byte c;
 
@@ -502,7 +502,6 @@
 	src = buffer;
 
 	for(;;) {
-		w = GetStringWidth(src);
 		DoDrawString(src, x, y, 0xFE);
 		_stringwidth_base = _stringwidth_out;
 
--- a/main_gui.c	Wed Dec 14 06:20:23 2005 +0000
+++ b/main_gui.c	Wed Dec 14 06:28:48 2005 +0000
@@ -1986,14 +1986,6 @@
 	MainToolbarWndProc
 };
 
-static const WindowDesc _toolb_intro_desc = {
-	0, -22, 640, 22,
-	WC_MAIN_TOOLBAR,0,
-	WDF_STD_TOOLTIPS | WDF_DEF_WIDGET,
-	_toolb_normal_widgets,
-	MainToolbarWndProc
-};
-
 
 static const Widget _toolb_scen_widgets[] = {
 {      WWT_PANEL,   RESIZE_NONE,    14,     0,    21,     0,    21, 0x2D6,				STR_0171_PAUSE_GAME},
--- a/misc_gui.c	Wed Dec 14 06:20:23 2005 +0000
+++ b/misc_gui.c	Wed Dec 14 06:28:48 2005 +0000
@@ -29,7 +29,6 @@
 static bool _fios_path_changed;
 static bool _savegame_sort_dirty;
 
-static bool _query_string_active;
 
 typedef struct LandInfoData {
 	Town *town;
@@ -1024,7 +1023,6 @@
 				parent->wndproc(parent, &e);
 			}
 		}
-		_query_string_active = false;
 		CLRBIT(_no_scroll, SCROLL_EDIT);
 		break;
 	}
@@ -1082,8 +1080,6 @@
 	WP(w, querystr_d).text.maxwidth = maxwidth;
 	WP(w, querystr_d).text.buf = _edit_str_buf;
 	UpdateTextBufferSize(&WP(w, querystr_d).text);
-
-	_query_string_active = true;
 }
 
 static const Widget _load_dialog_1_widgets[] = {
@@ -1380,7 +1376,6 @@
 		// pause is only used in single-player, non-editor mode, non menu mode
 		if(!_networking && (_game_mode != GM_EDITOR) && (_game_mode != GM_MENU))
 			DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
-		_query_string_active = false;
 		FiosFreeSavegameList();
 		CLRBIT(_no_scroll, SCROLL_SAVE);
 		break;
--- a/network_gui.c	Wed Dec 14 06:20:23 2005 +0000
+++ b/network_gui.c	Wed Dec 14 06:28:48 2005 +0000
@@ -694,7 +694,6 @@
 		if (_selected_company_item != -1) { // if a company is selected...
 			// show company info
 			const uint x = 183;
-			uint xm;
 			y = 65;
 
 			SetDParamStr(0, _network_player_info[_selected_company_item].company_name);
@@ -738,7 +737,7 @@
 			y += 10;
 
 			SetDParamStr(0, _network_player_info[_selected_company_item].players);
-			xm = DrawString(x, y, STR_NETWORK_PLAYERS, 2); // players
+			DrawString(x, y, STR_NETWORK_PLAYERS, 2); // players
 			y += 10;
 		}
 	}	break;
--- a/rail_cmd.c	Wed Dec 14 06:20:23 2005 +0000
+++ b/rail_cmd.c	Wed Dec 14 06:28:48 2005 +0000
@@ -410,7 +410,6 @@
 {
 	Track track = (Track)p2;
 	TrackBits trackbit;
-	uint tileh;
 	TileIndex tile;
 	byte m5;
 	int32 cost = _price.remove_rail;
@@ -421,7 +420,6 @@
 	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
 
 	tile = TileVirtXY(x, y);
-	tileh = GetTileSlope(tile, NULL);
 
 	if (!IsTileType(tile, MP_TUNNELBRIDGE) && !IsTileType(tile, MP_STREET) && !IsTileType(tile, MP_RAILWAY))
 		return CMD_ERROR;
@@ -726,7 +724,6 @@
 	bool semaphore;
 	bool pre_signal;
 	Track track = (Track)(p1 & 0x7);
-	byte m5;
 	int32 cost;
 
 	// Same bit, used in different contexts
@@ -738,8 +735,6 @@
 	/* Protect against invalid signal copying */
 	if (p2 != 0 && (p2 & SignalOnTrack(track)) == 0) return CMD_ERROR;
 
-	m5 = _m[tile].m5;
-
 	/* You can only build signals on plain rail tiles, and the selected track must exist */
 	if (!IsPlainRailTile(tile) || !HasTrack(tile, track)) return CMD_ERROR;
 
--- a/road_gui.c	Wed Dec 14 06:20:23 2005 +0000
+++ b/road_gui.c	Wed Dec 14 06:28:48 2005 +0000
@@ -23,7 +23,6 @@
 static void ShowRoadDepotPicker(void);
 
 static bool _remove_button_clicked;
-static bool _build_road_flag;
 
 static byte _place_road_flag;
 
@@ -111,13 +110,11 @@
 
 static void BuildRoadClick_NE(Window *w)
 {
-	_build_road_flag = 0;
 	HandlePlacePushButton(w, 3, SPR_CURSOR_ROAD_NESW, 1, PlaceRoad_NE);
 }
 
 static void BuildRoadClick_NW(Window *w)
 {
-	_build_road_flag = 0;
 	HandlePlacePushButton(w, 4, SPR_CURSOR_ROAD_NWSE, 1, PlaceRoad_NW);
 }
 
@@ -147,13 +144,11 @@
 
 static void BuildRoadClick_Bridge(Window *w)
 {
-	_build_road_flag = 0;
 	HandlePlacePushButton(w, 9, SPR_CURSOR_BRIDGE, 1, PlaceRoad_Bridge);
 }
 
 static void BuildRoadClick_Tunnel(Window *w)
 {
-	_build_road_flag = 0;
 	HandlePlacePushButton(w, 10, SPR_CURSOR_ROAD_TUNNEL, 3, PlaceRoad_Tunnel);
 }
 
--- a/roadveh_cmd.c	Wed Dec 14 06:20:23 2005 +0000
+++ b/roadveh_cmd.c	Wed Dec 14 06:28:48 2005 +0000
@@ -664,12 +664,10 @@
 
 		{
 			uint mindist = 0xFFFFFFFF;
-			int num;
 			RoadStopType type;
 			RoadStop *rs;
 
 			type = (v->cargo_type == CT_PASSENGERS) ? RS_BUS : RS_TRUCK;
-			num = GetNumRoadStops(st, type);
 			rs = GetPrimaryRoadStop(st, type);
 
 			if (rs == NULL) {
--- a/vehicle.c	Wed Dec 14 06:20:23 2005 +0000
+++ b/vehicle.c	Wed Dec 14 06:28:48 2005 +0000
@@ -37,7 +37,6 @@
 
 #define CMD_BUILD_VEH(x)		   _veh_build_proc_table[ x - VEH_Train]
 #define CMD_SELL_VEH(x)				_veh_sell_proc_table[ x - VEH_Train]
-#define CMD_STARTSTOP_VEH(x)  _veh_start_stop_proc_table[ x - VEH_Train]
 #define CMD_REFIT_VEH(x)		   _veh_refit_proc_table[ x - VEH_Train]
 
 static const uint32 _veh_build_proc_table[] = {
@@ -52,12 +51,7 @@
 	CMD_SELL_SHIP,
 	CMD_SELL_AIRCRAFT,
 };
-static const uint32 _veh_start_stop_proc_table[] = {
-	CMD_START_STOP_TRAIN,
-	CMD_START_STOP_ROADVEH,
-	CMD_START_STOP_SHIP,
-	CMD_START_STOP_AIRCRAFT,
-};
+
 static const uint32 _veh_refit_proc_table[] = {
 	CMD_REFIT_RAIL_VEHICLE,
 	0,	// road vehicles can't be refitted
--- a/vehicle_gui.c	Wed Dec 14 06:20:23 2005 +0000
+++ b/vehicle_gui.c	Wed Dec 14 06:28:48 2005 +0000
@@ -498,11 +498,9 @@
 			int num = NUM_ROAD_ENGINES;
 			const Engine* e = GetEngine(ROAD_ENGINES_INDEX);
 			byte cargo;
-			const EngineInfo* info;
 			engine_id = ROAD_ENGINES_INDEX;
 
 			do {
-				info = &_engine_info[engine_id];
 				if (_player_num_engines[engine_id] > 0 || EngineHasReplacement(p, engine_id)) {
 					if (sel[0] == 0) selected_id[0] = engine_id;
 					count++;
@@ -531,11 +529,9 @@
 			int num = NUM_SHIP_ENGINES;
 			const Engine* e = GetEngine(SHIP_ENGINES_INDEX);
 			byte cargo, refittable;
-			const EngineInfo* info;
 			engine_id = SHIP_ENGINES_INDEX;
 
 			do {
-				info = &_engine_info[engine_id];
 				if (_player_num_engines[engine_id] > 0 || EngineHasReplacement(p, engine_id)) {
 					if (sel[0] == 0) selected_id[0] = engine_id;
 					count++;
@@ -566,11 +562,9 @@
 			int num = NUM_AIRCRAFT_ENGINES;
 			byte subtype;
 			const Engine* e = GetEngine(AIRCRAFT_ENGINES_INDEX);
-			const EngineInfo* info;
 			engine_id = AIRCRAFT_ENGINES_INDEX;
 
 			do {
-				info = &_engine_info[engine_id];
 				if (_player_num_engines[engine_id] > 0 || EngineHasReplacement(p, engine_id)) {
 					count++;
 					if (sel[0] == 0) selected_id[0] = engine_id;
@@ -643,13 +637,11 @@
 			const Engine* e = GetEngine(ROAD_ENGINES_INDEX);
 			EngineID engine_id = ROAD_ENGINES_INDEX;
 			byte cargo;
-			const EngineInfo* info;
 
 			if (selected_id[0] >= ROAD_ENGINES_INDEX && selected_id[0] < SHIP_ENGINES_INDEX) {
 				cargo = RoadVehInfo(selected_id[0])->cargo_type;
 
 				do {
-					info = &_engine_info[engine_id];
 					if (_player_num_engines[engine_id] > 0 || EngineHasReplacement(p, engine_id)) {
 						if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
 							DrawString(x+59, y+2, GetCustomEngineName(engine_id), sel[0]==0 ? 0xC : 0x10);
@@ -679,14 +671,12 @@
 			const Engine* e = GetEngine(SHIP_ENGINES_INDEX);
 			EngineID engine_id = SHIP_ENGINES_INDEX;
 			byte cargo, refittable;
-			const EngineInfo* info;
 
 			if (selected_id[0] != INVALID_ENGINE) {
 				cargo = ShipVehInfo(selected_id[0])->cargo_type;
 				refittable = ShipVehInfo(selected_id[0])->refittable;
 
 				do {
-					info = &_engine_info[engine_id];
 					if (_player_num_engines[engine_id] > 0 || EngineHasReplacement(p, engine_id)) {
 						if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
 							DrawString(x+75, y+7, GetCustomEngineName(engine_id), sel[0]==0 ? 0xC : 0x10);
@@ -718,10 +708,8 @@
 				const Engine* e = GetEngine(AIRCRAFT_ENGINES_INDEX);
 				EngineID engine_id = AIRCRAFT_ENGINES_INDEX;
 				byte subtype = AircraftVehInfo(selected_id[0])->subtype;
-				const EngineInfo* info;
 
 				do {
-					info = &_engine_info[engine_id];
 					if (_player_num_engines[engine_id] > 0 || EngineHasReplacement(p, engine_id)) {
 						if (sel[0] == 0) selected_id[0] = engine_id;
 						if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {