From e9e545db3db17c5a0cd65f14ef01d3990752983b Mon Sep 17 00:00:00 2001 From: theoddone33 Date: Sat, 13 Jul 2002 19:47:02 +0000 Subject: [PATCH] Fix some more warnings Change demo building, edit Makefile if you want the demo. --- Makefile | 5 +++++ include/pstypes.h | 7 ++++++- src/physics/physics.cpp | 19 ++++++++++++------- src/ship/aicode.cpp | 7 ++++++- src/ship/shiphit.cpp | 7 ++++++- src/ui/slider.cpp | 11 ++++++++--- 6 files changed, 43 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index b023ef8..9fcfae0 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ # for that freespace 2 thing MACOSX=false +DEMO=false CC=g++ AR=ar @@ -22,6 +23,10 @@ else LDFLAGS+= -lGL endif +ifeq ($(strip $(DEMO)), true) + CFLAGS += -DFS2_DEMO +endif + %.o: %.cpp $(CC) -c -o $@ $< $(CFLAGS) diff --git a/include/pstypes.h b/include/pstypes.h index f3b280f..49650dd 100644 --- a/include/pstypes.h +++ b/include/pstypes.h @@ -15,6 +15,11 @@ * Header file containg global typedefs, constants and macros * * $Log$ + * Revision 1.7 2002/07/13 19:47:02 theoddone33 + * Fix some more warnings + * + * Change demo building, edit Makefile if you want the demo. + * * Revision 1.6 2002/06/19 04:52:45 relnev * MacOS X updates (Ryan) * @@ -194,7 +199,7 @@ // #define MULTIPLAYER_BETA_BUILD // enable for multiplayer beta build // #define E3_BUILD // enable for 3dfx E3 build // #define PRESS_TOUR_BUILD // enable for press tour build -#define FS2_DEMO // enable demo build for FS2 +//#define FS2_DEMO // enable demo build for FS2 // #define PD_BUILD // fred documentation/evaluation build // #define FRENCH_BUILD // build for French (obsolete) // #define GERMAN_BUILD // build for German (this is now used) diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp index a595046..e16afed 100644 --- a/src/physics/physics.cpp +++ b/src/physics/physics.cpp @@ -15,6 +15,11 @@ * Physics stuff * * $Log$ + * Revision 1.5 2002/07/13 19:47:02 theoddone33 + * Fix some more warnings + * + * Change demo building, edit Makefile if you want the demo. + * * Revision 1.4 2002/06/17 06:33:10 relnev * ryan's struct patch for gcc 2.95 * @@ -432,9 +437,9 @@ void physics_init( physics_info * pi ) pi->flags = 0; // default values for moment of inetaia - vm_vec_make( &pi->I_body_inv.v.rvec, 1e-5f, 0.0f, 0.0f ); - vm_vec_make( &pi->I_body_inv.v.uvec, 0.0f, 1e-5f, 0.0f ); - vm_vec_make( &pi->I_body_inv.v.fvec, 0.0f, 0.0f, 1e-5f ); + (void) vm_vec_make( &pi->I_body_inv.v.rvec, 1e-5f, 0.0f, 0.0f ); + (void) vm_vec_make( &pi->I_body_inv.v.uvec, 0.0f, 1e-5f, 0.0f ); + (void) vm_vec_make( &pi->I_body_inv.v.fvec, 0.0f, 0.0f, 1e-5f ); } @@ -675,12 +680,12 @@ void physics_sim_vel(vector * position, physics_info * pi, float sim_time, matri // ie. shockwave, collision, weapon, dead if (pi->flags & PF_DEAD_DAMP) { // side_slip_time_const is already quite large and now needs to be applied in all directions - vm_vec_make( &damp, pi->side_slip_time_const, pi->side_slip_time_const, pi->side_slip_time_const ); + (void) vm_vec_make( &damp, pi->side_slip_time_const, pi->side_slip_time_const, pi->side_slip_time_const ); } else if (pi->flags & PF_REDUCED_DAMP) { // case of shock, weapon, collide, etc. if ( timestamp_elapsed(pi->reduced_damp_decay) ) { - vm_vec_make( &damp, pi->side_slip_time_const, pi->side_slip_time_const, 0.0f ); + (void) vm_vec_make( &damp, pi->side_slip_time_const, pi->side_slip_time_const, 0.0f ); } else { // damp is multiplied by fraction and not fraction^2, gives better collision separation float reduced_damp_fraction_time_left = timestamp_until( pi->reduced_damp_decay ) / (float) REDUCED_DAMP_TIME; @@ -690,7 +695,7 @@ void physics_sim_vel(vector * position, physics_info * pi, float sim_time, matri } } else { // regular damping - vm_vec_make( &damp, pi->side_slip_time_const, pi->side_slip_time_const, 0.0f ); + (void) vm_vec_make( &damp, pi->side_slip_time_const, pi->side_slip_time_const, 0.0f ); } // Note: CANNOT maintain a *local velocity* since a rotation can occur in this frame. @@ -1182,7 +1187,7 @@ void physics_apply_shock(vector *direction_vec, float pressure, physics_info *pi sin.xyz.y = fl_sqrt( fl_abs(1.0f - normal.xyz.y*normal.xyz.y) ); sin.xyz.z = fl_sqrt( fl_abs(1.0f - normal.xyz.z*normal.xyz.z) ); - vm_vec_make( &torque, 0.0f, 0.0f, 0.0f ); + (void) vm_vec_make( &torque, 0.0f, 0.0f, 0.0f ); // find the torque exerted due to the shockwave hitting each face // model the effect of the shockwave as if the shockwave were a plane of projectiles, diff --git a/src/ship/aicode.cpp b/src/ship/aicode.cpp index b3dca38..ca60fb1 100644 --- a/src/ship/aicode.cpp +++ b/src/ship/aicode.cpp @@ -15,6 +15,11 @@ * AI code that does interesting stuff * * $Log$ + * Revision 1.6 2002/07/13 19:47:02 theoddone33 + * Fix some more warnings + * + * Change demo building, edit Makefile if you want the demo. + * * Revision 1.5 2002/06/17 06:33:10 relnev * ryan's struct patch for gcc 2.95 * @@ -11802,7 +11807,7 @@ int ai_formation() } else if (dist_to_goal > 10.0f) { float dv; - future_goal_point_2; + //future_goal_point_2; turn_towards_point(Pl_objp, &future_goal_point_2, NULL, 0.0f); diff --git a/src/ship/shiphit.cpp b/src/ship/shiphit.cpp index 529ab02..f35b0fe 100644 --- a/src/ship/shiphit.cpp +++ b/src/ship/shiphit.cpp @@ -15,6 +15,11 @@ * Code to deal with a ship getting hit by something, be it a missile, dog, or ship. * * $Log$ + * Revision 1.6 2002/07/13 19:47:02 theoddone33 + * Fix some more warnings + * + * Change demo building, edit Makefile if you want the demo. + * * Revision 1.5 2002/06/17 06:33:11 relnev * ryan's struct patch for gcc 2.95 * @@ -502,7 +507,7 @@ bool is_subsys_destroyed(ship *shipp, int submodel) ship_subsys *subsys; if (submodel == -1) { - false; + return false; } for ( subsys=GET_FIRST(&shipp->subsys_list); subsys != END_OF_LIST(&shipp->subsys_list); subsys = GET_NEXT(subsys) ) { diff --git a/src/ui/slider.cpp b/src/ui/slider.cpp index a555f0e..8709b4b 100644 --- a/src/ui/slider.cpp +++ b/src/ui/slider.cpp @@ -15,6 +15,11 @@ * C++ file for controlling and displaying a horizontal slider * * $Log$ + * Revision 1.4 2002/07/13 19:47:02 theoddone33 + * Fix some more warnings + * + * Change demo building, edit Makefile if you want the demo. + * * Revision 1.3 2002/06/09 04:41:29 relnev * added copyright header * @@ -257,7 +262,7 @@ void UI_DOT_SLIDER::create(UI_WINDOW *wnd, int _x, int _y, char *bm, int id, int num_pos = _num_pos; - sprintf(filename, "%s%0.2d", bm, hotspot); + sprintf(filename, "%s%.2d", bm, hotspot); first_frame = bm_load_animation(filename, &total_frames); if (first_frame < 0) { Error(LOCATION, "Could not load %s.ani\n", filename); @@ -281,7 +286,7 @@ void UI_DOT_SLIDER::create(UI_WINDOW *wnd, int _x, int _y, char *bm, int id, int if ( has_end_buttons ) { // Second button is the up (increase) button - sprintf(filename, "%s%0.2d", bm, id + 2); + sprintf(filename, "%s%.2d", bm, id + 2); up_button.create( wnd, "", _x + 216, _y, 22, 24, 1, 1 ); up_button.set_parent(this); up_button.set_highlight_action(common_play_highlight_sound); @@ -289,7 +294,7 @@ void UI_DOT_SLIDER::create(UI_WINDOW *wnd, int _x, int _y, char *bm, int id, int up_button.link_hotspot(id + 2); // Third button is the down (decrease) button - sprintf(filename, "%s%0.2d", bm, id); + sprintf(filename, "%s%.2d", bm, id); down_button.create( wnd, "", _x, _y, 22, 24, 1, 1 ); down_button.set_parent(this); down_button.set_highlight_action(common_play_highlight_sound); -- 2.39.2