From 51f5f01474d5478bd58c135b2f65a7cb3633aae4 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Fri, 3 Oct 2014 15:54:44 -0400 Subject: [PATCH] silence various clang warnings --- CMakeLists.txt | 3 ++- include/ui.h | 23 ++++------------------- src/bmpman/bmpman.cpp | 2 +- src/hud/hudbrackets.cpp | 2 +- src/hud/hudsquadmsg.cpp | 2 +- src/nebedit/nebedit.cpp | 4 ++-- src/popup/popup.cpp | 4 ++-- src/ship/aicode.cpp | 4 ++-- src/sound/acm.cpp | 2 +- src/ui/scroll.cpp | 2 +- src/ui/slider2.cpp | 2 +- src/weapon/swarm.cpp | 2 +- 12 files changed, 19 insertions(+), 33 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cc0783..ee2964c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,8 @@ if(NOT WIN32) set(PLATFORM_LIBRARIES "") add_definitions(-DPLAT_UNIX) - add_definitions(-Wall -Wno-format-y2k -Wno-deprecated) + add_definitions(-Wall) +# add_definitions(-Wno-format-y2k -Wno-deprecated) add_definitions(-fsigned-char) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG -g -O2") diff --git a/include/ui.h b/include/ui.h index ca0b1e7..7b1b1f1 100644 --- a/include/ui.h +++ b/include/ui.h @@ -565,7 +565,7 @@ class UI_BUTTON : public UI_GADGET void reset_timestamps(); void skip_first_highlight_callback(); void repeatable(int yes); - void set_custom_cursor_bmap(int bmap_id) { custom_cursor_bmap = bmap_id; }; + void set_custom_cursor_bmap(int bmap_id) { custom_cursor_bmap = bmap_id; } }; class UI_KEYTRAP : public UI_GADGET @@ -579,21 +579,6 @@ class UI_KEYTRAP : public UI_GADGET void create(UI_WINDOW *wnd, int hotkey, void (*user_function)(void) ); }; -class UI_USERBOX : public UI_GADGET -{ - int b1_held_down; - int b1_clicked; - int b1_double_clicked; - int b1_dragging; - int b1_drag_x1, b1_drag_y1; - int b1_drag_x2, b1_drag_y2; - int b1_done_dragging; - int keypress; - int mouse_onme; - int mouse_x, mouse_y; - int bitmap_number; -}; - class UI_INPUTBOX : public UI_GADGET { char *text; @@ -607,7 +592,7 @@ class UI_INPUTBOX : public UI_GADGET int pixel_limit; // base max characters on how wide the string is (-1 to ignore) in pixels int locked; // int should_reset; - int ignore_escape; +// int ignore_escape; color *text_color; char *valid_chars; char *invalid_chars; @@ -741,7 +726,7 @@ class UI_SCROLLBAR : public UI_GADGET void create(UI_WINDOW *wnd, int _x, int _y, int _h,int _start, int _stop, int _position, int _window_size ); int getpos(); int changed(); - void hide(); + void hide(int n = 1); void unhide(); int get_hidden(); void link_hotspot(int up_button_num, int down_button_num); @@ -800,7 +785,7 @@ class UI_SLIDER2 : public UI_GADGET void forceUp(); // general ui commands - void hide(); + void hide(int n = 1); void unhide(); int get_hidden(); }; diff --git a/src/bmpman/bmpman.cpp b/src/bmpman/bmpman.cpp index d2e3da8..3eac3f1 100644 --- a/src/bmpman/bmpman.cpp +++ b/src/bmpman/bmpman.cpp @@ -643,7 +643,7 @@ static void bm_free_data(int n) // Don't free up memory for user defined bitmaps, since // BmpMan isn't the one in charge of allocating/deallocing them. - if ( ( be->type==BM_TYPE_USER ) ) + if (be->type == BM_TYPE_USER) goto SkipFree; // Free up the data now! diff --git a/src/hud/hudbrackets.cpp b/src/hud/hudbrackets.cpp index 0ca9ddf..7b161b0 100644 --- a/src/hud/hudbrackets.cpp +++ b/src/hud/hudbrackets.cpp @@ -672,7 +672,7 @@ int hud_bracket_num_ships_attacking(int objnum) aip = &Ai_info[Ships[objp->instance].ai_index]; // don't count instructor - int is_training_mission(); + extern int is_training_mission(); if ( is_training_mission() && SDL_strcasecmp(Ships[objp->instance].ship_name, "Instructor") == 0) { break; } diff --git a/src/hud/hudsquadmsg.cpp b/src/hud/hudsquadmsg.cpp index 80f7123..df38a8f 100644 --- a/src/hud/hudsquadmsg.cpp +++ b/src/hud/hudsquadmsg.cpp @@ -2192,7 +2192,7 @@ void hud_squadmsg_reinforcement_select() rp = &Reinforcements[i]; // don't put reinforcements onto the list that have already been used up. - if ( (rp->num_uses == rp->uses) ){ + if (rp->num_uses == rp->uses) { continue; } diff --git a/src/nebedit/nebedit.cpp b/src/nebedit/nebedit.cpp index e2bc6be..20b25f4 100644 --- a/src/nebedit/nebedit.cpp +++ b/src/nebedit/nebedit.cpp @@ -140,7 +140,7 @@ int Font1 = -1; color color_green; -vector Global_light_world = { 0.208758f, -0.688253f, -0.694782f }; +vector Global_light_world = { { { 0.208758f, -0.688253f, -0.694782f } } }; // nebula stuff @@ -422,7 +422,7 @@ void nebula_draw_2d() for (i=0; itype == OBJ_SHIP) ) { + if ( objp->type == OBJ_SHIP ) { ship *shipp; shipp = &Ships[objp->instance]; @@ -2948,7 +2948,7 @@ int find_enemy(int objnum, float range, int max_attackers) // DKA don't undo object as target in nebula missions. // This could cause attack on ship on fringe on nebula to stop if attackee moves our of nebula range. (BAD) - if ( (Objects[target_objnum].signature == aip->target_signature) ) { + if (Objects[target_objnum].signature == aip->target_signature) { if (Ships[Objects[target_objnum].instance].team & enemy_team_mask) { if (!(Objects[target_objnum].flags & OF_PROTECTED)) { // nprintf(("AI", "Frame %i: Object %i resuming goal of object %i\n", AI_FrameCount, objnum, target_objnum)); diff --git a/src/sound/acm.cpp b/src/sound/acm.cpp index 2bbaced..95a586b 100644 --- a/src/sound/acm.cpp +++ b/src/sound/acm.cpp @@ -325,7 +325,7 @@ int ACM_convert_ADPCM_to_PCM(WAVE_chunk *pwfxSrc, ubyte *src, int src_len, ubyte if ( *dest == NULL ) { *dest = (ubyte *)malloc(new_size); - if ( (*dest == NULL) ) { + if (*dest == NULL) { goto Fail; } diff --git a/src/ui/scroll.cpp b/src/ui/scroll.cpp index 2d10ed9..ccb2798 100644 --- a/src/ui/scroll.cpp +++ b/src/ui/scroll.cpp @@ -135,7 +135,7 @@ int UI_SCROLLBAR::set_bmaps(const char *up_button_fname, const char *down_button return 0; } -void UI_SCROLLBAR::hide() +void UI_SCROLLBAR::hide(int n) { hidden = 1; up_button.hide(); diff --git a/src/ui/slider2.cpp b/src/ui/slider2.cpp index 5130edb..c03deb6 100644 --- a/src/ui/slider2.cpp +++ b/src/ui/slider2.cpp @@ -250,7 +250,7 @@ void UI_SLIDER2::process(int focus) } } -void UI_SLIDER2::hide() +void UI_SLIDER2::hide(int n) { hidden = 1; } diff --git a/src/weapon/swarm.cpp b/src/weapon/swarm.cpp index a5533d4..f1f85f5 100644 --- a/src/weapon/swarm.cpp +++ b/src/weapon/swarm.cpp @@ -630,7 +630,7 @@ void turret_swarm_maybe_fire_missile(int shipnum) tsi = &Turret_swarm_info[subsys->turret_swarm_info_index]; // check if parent ship is valid (via signature) - if ( (tsi->parent_sig == parent_obj->signature) ) { + if (tsi->parent_sig == parent_obj->signature) { // make sure we have the right turret. SDL_assert(tsi->turret == subsys); -- 2.39.2