Removes performance warning in MSVC.

* Removes performance warning about forcing int to true/false.
This commit is contained in:
davyw
2011-12-12 15:00:11 +01:00
parent 993167ede1
commit 07ed8f6968
5 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -1127,7 +1127,7 @@ class SCL_CORE_EXPORT SchRename {
int operator< ( SchRename & schrnm ) {
return ( strcmp( schName, schrnm.schName ) < 0 );
}
int choice( const char * nm ) const;
bool choice( const char * nm ) const;
// is nm one of our possible choices?
char * rename( const char * schm, char * newnm ) const;
// given a schema name, returns new object name if exists
+3 -3
View File
@@ -316,14 +316,14 @@ void TypeDescriptor::addAltName( const char * schnm, const char * newnm ) {
* See if nm = one of our choices (either ours or that of a SchRename
* later in the list.
*/
int SchRename::choice( const char * nm ) const {
bool SchRename::choice( const char * nm ) const {
if( !StrCmpIns( nm, newName ) ) {
return 1;
return true;
}
if( next ) {
return ( next->choice( nm ) );
}
return 0;
return false;
}
/**
+2 -2
View File
@@ -276,10 +276,10 @@ SDAI_Application_instance * Registry::ObjCreate( const char * nm, const char * s
( ( EntityDescriptor * )entd ) -> NewSTEPentity();
// See comment in previous function.
if( entd->AbstractEntity().asInt() == true ) {
if( entd->AbstractEntity().asInt() == 1 ) {
se->Error().severity( SEVERITY_WARNING );
se->Error().UserMsg( "ENTITY is abstract supertype" );
} else if( entd->ExtMapping().asInt() == true ) {
} else if( entd->ExtMapping().asInt() == 1 ) {
se->Error().severity( SEVERITY_WARNING );
se->Error().UserMsg( "ENTITY requires external mapping" );
}
+6 -2
View File
@@ -222,10 +222,14 @@ class SCL_CORE_EXPORT SimpleList : public EntList {
return name;
}
bool contains( char * nm ) {
return *this == nm;
if ( *this == nm )
return true;
return false;
}
bool hit( char * nm ) {
return *this == nm;
if ( *this == nm )
return true;
return false;
}
MatchType matchNonORs( EntNode * );
bool acceptChoice( EntNode * );
+3 -1
View File
@@ -180,7 +180,9 @@ bool DirObj::Reset( const std::string & path ) {
bool DirObj::IsADirectory( const char * path ) {
#if defined(__WIN32__)
return PathIsDirectory( path );
if ( PathIsDirectory( path ) )
return true;
return false;
#else
struct stat st;
return stat( path, &st ) == 0 && ( st.st_mode & S_IFMT ) == S_IFDIR;