Merge /u/elgaton/simgear/ branch specify-standards-fixes into next

https://sourceforge.net/p/flightgear/simgear/merge-requests/15/
This commit is contained in:
James Turner 2016-05-24 07:02:08 +00:00
commit 5b71d84a3a
5 changed files with 25 additions and 7 deletions

View File

@ -22,6 +22,16 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
# only relevant for building shared libs but let's set it regardless
set(CMAKE_OSX_RPATH 1)
# Set the C++ standard to C++98 to avoid compilation errors on GCC 6 (which
# defaults to C++14).
if(CMAKE_VERSION VERSION_LESS "3.1")
if(CMAKE_COMPILER_IS_GNUCXX)
set (CMAKE_CXX_FLAGS "--std=gnu++98 ${CMAKE_CXX_FLAGS}")
endif()
else()
set (CMAKE_CXX_STANDARD 98)
endif()
project(SimGear)
# read 'version' file into a variable (stripping any newlines or spaces)

View File

@ -80,8 +80,12 @@ void updateBlendingStateGL(VGContext *c, int alphaIsOne)
case VG_BLEND_SRC_OVER: default:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
if (alphaIsOne) glDisable(GL_BLEND);
else glEnable(GL_BLEND); break;
if (alphaIsOne) {
glDisable(GL_BLEND);
} else {
glEnable(GL_BLEND);
}
break;
};
}

View File

@ -648,10 +648,11 @@ bool SGMetar::scanWeather()
weather = pre + weather + post;
weather.erase(weather.length() - 1);
_weather.push_back(weather);
if( ! w.phenomena.empty() )
if( ! w.phenomena.empty() ) {
_weather2.push_back( w );
_grpcount++;
return true;
}
_grpcount++;
return true;
}

View File

@ -384,7 +384,7 @@ void Root::refresh(bool aForce)
CatalogList toRefresh;
CatalogDict::iterator it = d->catalogs.begin();
for (; it != d->catalogs.end(); ++it) {
int age = it->second->ageInSeconds();
unsigned int age = it->second->ageInSeconds();
if (aForce || (age > maxAgeSeconds())) {
toRefresh.push_back(it->second);
}

View File

@ -260,5 +260,8 @@ SGPath SGSoundSample::file_path() const
void SGSoundSample::free_data()
{
if ( _data != NULL ) free( _data ); _data = NULL;
if ( _data != NULL ) {
free( _data );
}
_data = NULL;
}