From dad88484deb60e2a608b7f1688d1d2509d7d53f8 Mon Sep 17 00:00:00 2001 From: NotAdam Date: Thu, 24 Jan 2019 19:04:37 +1100 Subject: [PATCH] fix pcb_reader compiler warnings --- src/tools/pcb_reader/main.cpp | 15 +++++++-------- src/tools/pcb_reader/navmesh_exporter.h | 4 ++-- src/tools/pcb_reader/obj_exporter.h | 4 ++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/tools/pcb_reader/main.cpp b/src/tools/pcb_reader/main.cpp index 53a1bb7c..bb90af0f 100644 --- a/src/tools/pcb_reader/main.cpp +++ b/src/tools/pcb_reader/main.cpp @@ -399,13 +399,13 @@ int main( int argc, char* argv[] ) //exportMgr.exportZone( exportedZone, ( ExportFileType )exportFileType ); - printf( "Exported %s in %u seconds \n", + printf( "Exported %s in %lu seconds \n", zoneName.c_str(), - std::chrono::duration_cast< std::chrono::seconds >( std::chrono::high_resolution_clock::now() - entryStartTime ) ); + std::chrono::duration_cast< std::chrono::seconds >( std::chrono::high_resolution_clock::now() - entryStartTime ).count() ); } catch( std::exception& e ) { - printf( ( std::string( e.what() ) + "\n" ).c_str() ); + printf( "%s", ( std::string( e.what() ) + "\n" ).c_str() ); printf( "Unable to extract collision data.\n" ); printf( "Usage: pcb_reader2 territory \"path/to/game/sqpack/ffxiv\"\n" ); } @@ -413,14 +413,13 @@ int main( int argc, char* argv[] ) exportMgr.waitForTasks(); std::cout << "\n\n\n"; - printf( "Finished all tasks in %u seconds\n", + printf( "Finished all tasks in %lu seconds\n", std::chrono::duration_cast< std::chrono::seconds >( std::chrono::high_resolution_clock::now() - startTime ).count() ); getchar(); - if( eData ) - delete eData; - if( data1 ) - delete data1; + delete eData; + delete data1; + return 0; } diff --git a/src/tools/pcb_reader/navmesh_exporter.h b/src/tools/pcb_reader/navmesh_exporter.h index e2727eb2..c3d4d0c6 100644 --- a/src/tools/pcb_reader/navmesh_exporter.h +++ b/src/tools/pcb_reader/navmesh_exporter.h @@ -30,7 +30,7 @@ public: auto fileName = zone.name + ".obj"; auto end = std::chrono::high_resolution_clock::now(); - printf( "[Navmesh] Finished exporting %s in %u ms\n", + printf( "[Navmesh] Finished exporting %s in %lu ms\n", fileName.c_str(), std::chrono::duration_cast< std::chrono::milliseconds >( end - start ).count() ); } @@ -43,7 +43,7 @@ public: auto end = std::chrono::high_resolution_clock::now(); - printf( "[Navmesh] Finished exporting %s in %u ms\n", + printf( "[Navmesh] Finished exporting %s in %lu ms\n", fileName.c_str(), std::chrono::duration_cast< std::chrono::milliseconds >( end - start ).count() ); } diff --git a/src/tools/pcb_reader/obj_exporter.h b/src/tools/pcb_reader/obj_exporter.h index 378e14fb..e1a35747 100644 --- a/src/tools/pcb_reader/obj_exporter.h +++ b/src/tools/pcb_reader/obj_exporter.h @@ -50,7 +50,7 @@ public: } auto end = std::chrono::high_resolution_clock::now(); - printf( "[Obj] Finished exporting %s in %u ms\n", + printf( "[Obj] Finished exporting %s in %lu ms\n", fileName.c_str(), std::chrono::duration_cast< std::chrono::milliseconds >( end - start ).count() ); } @@ -87,7 +87,7 @@ public: } auto end = std::chrono::high_resolution_clock::now(); - printf( "[Obj] Finished exporting %s in %u ms\n", + printf( "[Obj] Finished exporting %s in %lu ms\n", fileName.c_str(), std::chrono::duration_cast< std::chrono::milliseconds >( end - start ).count() ); }