Browse Source

Static code analysis: fix minor finding.

Kim Kulling 9 years ago
parent
commit
5321072007
3 changed files with 6 additions and 5 deletions
  1. 1 1
      code/ColladaExporter.cpp
  2. 1 0
      code/StringUtils.h
  3. 4 4
      test/unit/utIssues.cpp

+ 1 - 1
code/ColladaExporter.cpp

@@ -530,7 +530,7 @@ void ColladaExporter::ReadMaterialSurface( Surface& poSurface, const aiMaterial*
 // Reimplementation of isalnum(,C locale), because AppVeyor does not see standard version.
 static bool isalnum_C(char c)
 {
-  return strchr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c);
+  return ( nullptr != strchr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c) );
 }
 
 // ------------------------------------------------------------------------------------------------

+ 1 - 0
code/StringUtils.h

@@ -83,6 +83,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #endif
 
 template <typename T>
+inline
 std::string to_string( T value ) {
     std::ostringstream os;
     os << value;

+ 4 - 4
test/unit/utIssues.cpp

@@ -90,9 +90,9 @@ TEST_F( utIssues, OpacityBugWhenExporting_727 ) {
     Assimp::Importer importer;
     Assimp::Exporter exporter;
     for ( std::size_t i( 0 ); i < exporter.GetExportFormatCount(); ++i ) {
-        /*const aiExportFormatDesc *desc( exporter.GetExportFormatDescription( i ) );
-        std::cout << "[" << desc->id << "] ";
-        std::string path( "scene." );
+        std::string path;
+        const aiExportFormatDesc *desc( exporter.GetExportFormatDescription( i ) );
+        EXPECT_NE( desc, nullptr );
         path.append( desc->fileExtension );
 
         ASSERT_EQ( AI_SUCCESS, exporter.Export( scene, desc->id, path ) );
@@ -102,7 +102,7 @@ TEST_F( utIssues, OpacityBugWhenExporting_727 ) {
         if ( newScene->mNumMaterials > 0 ) {
             //ASSERT_EQ( AI_SUCCESS, newScene->mMaterials[ 0 ]->Get( AI_MATKEY_OPACITY, newOpacity ) );
             //EXPECT_EQ( opacity, newOpacity );
-        }*/
+        }
     }
 }