]> git.mxchange.org Git - simgear.git/commitdiff
Clean up some compiler warnings.
authorcurt <curt>
Fri, 17 Feb 2006 15:13:42 +0000 (15:13 +0000)
committercurt <curt>
Fri, 17 Feb 2006 15:13:42 +0000 (15:13 +0000)
simgear/environment/metar.cxx
simgear/environment/visual_enviro.cxx
simgear/io/sg_binobj.cxx
simgear/misc/sg_path.cxx
simgear/props/props_io.cxx
simgear/scene/model/location.cxx
simgear/scene/model/shadanim.cxx
simgear/scene/model/shadowvolume.cxx
simgear/scene/sky/cloudfield.cxx

index 1c19196354b67e4a5c4e5d0808032a8618649824..a23565989b633fccf936e95b1fac8721e8e1bd73 100644 (file)
@@ -609,52 +609,52 @@ bool SGMetar::scanRwyVisRange()
 
 
 static const struct Token special[] = {
-       "NSW",  "no significant weather",
-       "VCSH", "showers in the vicinity",
-       "VCTS", "thunderstorm in the vicinity",
-       0, 0
+       { "NSW",  "no significant weather" },
+       { "VCSH", "showers in the vicinity" },
+       { "VCTS", "thunderstorm in the vicinity" },
+       { 0, 0 }
 };
 
 
 static const struct Token description[] = {
-       "SH",   "showers of",
-       "TS",   "thunderstorm with",
-       "BC",   "patches of",
-       "BL",   "blowing",
-       "DR",   "low drifting",
-       "FZ",   "freezing",
-       "MI",   "shallow",
-       "PR",   "partial",
-       0, 0
+       { "SH", "showers of" },
+       { "TS", "thunderstorm with" },
+       { "BC", "patches of" },
+       { "BL", "blowing" },
+       { "DR", "low drifting" },
+       { "FZ", "freezing" },
+       { "MI", "shallow" },
+       { "PR", "partial" },
+       { 0, 0 }
 };
 
 
 static const struct Token phenomenon[] = {
-       "DZ",   "drizzle",
-       "GR",   "hail",
-       "GS",   "small hail and/or snow pellets",
-       "IC",   "ice crystals",
-       "PE",   "ice pellets",
-       "RA",   "rain",
-       "SG",   "snow grains",
-       "SN",   "snow",
-       "UP",   "unknown precipitation",
-       "BR",   "mist",
-       "DU",   "widespread dust",
-       "SG",   "fog",
-       "SGBR", "fog bank",
-       "FU",   "smoke",
-       "HZ",   "haze",
-       "PY",   "spray",
-       "SA",   "sand",
-       "VA",   "volcanic ash",
-       "DS",   "duststorm",
-       "FC",   "funnel cloud/tornado waterspout",
-       "PO",   "well-developed dust/sand whirls",
-       "SQ",   "squalls",
-       "SS",   "sandstorm",
-       "UP",   "unknown",      // ... due to failed automatic acquisition
-       0, 0
+       { "DZ", "drizzle" },
+       { "GR", "hail" },
+       { "GS", "small hail and/or snow pellets" },
+       { "IC", "ice crystals" },
+       { "PE", "ice pellets" },
+       { "RA", "rain" },
+       { "SG", "snow grains" },
+       { "SN", "snow" },
+       { "UP", "unknown precipitation" },
+       { "BR", "mist" },
+       { "DU", "widespread dust" },
+       { "SG", "fog" },
+       { "SGBR",       "fog bank" },
+       { "FU", "smoke" },
+       { "HZ", "haze" },
+       { "PY", "spray" },
+       { "SA", "sand" },
+       { "VA", "volcanic ash" },
+       { "DS", "duststorm" },
+       { "FC", "funnel cloud/tornado waterspout" },
+       { "PO", "well-developed dust/sand whirls" },
+       { "SQ", "squalls" },
+       { "SS", "sandstorm" },
+       { "UP", "unknown" },    // ... due to failed automatic acquisition
+       { 0, 0 }
 };
 
 
