(svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants

This commit is contained in:
tron
2005-10-07 07:35:15 +00:00
parent 2b44da199c
commit 3397e202c8
22 changed files with 84 additions and 85 deletions

View File

@@ -352,7 +352,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
int sel = WP(w,buildtrain_d).sel_index;
int pos = w->vscroll.pos;
EngineID engine_id = SHIP_ENGINES_INDEX;
int selected_id = -1;
EngineID selected_id = INVALID_ENGINE;
do {
if (HASBIT(e->player_avail, _local_player)) {
@@ -368,7 +368,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
WP(w,buildtrain_d).sel_engine = selected_id;
if (selected_id != -1) {
if (selected_id != INVALID_ENGINE) {
DrawShipPurchaseInfo(2, w->widget[4].top + 1, selected_id);
}
}
@@ -384,14 +384,14 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
}
} break;
case 5: { /* build */
int sel_eng = WP(w,buildtrain_d).sel_engine;
if (sel_eng != -1)
EngineID sel_eng = WP(w,buildtrain_d).sel_engine;
if (sel_eng != INVALID_ENGINE)
DoCommandP(w->window_number, sel_eng, 0, CcBuildShip, CMD_BUILD_SHIP | CMD_MSG(STR_980D_CAN_T_BUILD_SHIP));
} break;
case 6: { /* rename */
int sel_eng = WP(w,buildtrain_d).sel_engine;
if (sel_eng != -1) {
EngineID sel_eng = WP(w,buildtrain_d).sel_engine;
if (sel_eng != INVALID_ENGINE) {
WP(w,buildtrain_d).rename_engine = sel_eng;
ShowQueryString(GetCustomEngineName(sel_eng),
STR_9838_RENAME_SHIP_TYPE, 31, 160, w->window_class, w->window_number);