Fixed a warning in soundmgr.cxx.
: _type(FGTextLayer::TEXT), _fmt(fmt)
{
_text = text;
- if (_fmt == "")
+ if (_fmt.empty())
_fmt = "%s";
}
const string &fmt, float mult)
: _type(type), _fmt(fmt), _mult(mult)
{
- if (_fmt == "") {
+ if (_fmt.empty()) {
if (type == TEXT_VALUE)
_fmt = "%s";
else
type = "rotation";
}
- if (propName != (string)"") {
+ if (!propName.empty()) {
target = fgGetNode(propName.c_str(), true);
}
// Get multibackground if any...
//
string mbgTexture = root->getStringValue("multibackground[0]");
- if (mbgTexture != (string)"") {
+ if (!mbgTexture.empty()) {
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 0);
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
string msg = txt;
msg += '\n';
msg += throwable.getFormattedMessage();
- if (throwable.getOrigin() != (string)"") {
+ if (!throwable.getOrigin().empty()) {
msg += "\n (reported by ";
msg += throwable.getOrigin();
msg += ')';
}
_command_name = node->getStringValue("command", "");
- if (_command_name == "") {
+ if (_command_name.empty()) {
SG_LOG(SG_INPUT, SG_ALERT, "No command supplied for binding.");
_command = 0;
return;
#if defined( unix ) || defined( __CYGWIN__ )
// Next check home directory for .fgfsrc.hostname file
- if ( root == "" ) {
+ if ( root.empty() ) {
envp = ::getenv( "HOME" );
if ( envp != NULL ) {
SGPath config( envp );
#endif
// Next check home directory for .fgfsrc file
- if ( root == "" ) {
+ if ( root.empty() ) {
envp = ::getenv( "HOME" );
if ( envp != NULL ) {
SGPath config( envp );
}
// Next check if fg-root is set as an env variable
- if ( root == "" ) {
+ if ( root.empty() ) {
envp = ::getenv( "FG_ROOT" );
if ( envp != NULL ) {
root = envp;
// Otherwise, default to a random compiled-in location if we can't
// find fg-root any other way.
- if ( root == "" ) {
+ if ( root.empty() ) {
#if defined( __CYGWIN__ )
root = "/FlightGear";
#elif defined( WIN32 )
string result = "";
for (int i = 0; log_class_mappings[i].c != SG_UNDEFD; i++) {
if ((classes&log_class_mappings[i].c) > 0) {
- if (result != (string)"")
+ if (!result.empty())
result += '|';
result += log_class_mappings[i].name;
}
return;
}
- if (classes == "" || classes == "all") { // default
+ if (classes.empty() || classes == "all") { // default
logbuf::set_log_classes(SG_ALL);
SG_LOG(SG_GENERAL, SG_INFO, "Enabled all logging classes: "
<< getLoggingClasses());
logbuf::set_log_priority(SG_BULK);
} else if (priority == "debug") {
logbuf::set_log_priority(SG_DEBUG);
- } else if (priority == "" || priority == "info") { // default
+ } else if (priority.empty() || priority == "info") { // default
logbuf::set_log_priority(SG_INFO);
} else if (priority == "warn") {
logbuf::set_log_priority(SG_WARN);
FGFix *fix, double *heading, double *dist )
{
*fix = fixlist[ident];
- if ( fix->get_ident() == "" ) {
+ if ( fix->get_ident().empty() ) {
return false;
}
}
} else if ( command == "pwd" ) {
string ttt = node->getPath();
- if ( ttt == "" ) {
+ if ( ttt.empty() ) {
ttt = "/";
}
ttt += "\n";
if ( mode == PROMPT ) {
string prompt = node->getPath();
- if ( prompt == "" ) {
+ if ( prompt.empty() ) {
prompt = "/";
}
prompt += "> ";
static bool beenhere = false;
if (!beenhere)
{
- if ( globals->get_fg_scenery() != (string)"" ) {
+ if ( !globals->get_fg_scenery().empty() ) {
tile_path.set( globals->get_fg_scenery() );
} else {
tile_path.set( globals->get_fg_root() );
string path_str = node->getStringValue("path");
SGPath path( globals->get_fg_root() );
- if (path_str == "") {
+ if (path_str.empty()) {
SG_LOG(SG_GENERAL, SG_ALERT, "Incorrect path in configuration file.");
return;
}
// constructor
FGSimpleSound::FGSimpleSound( string file )
- : requests(0),
+ : pitch(1.0),
volume(1.0),
- pitch(1.0)
+ requests(0)
{
SGPath slfile( globals->get_fg_root() );
slfile.append( file );
}
FGSimpleSound::FGSimpleSound( unsigned char *buffer, int len )
- : requests(0),
+ : pitch(1.0),
volume(1.0),
- pitch(1.0)
+ requests(0)
{
sample = new slSample ( buffer, len );
pitch_envelope = new slEnvelope( 1, SL_SAMPLE_ONE_SHOT );
FGSimpleSound *FGSoundMgr::add( const string& refname, const string &file ) {
FGSimpleSound *sound;
- if (file == (string)"")
+ if (file.empty())
return NULL;
sample_map_iterator it = samples.find(file);