@@ -714,26 +714,26 @@ bool SGMetar::scanWeather()
 
 
 static const struct Token cloud_types[] = {
-       "AC",    "altocumulus",
-       "ACC",   "altocumulus castellanus",
-       "ACSL",  "altocumulus standing lenticular",
-       "AS",    "altostratus",
-       "CB",    "cumulonimbus",
-       "CBMAM", "cumulonimbus mammatus",
-       "CC",    "cirrocumulus",
-       "CCSL",  "cirrocumulus standing lenticular",
-       "CI",    "cirrus",
-       "CS",    "cirrostratus",
-       "CU",    "cumulus",
-       "CUFRA", "cumulus fractus",
-       "NS",    "nimbostratus",
-       "SAC",   "stratoaltocumulus",           // guessed
-       "SC",    "stratocumulus",
-       "SCSL",  "stratocumulus standing lenticular",
-       "ST",    "stratus",
-       "STFRA", "stratus fractus",
-       "TCU",   "towering cumulus",
-       0, 0
+       { "AC",   "altocumulus" },
+       { "ACC",  "altocumulus castellanus" },
+       { "ACSL", "altocumulus standing lenticular" },
+       { "AS",   "altostratus" },
+       { "CB",   "cumulonimbus" },
+       { "CBMAM", "cumulonimbus mammatus" },
+       { "CC",   "cirrocumulus" },
+       { "CCSL", "cirrocumulus standing lenticular" },
+       { "CI",   "cirrus" },
+       { "CS",   "cirrostratus" },
+       { "CU",   "cumulus" },
+       { "CUFRA", "cumulus fractus" },
+       { "NS",   "nimbostratus" },
+       { "SAC",  "stratoaltocumulus" },                // guessed
+       { "SC",   "stratocumulus" },
+       { "SCSL", "stratocumulus standing lenticular" },
+       { "ST",   "stratus" },
+       { "STFRA", "stratus fractus" },
+       { "TCU",   "towering cumulus" },
+       { 0, 0 }
 };
 
 
@@ -1076,13 +1076,13 @@ bool SGMetar::scanTrendForecast()
 
 // (BLU|WHT|GRN|YLO|AMB|RED)
 static const struct Token colors[] = {
-       "BLU", "Blue",          // 2500 ft,  8.0 km
-       "WHT", "White",         // 1500 ft,  5.0 km
-       "GRN", "Green",         //  700 ft,  3.7 km
-       "YLO", "Yellow",        //  300 ft,  1.6 km
-       "AMB", "Amber",         //  200 ft,  0.8 km
-       "RED", "Red",           // <200 ft, <0.8 km
-       0, 0
+       { "BLU", "Blue" },      // 2500 ft,  8.0 km
+       { "WHT", "White" },     // 1500 ft,  5.0 km
+       { "GRN", "Green" },     //  700 ft,  3.7 km
+       { "YLO", "Yellow" },    //  300 ft,  1.6 km
+       { "AMB", "Amber" },     //  200 ft,  0.8 km
+       { "RED", "Red" },       // <200 ft, <0.8 km
+       { 0, 0 }
 };
 
 
index 72a0fba43ee3a47c5985cfa91d527e72c9054031..01b9a9f1cb2b37ad24673c4119d3438cfb9fcccb 100644 (file)
@@ -88,21 +88,21 @@ SGEnviro sgEnviro;
 
 SGEnviro::SGEnviro(void) :
        view_in_cloud(false),
-       turbulence_enable_state(false),
        precipitation_enable_state(true),
-       lightning_enable_state(false),
-       soundMgr(NULL),
-       snd_active(false),
-       snd_dist(0.0),
+       precipitation_density(100.0),
+       precipitation_max_alt(0.0),
+       turbulence_enable_state(false),
        last_cloud_turbulence(0.0),
        cloud_turbulence(0.0),
