From dec93efc92a6b34d8cc9e080381d6429c4b7f04b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 16 Apr 2016 18:42:49 +0200 Subject: [PATCH] AssxmlExporter: fix crash in writing header info in VS2015. --- code/AssxmlExporter.cpp | 14 +++++++------- test/regression/ai_regression_ui.py | 14 +++++++------- test/regression/run.py | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/code/AssxmlExporter.cpp b/code/AssxmlExporter.cpp index 669ff64ca..2e1222fc1 100644 --- a/code/AssxmlExporter.cpp +++ b/code/AssxmlExporter.cpp @@ -180,23 +180,22 @@ void WriteDump(const aiScene* scene, IOStream* io, bool shortened) time_t tt = ::time(NULL); tm* p = ::gmtime(&tt); - aiString name; - // write header - ioprintf(io, + std::string header( "\n" "\n\n" - "" " \n\n" - "\n", + "\n" + ); - aiGetVersionMajor(),aiGetVersionMinor(),aiGetVersionRevision(),asctime(p), + ioprintf( io, header.c_str(), + aiGetVersionMajor(), aiGetVersionMinor(), aiGetVersionRevision(), asctime( p ), scene->mFlags, - 0 /*globalImporter->GetEffectivePostProcessing()*/); + 0 /*globalImporter->GetEffectivePostProcessing()*/ ); // write the node graph WriteNode(scene->mRootNode, io, 0); @@ -266,6 +265,7 @@ void WriteDump(const aiScene* scene, IOStream* io, bool shortened) ioprintf(io,"\t\n"); } #endif + aiString name; // write textures if (scene->mNumTextures) { diff --git a/test/regression/ai_regression_ui.py b/test/regression/ai_regression_ui.py index fb68833de..ce043f61a 100644 --- a/test/regression/ai_regression_ui.py +++ b/test/regression/ai_regression_ui.py @@ -39,7 +39,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # --------------------------------------------------------------------------- -from Tkinter import * +from tkinter import * import sys import run import result_checker as rc @@ -54,7 +54,7 @@ class RegDialog( object ): def run_reg(self): - print "run_reg" + print( "run_reg" ) run.setEnvVar( "assimp_path", self.assimp_bin_path ) run.run_test() rc.run() @@ -62,11 +62,11 @@ class RegDialog( object ): return 0 def reg_update(self): - print "ToDo!" + print( "ToDo!" ) return 0 def quit(self): - print "quit" + print( "quit" ) sys.exit( 0 ) def initUi(self): @@ -78,9 +78,9 @@ class RegDialog( object ): self.b_run_.grid( row = 0, column = 0, sticky = W+E) self.b_update_.grid( row = 1, column = 0, sticky = W+E) self.b_quit_.grid( row = 2, column = 0, sticky = W+E) - self.b_run_.pack() - self.b_update_.pack() - self.b_quit_.pack() + #self.b_run_.pack() + #self.b_update_.pack() + #self.b_quit_.pack() self.b_update_.config( state=DISABLED ) root.mainloop() diff --git a/test/regression/run.py b/test/regression/run.py index 01c85c14c..2a9bdb0de 100755 --- a/test/regression/run.py +++ b/test/regression/run.py @@ -163,7 +163,7 @@ def setEnvVar( var, value ): # ------------------------------------------------------------------------------- def getEnvVar( var ): - if Environment.has_key( var ): + if var in Environment: return Environment[ var ] else: print ( "Error: cannot find " + var ) @@ -217,12 +217,12 @@ def process_dir(d, outfile_results, zipin, result ): outfile_results.write("assimp dump "+"-"*80+"\n") outfile_results.flush() assimp_bin_path = getEnvVar("assimp_path") - print( "assimp_bin_path = " + assimp_bin_pat ) + print( "assimp_bin_path = " + assimp_bin_path ) command = [assimp_bin_path, "dump", fullpath, outfile_actual, "-b", "-s", "-l" ] +\ pppreset.split() - print(command = " + command ) + print( "command = " + str( command ) ) r = subprocess.call(command, **shellparams) outfile_results.flush()