<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39559 >
This patch makes S2_1 gui-win32 to compile with -Werror. At least one bug is crushed: pointer to group name was passed to is_nation_in_group() instead of pointer to group. - ML
diff -Nurd -X.diff_ignore freeciv/client/gui-win32/dialogs.c freeciv/client/gui-win32/dialogs.c --- freeciv/client/gui-win32/dialogs.c 2007-08-10 17:16:19.000000000 +0300 +++ freeciv/client/gui-win32/dialogs.c 2007-08-26 23:49:14.000000000 +0300 @@ -104,8 +104,10 @@ static HWND races_dlg; struct player *races_player; static HWND races_listview; +/* static HWND races_class; static HWND races_legend; +*/ int visible_nations[MAX_NUM_ITEMS]; int selected_leader_sex; int selected_style; @@ -282,12 +284,13 @@ **************************************************************************/ static void update_nation_info() { +/* int i; char buf[255]; struct nation_type *nation = nation_by_number(selected_nation); buf[0] = '\0'; -/* + for (i = 0; i < nation->num_groups; i++) { sz_strlcat(buf, nation->groups[i]->name); if (i != nation->num_groups - 1) { @@ -456,16 +459,6 @@ return 0; } - -/**************************************************************** -... -*****************************************************************/ -static int cmp_func(const void * a_p, const void * b_p) -{ - return strcmp(nation_name_translation(nation_by_number((*(int *)a_p)-ID_RACESDLG_NATION_BASE)), - nation_name_translation(nation_by_number((*(int *)b_p)-ID_RACESDLG_NATION_BASE))); -} - /**************************************************************** ... *****************************************************************/ @@ -483,11 +476,13 @@ continue; } - if (group != NULL && !is_nation_in_group(pnation, group->name)) { + if (group != NULL && !is_nation_in_group(pnation, group)) { continue; } - strings[0] = nation_name_translation(pnation); + /* FIXME: fcwin_listview_add_row() should be fixed to handle + * const strings. Now we just cast const away */ + strings[0] = (char *) nation_name_translation(pnation); fcwin_listview_add_row(listview, pnation->index, 1, strings); visible_nations[n++] = pnation->index; diff -Nurd -X.diff_ignore freeciv/client/gui-win32/gui_main.c freeciv/client/gui-win32/gui_main.c --- freeciv/client/gui-win32/gui_main.c 2007-08-22 03:26:25.000000000 +0300 +++ freeciv/client/gui-win32/gui_main.c 2007-08-26 23:51:36.000000000 +0300 @@ -712,8 +712,6 @@ return TRUE; } -extern void anim_cursor(float time); - /************************************************************************** **************************************************************************/ diff -Nurd -X.diff_ignore freeciv/client/gui-win32/happiness.c freeciv/client/gui-win32/happiness.c --- freeciv/client/gui-win32/happiness.c 2007-07-04 14:04:26.000000000 +0300 +++ freeciv/client/gui-win32/happiness.c 2007-08-26 23:50:07.000000000 +0300 @@ -241,7 +241,6 @@ char buf[512], *bptr = buf; int nleft = sizeof(buf); struct city *pcity = pdialog->pcity; - struct government *g = government_of_city(pcity); int mlmax = get_city_bonus(pcity, EFT_MARTIAL_LAW_MAX); int uhcfac = get_player_bonus(city_owner(pcity), EFT_UNHAPPY_FACTOR); diff -Nurd -X.diff_ignore freeciv/client/gui-win32/mapview.h freeciv/client/gui-win32/mapview.h --- freeciv/client/gui-win32/mapview.h 2007-03-05 19:14:32.000000000 +0200 +++ freeciv/client/gui-win32/mapview.h 2007-08-26 23:51:26.000000000 +0300 @@ -22,6 +22,7 @@ void overview_expose(HDC hdc); void map_handle_hscroll(int pos); void map_handle_vscroll(int pos); +void anim_cursor(float time); /* These values are stored in the mapview struct now. */ #define map_view_x mapview.map_x0 diff -Nurd -X.diff_ignore freeciv/client/gui-win32/repodlgs.c freeciv/client/gui-win32/repodlgs.c --- freeciv/client/gui-win32/repodlgs.c 2007-07-04 14:04:26.000000000 +0300 +++ freeciv/client/gui-win32/repodlgs.c 2007-08-26 23:54:38.000000000 +0300 @@ -565,7 +565,8 @@ my_snprintf(buf, sizeof(buf), _("Upgrade as many %s to %s as possible for %d gold each?\n" "Treasury contains %d gold."), - ut1->name, ut2->name, + utype_name_translation(ut1), + utype_name_translation(ut2), unit_upgrade_price(game.player_ptr, ut1, ut2), game.player_ptr->economic.gold); @@ -576,7 +577,7 @@ (void *)(activeunits_type[sel]), _("No"), upgrade_callback_no, 0, 0); } - break; + break; } break; default:
_______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev