Browse Source

122219-122218 Big parameter passed by value

wise86Android 9 năm trước cách đây
mục cha
commit
96fab1cf55
3 tập tin đã thay đổi với 9 bổ sung9 xóa
  1. 1 1
      code/XFileExporter.cpp
  2. 1 1
      code/XFileExporter.h
  3. 7 7
      include/assimp/metadata.h

+ 1 - 1
code/XFileExporter.cpp

@@ -513,7 +513,7 @@ std::string XFileExporter::toXFileString(aiString &name)
     return str;
 }
 
-void XFileExporter::writePath(aiString path)
+void XFileExporter::writePath(const aiString &path)
 {
     std::string str = std::string(path.C_Str());
     BaseImporter::ConvertUTF8toISO8859_1(str);

+ 1 - 1
code/XFileExporter.h

@@ -107,7 +107,7 @@ protected:
     const ExportProperties* mProperties;
 
     /// write a path
-    void writePath(aiString path);
+    void writePath(const aiString &path);
 
     /// The IOSystem for output
     IOSystem* mIOSystem;

+ 7 - 7
include/assimp/metadata.h

@@ -105,13 +105,13 @@ struct aiMetadataEntry
   * Helper functions to get the aiType enum entry for a type
   */
  // -------------------------------------------------------------------------------
-inline aiMetadataType GetAiType( bool ) { return AI_BOOL; }
-inline aiMetadataType GetAiType( int ) { return AI_INT; }
-inline aiMetadataType GetAiType( uint64_t ) { return AI_UINT64; }
-inline aiMetadataType GetAiType( float ) { return AI_FLOAT; }
-inline aiMetadataType GetAiType( double ) { return AI_DOUBLE; }
-inline aiMetadataType GetAiType( aiString ) { return AI_AISTRING; }
-inline aiMetadataType GetAiType( aiVector3D ) { return AI_AIVECTOR3D; }
+inline aiMetadataType GetAiType( const bool& ) { return AI_BOOL; }
+inline aiMetadataType GetAiType( const int& ) { return AI_INT; }
+inline aiMetadataType GetAiType( const uint64_t& ) { return AI_UINT64; }
+inline aiMetadataType GetAiType( const float& ) { return AI_FLOAT; }
+inline aiMetadataType GetAiType( const double& ) { return AI_DOUBLE; }
+inline aiMetadataType GetAiType( const aiString& ) { return AI_AISTRING; }
+inline aiMetadataType GetAiType( const aiVector3D& ) { return AI_AIVECTOR3D; }