+       lightning_enable_state(false),
        elapsed_time(0.0),
        dt(0.0),
+       soundMgr(NULL),
+       snd_active(false),
+       snd_dist(0.0),
        min_time_before_lt(0.0),
        fov_width(55.0),
-       fov_height(55.0),
-       precipitation_max_alt(0.0),
-       precipitation_density(100.0)
+       fov_height(55.0)
 
 {
        for(int i = 0; i < MAX_RAIN_SLICE ; i++)
@@ -469,11 +469,11 @@ void SGEnviro::drawPrecipitation(double rain_norm, double snow_norm, double hail
 
 
 SGLightning::SGLightning(double _lon, double _lat, double _alt) :
+       nb_tree(0),
        lon(_lon),
        lat(_lat),
        alt(_alt),
-       age(1.0 + sg_random() * 4.0),
-       nb_tree(0)
+       age(1.0 + sg_random() * 4.0)
 {
 //     sequence_count = 1 + sg_random() * 5.0;
        lt_build();
index 9a6c3268eb91754998e1b581a667ad1ef527361a..ffe58a0b8c7bf4177014c6c929005584c276f010 100644 (file)
@@ -46,7 +46,7 @@ SG_USING_STD( string );
 SG_USING_STD( vector );
 
 
-static enum {
+enum {
     SG_BOUNDING_SPHERE = 0,
 
     SG_VERTEX_LIST = 1,
@@ -61,20 +61,19 @@ static enum {
     SG_TRIANGLE_FANS = 12
 } sgObjectTypes;
 
-static enum {
+enum {
     SG_IDX_VERTICES =  0x01,
     SG_IDX_NORMALS =   0x02,
     SG_IDX_COLORS =    0x04,
     SG_IDX_TEXCOORDS = 0x08
 } sgIndexTypes;
 
-static enum {
+enum {
     SG_MATERIAL = 0,
     SG_INDEX_TYPES = 1
 } sgPropertyTypes;
 
 
-
 class sgSimpleBuffer {
 
 private:
index 8193a03fe4e7899877ee6d4a237777d1b7cde31d..bec8e48a090e340c8003e24b77a20ff4a62dd7cf 100644 (file)
@@ -200,7 +200,7 @@ void SGPath::create_dir( mode_t mode ) {
     string_list path_elements = sgPathBranchSplit(path);
     bool absolute = !path.empty() && path[0] == sgDirPathSep;
 
-    int i = 1;
+    unsigned int i = 1;
     SGPath dir = absolute ? string( 1, sgDirPathSep ) : "";
     dir.concat( path_elements[0] );
 #if defined( _MSC_VER) || defined(__MINGW32__)
index ef5462ea5afe937646cfa7bf7d80a1919646f078..919e29b095fae5d1664b52090a85bbe450f96bd9 100644 (file)
@@ -38,7 +38,7 @@ class PropsVisitor : public XMLVisitor
 public:
 
   PropsVisitor (SGPropertyNode * root, const string &base, int default_mode = 0)
-    : _root(root), _level(0), _base(base), _hasException(false), _default_mode(default_mode) {}
+    : _default_mode(default_mode), _root(root), _level(0), _base(base), _hasException(false) {}
 
   virtual ~PropsVisitor () {}
 
index 274c99ce4a18929fcc7c63f6f1401aeb0e6f6ac1..19ea2122ca78007b28fd86ba4b15694e3706a8c3 100644 (file)
@@ -102,7 +102,8 @@ static void MakeTRANS( sgMat4 dst, const double Theta,
 
 // Constructor
 SGLocation::SGLocation( void ):
-    _position_dirty(true), _orientation_dirty(true),
+    _orientation_dirty(true),
+    _position_dirty(true),
     _lon_deg(-1000),
     _lat_deg(0),
     _alt_ft(0),
index 86c90fed72fa0ddd6ba095708067d0863e378cd2..b8f2e4536864d2cb2be052e1f7abc1afe29c7414 100644 (file)
@@ -213,7 +213,7 @@ static int heat_haze_shader_callback( ssgEntity *e ) {
         sgMat4 CameraProjM, CameraViewM;
         glGetFloatv(GL_PROJECTION_MATRIX, (GLfloat *) CameraProjM);
         glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat *) CameraViewM);
-        const float dummy_scale = 1.0f; //0.95f;
+        // const float dummy_scale = 1.0f; //0.95f;
         const float deltaPos = 0.05f;
         glMatrixMode(GL_TEXTURE);
             glLoadIdentity();
@@ -268,7 +268,7 @@ static int heat_haze_shader_callback( ssgEntity *e ) {
         glCallList ( dlist ) ;
 
         // alter colors only on last rendering
-        sgVec4 fLight = {0.93f, 0.93f, 1.00f, 0.85f};
+        // sgVec4 fLight = {0.93f, 0.93f, 1.00f, 0.85f};
         glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_PRIMARY_COLOR_ARB );
         glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR ); 
 
@@ -328,7 +328,7 @@ static int fresnel_shader_callback( ssgEntity *e ) {
     ssgGetLight( 0 )->getColour(GL_DIFFUSE, sunColor );
     ssgGetLight( 0 )->getColour(GL_AMBIENT, ambientColor );
 
-    SGShaderAnimation *my_shader = (SGShaderAnimation *) ( e->getUserData() );
+    // SGShaderAnimation *my_shader = (SGShaderAnimation *) ( e->getUserData() );
     glEnable(GL_BLEND);
        glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ;
        glEnable(GL_ALPHA_TEST);
index 89eef9ce23895b25e42caef4397b640b73d398aa..422103165bbfb8da0572ca93a7d02851fea915a2 100644 (file)
@@ -100,8 +100,8 @@ SGShadowVolume::ShadowCaster::ShadowCaster( int _num_tri, ssgBranch * _geometry_
        scenery_object ( 0 ),
        first_select ( 0 ),
        frameNumber ( 0 ),
-       numTriangles ( 0 ),
        indices ( 0 ),
+       numTriangles ( 0 ),
        vertices ( 0 ),
        lastSilhouetteIndicesCount ( 0 )
 {
@@ -638,7 +638,7 @@ static bool filterLeaf(ssgLeaf *this_kid) {
        if( ! leaf_name )
                return true;
        char lname[20];
-       int l = 0;
+       unsigned int l = 0;
        char *buff;
        for( buff = lname; *leaf_name && l < (sizeof( lname )-1); ++buff, l++ )
             *buff = tolower(*leaf_name++);
@@ -702,9 +702,9 @@ void SGShadowVolume::SceneryObject::find_trans(void) {
 }
 
 SGShadowVolume::SceneryObject::SceneryObject(ssgBranch *_scenery_object, OccluderType _occluder_type) :
-       pending_object ( _scenery_object ),
-       occluder_type ( _occluder_type ),
-       scenery_object ( 0 )
+        scenery_object ( 0 ),
+        pending_object ( _scenery_object ),
+        occluder_type ( _occluder_type )
 {
        // queue objects, don't do all the work in the first frames because of
        // massive cpu power needed
index 04b32db76285883ecc85544659985986b81c7e15..3bc5fe6bc138b7fe3b1df0d701e6a7a15ccb20c7 100644 (file)
@@ -209,11 +209,11 @@ void SGCloudField::reposition( sgVec3 p, sgVec3 up, double lon, double lat, doub
 }
 
 SGCloudField::SGCloudField() :
-       draw_in_3d(true),
-       last_density(0.0),
        deltax(0.0),
        deltay(0.0),
-       last_course(0.0)
+       last_course(0.0),
+       last_density(0.0),
+       draw_in_3d(true)
 {
        sgSetVec3( relative_position, 0,0,0);
        theField.reserve(200);