From 93b36d37f9163cf621f23d010e10912ff5521375 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Thu, 18 Dec 2014 02:14:15 -0800 Subject: [PATCH] eliminate warnings and old warning kludges --- 3d/interp.c | 1 - arch/ogl/gr.c | 7 +------ arch/ogl/internal.h | 4 ---- arch/sdl/joydefs.c | 4 ---- configure.ac | 2 +- main/automap.c | 2 -- main/kmatrix.c | 4 ---- main/menu.c | 11 ---------- main/multi.c | 4 ---- main/multibot.c | 2 -- main/network.c | 51 ++++----------------------------------------- main/newmenu.c | 1 - main/state.c | 3 --- 13 files changed, 6 insertions(+), 90 deletions(-) diff --git a/3d/interp.c b/3d/interp.c index bd5c18ec..cbe8e89d 100644 --- a/3d/interp.c +++ b/3d/interp.c @@ -766,5 +766,4 @@ void g3_init_polygon_model(void *model_ptr) void g3_uninit_polygon_model(void *model_ptr) { // not required, the above g3_init_polygon_model doesn't change the data - model_ptr = model_ptr; } diff --git a/arch/ogl/gr.c b/arch/ogl/gr.c index 29fbed07..139b5d9b 100644 --- a/arch/ogl/gr.c +++ b/arch/ogl/gr.c @@ -679,11 +679,6 @@ void gr_palette_step_up(int r, int g, int b) } } -//added on 980913 by adb to fix palette problems -// need a min without side effects... -#undef min -static inline int min(int x, int y) { return x < y ? x : y; } -//end changes by adb void gr_palette_load( ubyte *pal ) { @@ -899,7 +894,7 @@ void save_screen_shot(int automap_flag) // gr_get_string_size(message,&w,&h,&aw); // modex_print_message(32, 2, message); } else { - hud_message(MSGC_GAME_FEEDBACK,message); + hud_message(MSGC_GAME_FEEDBACK, "%s", message); } buf = d_malloc(grd_curscreen->sc_w*grd_curscreen->sc_h*3); diff --git a/arch/ogl/internal.h b/arch/ogl/internal.h index 7b705953..c78f135f 100644 --- a/arch/ogl/internal.h +++ b/arch/ogl/internal.h @@ -56,10 +56,6 @@ extern int last_width,last_height; #define OGL_VIEWPORT(x,y,w,h){if (w!=last_width || h!=last_height){glViewport(x,grd_curscreen->sc_canvas.cv_bitmap.bm_h-y-h,w,h);last_width=w;last_height=h;}} //platform specific funcs -//MSVC seems to have problems with inline funcs not being found during linking -#ifndef _MSC_VER -inline -#endif void ogl_swap_buffers_internal(void); extern unsigned char *ogl_pal; diff --git a/arch/sdl/joydefs.c b/arch/sdl/joydefs.c index 76b7b16c..40e2382f 100644 --- a/arch/sdl/joydefs.c +++ b/arch/sdl/joydefs.c @@ -39,10 +39,6 @@ void joydef_menuset_1(int nitems, newmenu_item * items, int *last_key, int citem int i; int oc_type = Config_control_type; - nitems = nitems; - last_key = last_key; - citem = citem; - for (i=0; i<3; i++ ) if (items[i].value) Config_control_type = i; diff --git a/configure.ac b/configure.ac index 3c6eee05..36093df6 100644 --- a/configure.ac +++ b/configure.ac @@ -81,7 +81,7 @@ test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}" dnl Set default locations to find data files. default_sharepath="$datadir/games/$PACKAGE" -CFLAGS="-Wall -Wno-char-subscripts $CFLAGS" +CFLAGS="-Wall -Werror -Wno-ignored-attributes -Wno-deprecated-declarations -Wno-int-to-pointer-cast $CFLAGS" dnl Enable editor build? AC_ARG_ENABLE(editor, diff --git a/main/automap.c b/main/automap.c index a9f313b9..10309bc5 100644 --- a/main/automap.c +++ b/main/automap.c @@ -680,8 +680,6 @@ void do_automap( int key_code ) { init_automap_colors(); - key_code = key_code; // disable warning... - if ((Game_mode & GM_MULTI) && (Function_mode == FMODE_GAME) && (!Endlevel_sequence)) pause_game = 0; diff --git a/main/kmatrix.c b/main/kmatrix.c index 65e52e75..4494b2f7 100644 --- a/main/kmatrix.c +++ b/main/kmatrix.c @@ -180,8 +180,6 @@ void kmatrix_draw_names(int *sorted) } void kmatrix_draw_coop_names(int *sorted) { - sorted=sorted; - if (Kmatrix_nomovie_message) { gr_set_fontcolor( BM_XRGB(63,0,0),-1 ); @@ -201,8 +199,6 @@ void kmatrix_draw_deaths(int *sorted) int y,x; char reactor_message[50]; - sorted=sorted; - y = LHY(55 + 72 + 35); x = LHX(35); diff --git a/main/menu.c b/main/menu.c index 88f2e0c4..5944cf51 100644 --- a/main/menu.c +++ b/main/menu.c @@ -164,10 +164,6 @@ void autodemo_menu_check(int nitems, newmenu_item * items, int *last_key, int ci { int curtime; - nitems = nitems; - items=items; - citem = citem; - //draw copyright message if ( Menu_draw_copyright ) { int w,h,aw; @@ -615,10 +611,6 @@ void do_detail_level_menu(void) // ----------------------------------------------------------------------------- void do_detail_level_menu_custom_menuset(int nitems, newmenu_item * items, int *last_key, int citem ) { - nitems = nitems; - *last_key = *last_key; - citem = citem; - Object_complexity = items[0].value; Object_detail = items[1].value; Wall_detail = items[2].value; @@ -1350,9 +1342,6 @@ WIN(static BOOL windigi_driver_off=FALSE); void sound_menuset(int nitems, newmenu_item * items, int *last_key, int citem ) { - nitems=nitems; - *last_key = *last_key; - if ( Config_digi_volume != items[0].value ) { Config_digi_volume = items[0].value; diff --git a/main/multi.c b/main/multi.c index 6054630c..d1ace410 100644 --- a/main/multi.c +++ b/main/multi.c @@ -1482,8 +1482,6 @@ multi_do_death(int objnum) { // Do any miscellaneous stuff for a new network player after death - objnum = objnum; - if (!(Game_mode & GM_MULTI_COOP)) { mprintf((0, "Setting all keys for player %d.\n", Player_num)); @@ -4054,7 +4052,6 @@ void multi_do_wall_status (char *buf) void multi_send_jason_cheat (int num) { - num=num; return; } @@ -5305,7 +5302,6 @@ multi_process_data(char *buf, int len) // if necessary) and act on it. int type; - len = len; type = buf[0]; diff --git a/main/multibot.c b/main/multibot.c index 2edf9e5a..77ce904c 100644 --- a/main/multibot.c +++ b/main/multibot.c @@ -878,8 +878,6 @@ multi_explode_robot_sub(int botnum, int killer,char isthief) { object *robot; - killer = killer; - if ((botnum < 0) || (botnum > Highest_object_index)) { // Objnum in range? Int3(); // See rob return 0; diff --git a/main/network.c b/main/network.c index d8c28522..25e6e4a9 100644 --- a/main/network.c +++ b/main/network.c @@ -568,11 +568,6 @@ network_endlevel_poll2( int nitems, newmenu_item * menus, int * key, int citem ) int num_ready = 0; int goto_secret = 0; - menus = menus; - citem = citem; - nitems = nitems; - key = key; - // Send our endlevel packet at regular intervals if (timer_get_approx_seconds() > (t1+ENDLEVEL_SEND_INTERVAL)) @@ -610,11 +605,6 @@ network_endlevel_poll3( int nitems, newmenu_item * menus, int * key, int citem ) // Polling loop for End-of-level menu int num_ready=0,i; - - menus = menus; - citem = citem; - nitems = nitems; - key = key; if (timer_get_approx_seconds() > (StartAbortMenuTime+(F1_0 * 8))) *key=-2; @@ -1080,8 +1070,6 @@ void network_send_door_updates(int pnum) // Send door status when new player joins int i; - - pnum=pnum; // Assert (pnum>-1 && pnum t1+ENDLEVEL_SEND_INTERVAL) @@ -4564,10 +4534,6 @@ void network_wait_all_poll( int nitems, newmenu_item * menus, int * key, int cit { static fix t1=0; - menus=menus; - nitems=nitems; - citem=citem; - if (timer_get_approx_seconds() > t1+ALL_INFO_REQUEST_INTERVAL) { network_send_all_info_request(PID_SEND_ALL_GAMEINFO,SecurityCheck); @@ -5824,11 +5790,6 @@ void network_more_game_options () void network_more_options_poll( int nitems, newmenu_item * menus, int * key, int citem ) { - menus = menus; - citem = citem; // kills compile warnings - nitems = nitems; - key = key; - if ( last_cinvul != menus[opt_cinvul].value ) { sprintf( menus[opt_cinvul].text, "%s: %d %s", TXT_REACTOR_LIFE, menus[opt_cinvul].value*5, TXT_MINUTES_ABBREV ); last_cinvul = menus[opt_cinvul].value; @@ -5896,8 +5857,6 @@ void network_send_smash_lights (int pnum) int i; - pnum=pnum; - for (i=0;i<=Highest_segment_index;i++) if (Light_subtracted[i]) multi_send_light_specific(pnum,i,Light_subtracted[i]); @@ -6067,8 +6026,6 @@ int GetNewPlayerNumber (sequence_packet *their) { int i; - their=their; - if ( N_players < MaxNumNetPlayers) return (N_players); diff --git a/main/newmenu.c b/main/newmenu.c index c6741ebf..53a4ee51 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -407,7 +407,6 @@ void nm_string_black( bkg * b, int w1,int x, int y, char * s ) { int w,h,aw; gr_get_string_size(s, &w, &h, &aw ); - b = b; if (w1 == 0) w1 = w; gr_setcolor( BM_XRGB(2,2,2) ); diff --git a/main/state.c b/main/state.c index 3fa0b1e9..15f8f893 100644 --- a/main/state.c +++ b/main/state.c @@ -172,9 +172,6 @@ extern ubyte Hack_DblClick_MenuMode; //------------------------------------------------------------------- void state_callback(int nitems,newmenu_item * items, int * last_key, int citem) { - nitems = nitems; - last_key = last_key; - // if ( sc_last_item != citem ) { // sc_last_item = citem; if ( citem > 0 ) { -- 2.39.2