Re: [Flightgear-devel] [PATCH] simgear+flightgear warning cleanup

2005-12-19 Thread Erik Hofman

Vassilii Khachaturov wrote:

Attached are 2 patches for cleaning up some build warnings,
in both simgear and flightgear. Caught with gcc-4.0.


Thanks Vassilli, it's been committed.

Erik

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] [PATCH] simgear+flightgear warning cleanup

2005-12-12 Thread Vassilii Khachaturov
Attached are 2 patches for cleaning up some build warnings,
in both simgear and flightgear. Caught with gcc-4.0.
Please apply...

Vassilii
Index: src/FDM/LaRCsim/ls_model.c
===
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/LaRCsim/ls_model.c,v
retrieving revision 1.4
diff -u -p -r1.4 ls_model.c
--- src/FDM/LaRCsim/ls_model.c  25 Jul 2003 17:53:41 -  1.4
+++ src/FDM/LaRCsim/ls_model.c  12 Dec 2005 09:38:55 -
@@ -154,6 +154,8 @@ Initial Flight Gear revision.
OUTPUTS:
 
 --*/
+#include stdio.h
+
 #include ls_types.h
 #include ls_model.h
 #include default_model_routines.h
Index: src/FDM/SP/ADA.cxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/SP/ADA.cxx,v
retrieving revision 1.3
diff -u -p -r1.3 ADA.cxx
--- src/FDM/SP/ADA.cxx  1 Nov 2005 13:41:50 -   1.3
+++ src/FDM/SP/ADA.cxx  12 Dec 2005 09:38:55 -
@@ -36,7 +36,7 @@
 #define numberofbytes 472 // from FDM to visuals
 #define nbytes 8   //from visuals to FDM
 
-struct {
+static struct {
 double number_of_bytes;
 double lat_geoc;
 double lon_geoc;
@@ -111,7 +111,7 @@ struct {
 
 double view_offset; //if this zero, means center window
 
-struct {
+static struct {
double ground_elevation;
 } visuals_to_sixdof;
 
Index: src/Instrumentation/KLN89/kln89_page_nav.cxx
===
RCS file: 
/var/cvs/FlightGear-0.9/source/src/Instrumentation/KLN89/kln89_page_nav.cxx,v
retrieving revision 1.1
diff -u -p -r1.1 kln89_page_nav.cxx
--- src/Instrumentation/KLN89/kln89_page_nav.cxx30 Nov 2005 00:18:42 
-  1.1
+++ src/Instrumentation/KLN89/kln89_page_nav.cxx12 Dec 2005 09:38:55 
-
@@ -123,12 +123,12 @@ void KLN89NavPage::Update(double dt) {
// Desired and actual magnetic track
if(!_kln89-_obsMode) {
_kln89-DrawText(DTK, 2, 0, 1);
-   _kln89-DrawHeading(_kln89-_dtkMag, 2, 7, 1);
+   _kln89-DrawHeading((int)_kln89-_dtkMag, 2, 7, 
1);
}
_kln89-DrawText(TK, 2, 9, 1);
if(_kln89-_groundSpeed_ms  3) {   // about 6 
knots, don't know exactly what value to disable track
// The trouble with relying on FG gps's track 
value is we don't know when it's valid.
-   _kln89-DrawHeading(_kln89-_magTrackDeg, 2, 
15, 1);
+   _kln89-DrawHeading((int)_kln89-_magTrackDeg, 
2, 15, 1);
} else {
_kln89-DrawText(---, 2, 12, 1);
_kln89-DrawSpecialChar(0, 2, 15, 1);
Index: simgear/environment/visual_enviro.cxx
===
RCS file: /var/cvs/SimGear-0.3/source/simgear/environment/visual_enviro.cxx,v
retrieving revision 1.5
diff -u -p -r1.5 visual_enviro.cxx
--- simgear/environment/visual_enviro.cxx   30 May 2005 09:04:57 -  
1.5
+++ simgear/environment/visual_enviro.cxx   12 Dec 2005 09:03:05 -
@@ -419,7 +419,8 @@ void SGEnviro::drawRain(double pitch, do
glDisable( GL_FOG );
glDisable(GL_LIGHTING);
 
-   int slice_count = (40.0 + rain_norm*150.0)* precipitation_density / 
100.0;
+   int slice_count = static_castint(
+   (40.0 + rain_norm*150.0)* precipitation_density 
/ 100.0);
 
float angle = speed;
if( angle  90.0 )
@@ -500,7 +501,7 @@ void SGLightning::lt_build_tree_branch(i
 nseg++;
// add a branch
 if( energy * sg_random()  0.8f )
-   lt_build_tree_branch(tree_nr + 1, pt, energy * 0.9f, 
nbseg == 50 ? 10 : nbseg * 0.4f, segsize * 0.7f);
+   lt_build_tree_branch(tree_nr + 1, pt, energy * 0.9f, 
nbseg == 50 ? 10 : static_castint(nbseg * 0.4f), segsize * 0.7f);
 
if( nb_tree = MAX_LT_TREE_SEG )
return;
Index: simgear/io/sg_binobj.cxx
===
RCS file: /var/cvs/SimGear-0.3/source/simgear/io/sg_binobj.cxx,v
retrieving revision 1.9
diff -u -p -r1.9 sg_binobj.cxx
--- simgear/io/sg_binobj.cxx12 Oct 2005 16:43:26 -  1.9
+++ simgear/io/sg_binobj.cxx12 Dec 2005 09:03:05 -
@@ -45,7 +45,7 @@ SG_USING_STD( string );
 SG_USING_STD( vector );
 
 
-enum {
+static enum {
 SG_BOUNDING_SPHERE = 0,
 
 SG_VERTEX_LIST = 1,
@@ -60,14 +60,14 @@ enum {
 SG_TRIANGLE_FANS = 12
 } sgObjectTypes;
 
-enum {
+static enum {
 SG_IDX_VERTICES =  0x01,
 SG_IDX_NORMALS =   0x02,
 SG_IDX_COLORS =0x04,
 SG_IDX_TEXCOORDS = 0x08
 } sgIndexTypes;
 
-enum {