From: curt Date: Fri, 17 Feb 2006 15:13:42 +0000 (+0000) Subject: Clean up some compiler warnings. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0154f81e3367344b9b467c38ff38b43b226b0db0;p=simgear.git Clean up some compiler warnings. --- diff --git a/simgear/environment/metar.cxx b/simgear/environment/metar.cxx index 1c191963..a2356598 100644 --- a/simgear/environment/metar.cxx +++ b/simgear/environment/metar.cxx @@ -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 } }; diff --git a/simgear/environment/visual_enviro.cxx b/simgear/environment/visual_enviro.cxx index 72a0fba4..01b9a9f1 100644 --- a/simgear/environment/visual_enviro.cxx +++ b/simgear/environment/visual_enviro.cxx @@ -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(); diff --git a/simgear/io/sg_binobj.cxx b/simgear/io/sg_binobj.cxx index 9a6c3268..ffe58a0b 100644 --- a/simgear/io/sg_binobj.cxx +++ b/simgear/io/sg_binobj.cxx @@ -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: diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx index 8193a03f..bec8e48a 100644 --- a/simgear/misc/sg_path.cxx +++ b/simgear/misc/sg_path.cxx @@ -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__) diff --git a/simgear/props/props_io.cxx b/simgear/props/props_io.cxx index ef5462ea..919e29b0 100644 --- a/simgear/props/props_io.cxx +++ b/simgear/props/props_io.cxx @@ -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 () {} diff --git a/simgear/scene/model/location.cxx b/simgear/scene/model/location.cxx index 274c99ce..19ea2122 100644 --- a/simgear/scene/model/location.cxx +++ b/simgear/scene/model/location.cxx @@ -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), diff --git a/simgear/scene/model/shadanim.cxx b/simgear/scene/model/shadanim.cxx index 86c90fed..b8f2e453 100644 --- a/simgear/scene/model/shadanim.cxx +++ b/simgear/scene/model/shadanim.cxx @@ -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); diff --git a/simgear/scene/model/shadowvolume.cxx b/simgear/scene/model/shadowvolume.cxx index 89eef9ce..42210316 100644 --- a/simgear/scene/model/shadowvolume.cxx +++ b/simgear/scene/model/shadowvolume.cxx @@ -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 diff --git a/simgear/scene/sky/cloudfield.cxx b/simgear/scene/sky/cloudfield.cxx index 04b32db7..3bc5fe6b 100644 --- a/simgear/scene/sky/cloudfield.cxx +++ b/simgear/scene/sky/cloudfield.cxx @@ -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);