diff --git a/src/BOPTest/BOPTest_LowCommands.cxx b/src/BOPTest/BOPTest_LowCommands.cxx index 69c8f357cf..fc9bb016dc 100755 --- a/src/BOPTest/BOPTest_LowCommands.cxx +++ b/src/BOPTest/BOPTest_LowCommands.cxx @@ -88,49 +88,36 @@ static Standard_Integer bhaspc (Draw_Interpretor& , Standard_Integer , con //function : bclassify //purpose : //======================================================================= -Standard_Integer bclassify (Draw_Interpretor& aDI, - Standard_Integer n, - const char** a) +Standard_Integer bclassify (Draw_Interpretor& theDI, + Standard_Integer theArgNb, + const char** theArgVec) { - char sbf[512]; - - if (n < 3) { - Sprintf(sbf, " Use >bclassify Solid Point [Tolerance=1.e-7]\n"); - aDI<bclassify Solid Point [Tolerance=1.e-7]\n"; return 1; } - - TopoDS_Shape aS = DBRep::Get(a[1]); - if (aS.IsNull()) { - Sprintf(sbf, " Null Shape is not allowed here\n"); - aDI<bclassify Face Point2d [Tol2D=Tol(Face)]\n"); - aDI<bclassify Face Point2d [Tol2D=Tol(Face)]\n"; return 1; } - - TopoDS_Shape aS = DBRep::Get(a[1]); - if (aS.IsNull()) { - Sprintf(sbf, " Null Shape is not allowed here\n"); - aDI< #include #include +#include +#include IMPLEMENT_STANDARD_HANDLE(NCollection_BaseAllocator,MMgt_TShared) IMPLEMENT_STANDARD_RTTIEXT(NCollection_BaseAllocator,MMgt_TShared) @@ -254,35 +256,55 @@ void NCollection_BaseAllocator::PrintMemUsageStatistics() } Standard_Size aTotAlloc = 0; Standard_Size aTotLeft = 0; + // print - FILE * ff = fopen("memstat.d", "wt"); - if (ff == NULL) + std::ofstream aFileOut ("memstat.d", std::ios_base::trunc | std::ios_base::out); + if (!aFileOut.is_open()) { - cout << "failure writing file memstat.d" << endl; + std::cout << "failure writing file memstat.d" << std::endl; return; } - fprintf(ff, "%12s %12s %12s %12s %12s\n", - "BlockSize", "NbAllocated", "NbLeft", "Allocated", "Left"); + aFileOut.imbue (std::locale ("C")); + + // header + aFileOut << std::setw(20) << "BlockSize" << ' ' + << std::setw(12) << "NbAllocated" << ' ' + << std::setw(12) << "NbLeft" << ' ' + << std::setw(20) << "Allocated" << ' ' + << std::setw(20) << "Left" << '\n'; + + // body for (itLst.Init(aColl); itLst.More(); itLst.Next()) { const StorageInfo& aInfo = itLst.Value(); Standard_Integer nbLeft = aInfo.nbAlloc - aInfo.nbFree; Standard_Size aSizeAlloc = aInfo.nbAlloc * aInfo.roundSize; Standard_Size aSizeLeft = nbLeft * aInfo.roundSize; - fprintf(ff, "%12d %12d %12d %12d %12d\n", aInfo.roundSize, - aInfo.nbAlloc, nbLeft, aSizeAlloc, aSizeLeft); + + aFileOut << std::setw(20) << aInfo.roundSize << ' ' + << std::setw(12) << aInfo.nbAlloc << ' ' + << std::setw(12) << nbLeft << ' ' + << std::setw(20) << aSizeAlloc << ' ' + << std::setw(20) << aSizeLeft << '\n'; + aTotAlloc += aSizeAlloc; - aTotLeft += aSizeLeft; + aTotLeft += aSizeLeft; } - fprintf(ff, "%12s %12s %12s %12d %12d\n", "Total:", "", "", - aTotAlloc, aTotLeft); + + // footer + aFileOut << std::setw(20) << "Total:" << ' ' + << std::setw(12) << "" << ' ' + << std::setw(12) << "" << ' ' + << std::setw(20) << aTotAlloc << ' ' + << std::setw(20) << aTotLeft << '\n'; if (!StorageIDSet().IsEmpty()) { - fprintf(ff, "Alive allocation numbers of size=%d\n", StandardCallBack_CatchSize()); - NCollection_Map::Iterator itMap1(StorageIDSet()); - for (; itMap1.More(); itMap1.Next()) - fprintf(ff, "%d\n", itMap1.Key()); + aFileOut << "Alive allocation numbers of size=" << StandardCallBack_CatchSize() << '\n'; + for (NCollection_Map::Iterator itMap1(StorageIDSet()); itMap1.More(); itMap1.Next()) + { + aFileOut << itMap1.Key() << '\n'; + } } - fclose(ff); + aFileOut.close(); } diff --git a/src/NCollection/NCollection_HeapAllocator.cxx b/src/NCollection/NCollection_HeapAllocator.cxx index 85f3d5af76..f1bd6c5ade 100755 --- a/src/NCollection/NCollection_HeapAllocator.cxx +++ b/src/NCollection/NCollection_HeapAllocator.cxx @@ -17,8 +17,6 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - - #include #include #include @@ -35,13 +33,14 @@ void * NCollection_HeapAllocator::Allocate (const Standard_Size theSize) { // the size is rounded up to word size. const Standard_Size aRoundSize = (theSize + 3) & ~0x3; - void * pResult = malloc(aRoundSize); - if (!pResult) { - char buf[128]; - sprintf (buf, "Failed to allocate %d bytes in global dynamic heap",theSize); - Standard_OutOfMemory::Raise(&buf[0]); + void* aResult = malloc (aRoundSize); + if (aResult == NULL) + { + char aBuffer[96]; + Sprintf (aBuffer, "Failed to allocate %" PRIuPTR " bytes in global dynamic heap", theSize); + Standard_OutOfMemory::Raise (aBuffer); } - return pResult; + return aResult; } //======================================================================= diff --git a/src/NCollection/NCollection_IncAllocator.cxx b/src/NCollection/NCollection_IncAllocator.cxx index 77fc53689f..107a77ae77 100755 --- a/src/NCollection/NCollection_IncAllocator.cxx +++ b/src/NCollection/NCollection_IncAllocator.cxx @@ -17,13 +17,14 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - #include #include #include #include #include #include +#include +#include IMPLEMENT_STANDARD_HANDLE (NCollection_IncAllocator,NCollection_BaseAllocator) IMPLEMENT_STANDARD_RTTIEXT (NCollection_IncAllocator,NCollection_BaseAllocator) @@ -134,34 +135,40 @@ static void Debug_Destroy(Standard_Address theAlloc) Standard_EXPORT void IncAllocator_PrintAlive() { - if (!StorageIDSet().IsEmpty()) + if (StorageIDSet().IsEmpty()) { - FILE * ff = fopen("inc_alive.d", "wt"); - if (ff == NULL) - { - cout << "failure writing file inc_alive.d" << endl; - } - else - { - fprintf(ff, "Alive IncAllocators (number, size in Kb)\n"); - NCollection_DataMap::Iterator - itMap(StorageIDMap()); - Standard_Size aTotSize = 0; - Standard_Integer nbAlloc = 0; - for (; itMap.More(); itMap.Next()) - { - NCollection_IncAllocator* anAlloc = - static_cast(itMap.Key()); - Standard_Size anID = itMap.Value(); - Standard_Size aSize = anAlloc->GetMemSize(); - aTotSize += aSize; - nbAlloc++; - fprintf(ff, "%-8d %8.1f\n", anID, double(aSize)/1024); - } - fprintf(ff, "Total:\n%-8d %8.1f\n", nbAlloc, double(aTotSize)/1024); - fclose(ff); - } + return; } + + std::ofstream aFileOut ("inc_alive.d", std::ios_base::trunc | std::ios_base::out); + if (!aFileOut.is_open()) + { + std::cout << "failure writing file inc_alive.d" << std::endl; + return; + } + aFileOut.imbue (std::locale ("C")); + aFileOut << std::fixed << std::setprecision(1); + + aFileOut << "Alive IncAllocators (number, size in Kb)\n"; + Standard_Size aTotSize = 0; + Standard_Integer nbAlloc = 0; + for (NCollection_DataMap::Iterator itMap (StorageIDMap()); + itMap.More(); itMap.Next()) + { + const NCollection_IncAllocator* anAlloc = static_cast(itMap.Key()); + Standard_Size anID = itMap.Value(); + Standard_Size aSize = anAlloc->GetMemSize(); + aTotSize += aSize; + nbAlloc++; + aFileOut << std::setw(20) << anID << ' ' + << std::setw(20) << (double(aSize) / 1024.0) + << '\n'; + } + aFileOut << "Total:\n" + << std::setw(20) << nbAlloc << ' ' + << std::setw(20) << (double(aTotSize) / 1024.0) + << '\n'; + aFileOut.close(); } //======================================================================= diff --git a/src/NCollection/NCollection_IncAllocator.hxx b/src/NCollection/NCollection_IncAllocator.hxx index 1a0576b412..29f8dd55db 100755 --- a/src/NCollection/NCollection_IncAllocator.hxx +++ b/src/NCollection/NCollection_IncAllocator.hxx @@ -17,8 +17,6 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - - #ifndef NCollection_IncAllocator_HeaderFile #define NCollection_IncAllocator_HeaderFile @@ -123,5 +121,4 @@ class NCollection_IncAllocator : public NCollection_BaseAllocator // Definition of HANDLE object using Standard_DefineHandle.hxx DEFINE_STANDARD_HANDLE (NCollection_IncAllocator, NCollection_BaseAllocator) - #endif diff --git a/src/OSD/OSD_MAllocHook.cxx b/src/OSD/OSD_MAllocHook.cxx index 23dc25ffd0..3ce94e6ae4 100755 --- a/src/OSD/OSD_MAllocHook.cxx +++ b/src/OSD/OSD_MAllocHook.cxx @@ -17,7 +17,6 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - #include #ifndef WNT @@ -30,6 +29,7 @@ #include #include #include +#include #ifndef SIZE_MAX #define SIZE_MAX UINT_MAX @@ -175,9 +175,9 @@ void OSD_MAllocHook::SetCallback(Callback* theCB) //======================================================================= OSD_MAllocHook::LogFileHandler::LogFileHandler() -: myLogFile(NULL), - myBreakSize(0) +: myBreakSize(0) { + myLogFile.imbue (std::locale ("C")); } //======================================================================= @@ -198,13 +198,15 @@ OSD_MAllocHook::LogFileHandler::~LogFileHandler() Standard_Boolean OSD_MAllocHook::LogFileHandler::Open(const char* theFileName) { Close(); - myLogFile = fopen(theFileName, "w"); - if (myLogFile != NULL) + myLogFile.open (theFileName); + if (!myLogFile.is_open()) { - fputs("Operation type; Request Number; Block Size\n", myLogFile); - fputs("------------------------------------------\n", myLogFile); + return Standard_False; } - return myLogFile != NULL; + + myLogFile << "Operation type; Request Number; Block Size\n" + "------------------------------------------\n"; + return Standard_True; } //======================================================================= @@ -214,10 +216,9 @@ Standard_Boolean OSD_MAllocHook::LogFileHandler::Open(const char* theFileName) void OSD_MAllocHook::LogFileHandler::Close() { - if (myLogFile != NULL) + if (myLogFile.is_open()) { - fclose(myLogFile); - myLogFile = NULL; + myLogFile.close(); } } @@ -342,12 +343,21 @@ Standard_Boolean OSD_MAllocHook::LogFileHandler::MakeReport fclose(aLogFile); // print the report - FILE* aRepFile = fopen(theOutFile, "w"); - if (aRepFile == NULL) + std::ofstream aRepFile (theOutFile); + if(!aRepFile.is_open()) + { return Standard_False; - fprintf(aRepFile, "%10s %10s %10s %10s %10s %10s %10s\n", - "BlockSize", "NbAlloc", "NbLeft", "NbLeftPeak", - "AllocSize", "LeftSize", "PeakSize"); + } + aRepFile.imbue (std::locale ("C")); + + aRepFile << std::setw(20) << "BlockSize " + << std::setw(10) << "NbAlloc " + << std::setw(10) << "NbLeft " + << std::setw(10) << "NbLeftPeak " + << std::setw(20) << "AllocSize " + << std::setw(20) << "LeftSize " + << std::setw(20) << "PeakSize " << std::endl; + Standard_Size aTotAlloc = 0; for (std::set::const_iterator it = aStMap.begin(); it != aStMap.end(); ++it) @@ -357,9 +367,15 @@ Standard_Boolean OSD_MAllocHook::LogFileHandler::MakeReport Standard_Size aSizeAlloc = aInfo.nbAlloc * aInfo.size; Standard_Size aSizeLeft = nbLeft * aInfo.size; Standard_Size aSizePeak = aInfo.nbLeftPeak * aInfo.size; - fprintf(aRepFile, "%10d %10d %10d %10d %10Iu %10Iu %10Iu\n", aInfo.size, - aInfo.nbAlloc, nbLeft, aInfo.nbLeftPeak, - aSizeAlloc, aSizeLeft, aSizePeak); + + aRepFile << std::setw(20) << aInfo.size << ' ' + << std::setw(10) << aInfo.nbAlloc << ' ' + << std::setw(10) << nbLeft << ' ' + << std::setw(10) << aInfo.nbLeftPeak << ' ' + << std::setw(20) << aSizeAlloc << ' ' + << std::setw(20) << aSizeLeft << ' ' + << std::setw(20) << aSizePeak << std::endl; + if (aTotAlloc + aSizeAlloc < aTotAlloc) // overflow ? aTotAlloc = SIZE_MAX; else @@ -368,13 +384,19 @@ Standard_Boolean OSD_MAllocHook::LogFileHandler::MakeReport { for (std::set::const_iterator it1 = aInfo.alive->begin(); it1 != aInfo.alive->end(); ++it1) - fprintf(aRepFile, "%10lu\n", *it1); + aRepFile << std::setw(10) << *it1; } } - fprintf(aRepFile, "%10s %10s %10s %10s%c%10Iu %10Iu %10Iu\n", "Total:", - "", "", "", (aTotAlloc == SIZE_MAX ? '>' : ' '), aTotAlloc, - aTotalLeftSize, aTotalPeakSize); - fclose(aRepFile); + aRepFile << std::setw(20) << "Total:" + << std::setw(10) << "" << ' ' + << std::setw(10) << "" << ' ' + << std::setw(10) << "" << ' ' + << (aTotAlloc == SIZE_MAX ? '>' : ' ') + << std::setw(20) << aTotAlloc << ' ' + << std::setw(20) << aTotalLeftSize << ' ' + << std::setw(20) << aTotalPeakSize << std::endl; + + aRepFile.close(); return Standard_True; } @@ -387,10 +409,11 @@ void OSD_MAllocHook::LogFileHandler::AllocEvent (size_t theSize, long theRequestNum) { - if (myLogFile != NULL) + if (myLogFile.is_open()) { myMutex.Lock(); - fprintf(myLogFile, "alloc %10lu %10u\n", theRequestNum, theSize); + myLogFile << "alloc "<< std::setw(10) << theRequestNum + << std::setw(20) << theSize << std::endl; myMutex.Unlock(); if (myBreakSize == theSize) { @@ -409,10 +432,11 @@ void OSD_MAllocHook::LogFileHandler::FreeEvent size_t theSize, long theRequestNum) { - if (myLogFile != NULL) + if (myLogFile.is_open()) { myMutex.Lock(); - fprintf(myLogFile, "free %10lu %10u\n", theRequestNum, theSize); + myLogFile << "free " << std::setw(20) << theRequestNum + << std::setw(20) << theSize << std::endl; myMutex.Unlock(); } } @@ -477,12 +501,20 @@ void OSD_MAllocHook::CollectBySize::Reset() Standard_Boolean OSD_MAllocHook::CollectBySize::MakeReport(const char* theOutFile) { // print the report - FILE* aRepFile = fopen(theOutFile, "w"); - if (aRepFile == NULL) + std::ofstream aRepFile(theOutFile); + if (!aRepFile.is_open()) return Standard_False; - fprintf(aRepFile, "%10s %10s %10s %10s %10s %10s %10s\n", - "BlockSize", "NbAlloc", "NbLeft", "NbLeftPeak", - "AllocSize", "LeftSize", "PeakSize"); + std::locale aCLoc("C"); + aRepFile.imbue(aCLoc); + + aRepFile << std::setw(10) << "BlockSize " + << std::setw(10) << "NbAlloc " + << std::setw(10) << "NbLeft " + << std::setw(10) << "NbLeftPeak " + << std::setw(20) << "AllocSize " + << std::setw(20) << "LeftSize " + << std::setw(20) << "PeakSize " << std::endl; + Standard_Size aTotAlloc = 0; for (int i = 0; i < MAX_ALLOC_SIZE; i++) { @@ -493,19 +525,30 @@ Standard_Boolean OSD_MAllocHook::CollectBySize::MakeReport(const char* theOutFil Standard_Size aSizeAlloc = myArray[i].nbAlloc * aSize; ptrdiff_t aSizeLeft = nbLeft * aSize; Standard_Size aSizePeak = myArray[i].nbLeftPeak * aSize; - fprintf(aRepFile, "%10d %10d %10d %10d %10Iu %10Id %10Iu\n", aSize, - myArray[i].nbAlloc, nbLeft, myArray[i].nbLeftPeak, - aSizeAlloc, aSizeLeft, aSizePeak); + + aRepFile << std::setw(10) << aSize << ' ' + << std::setw(10) << myArray[i].nbAlloc << ' ' + << std::setw(10) << nbLeft << ' ' + << std::setw(10) << myArray[i].nbLeftPeak << ' ' + << std::setw(20) << aSizeAlloc << ' ' + << std::setw(20) << aSizeLeft << ' ' + << std::setw(20) << aSizePeak << std::endl; + if (aTotAlloc + aSizeAlloc < aTotAlloc) // overflow ? aTotAlloc = SIZE_MAX; else aTotAlloc += aSizeAlloc; } } - fprintf(aRepFile, "%10s %10s %10s %10s%c%10Iu %10Id %10Iu\n", "Total:", - "", "", "", (aTotAlloc == SIZE_MAX ? '>' : ' '), aTotAlloc, - myTotalLeftSize, myTotalPeakSize); - fclose(aRepFile); + aRepFile << std::setw(10) << "Total:" << ' ' + << std::setw(10) << "" << ' ' + << std::setw(10) << "" << ' ' + << std::setw(10) << "" << ' ' + << (aTotAlloc == SIZE_MAX ? '>' : ' ') + << std::setw(20) << aTotAlloc << ' ' + << std::setw(20) << myTotalLeftSize << ' ' + << std::setw(20) << myTotalPeakSize << std::endl; + aRepFile.close(); return Standard_True; } diff --git a/src/OSD/OSD_MAllocHook.hxx b/src/OSD/OSD_MAllocHook.hxx index a983900a3b..58ae3038cc 100755 --- a/src/OSD/OSD_MAllocHook.hxx +++ b/src/OSD/OSD_MAllocHook.hxx @@ -24,6 +24,7 @@ #include #include #include +#include /** * This class provides the possibility to set callback for memory @@ -105,7 +106,7 @@ public: Standard_EXPORT virtual void FreeEvent(void*, size_t, long); private: - FILE* myLogFile; + std::ofstream myLogFile; Standard_Mutex myMutex; size_t myBreakSize; }; diff --git a/src/QABugs/QABugs_11.cxx b/src/QABugs/QABugs_11.cxx index aaab1ab5cb..11a67630db 100755 --- a/src/QABugs/QABugs_11.cxx +++ b/src/QABugs/QABugs_11.cxx @@ -17,8 +17,6 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - - #include #include @@ -885,76 +883,47 @@ static Standard_Integer OCC381_SaveAs (Draw_Interpretor& di, Standard_Integer nb #include -Standard_Integer OCC299bug (Draw_Interpretor& di, - Standard_Integer n, - const char ** a) +Standard_Integer OCC299bug (Draw_Interpretor& theDi, + Standard_Integer theArgNb, + const char** theArgVec) { - char sbf[512]; - - if (n < 3) { - di << "Usage : " << a[0] << " Solid Point [Tolerance=1.e-7]" << "\n"; + if (theArgNb < 3) + { + theDi << "Usage : " << theArgVec[0] << " Solid Point [Tolerance=1.e-7]\n"; return -1; } - TopoDS_Shape aS = DBRep::Get(a[1]); - if (aS.IsNull()) { - Sprintf(sbf, " Null Shape is not allowed here\n"); - di< diff --git a/src/QABugs/QABugs_3.cxx b/src/QABugs/QABugs_3.cxx index 4989942051..26db4c9bcd 100644 --- a/src/QABugs/QABugs_3.cxx +++ b/src/QABugs/QABugs_3.cxx @@ -17,7 +17,6 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - #include #ifdef HAVE_CONFIG_H #include @@ -35,6 +34,8 @@ #include #include +#include + static int BUC60623(Draw_Interpretor& di, Standard_Integer argc, const char ** a) { if(argc!=4) @@ -1365,59 +1366,64 @@ static Standard_Integer BUC60856(Draw_Interpretor& di, Standard_Integer /*argc*/ return 0; } -//#include -#ifdef HAVE_FSTREAM -# include -#elif defined (HAVE_FSTREAM_H) -# include -#endif -//#include //========================================================================== //function : CoordLoad // chargement d une face dans l explorer. //========================================================================== -static Standard_Integer coordload (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) +static Standard_Integer coordload (Draw_Interpretor& theDi, + Standard_Integer theArgsNb, + const char** theArgVec) { - char line[256]; - char X[30], Y[30]; - int fr; - TopoDS_Vertex V1,V2; - TopoDS_Edge Edge; - TopoDS_Wire Wire; - TopoDS_Face Face; - - if (argc < 3) return 1; - - ifstream file(argv[2], ios::in); - if(!file) - { - di<<"unable to open "< #endif +#if(defined(_MSC_VER) && (_MSC_VER < 1800)) + // only Visual Studio 2013 (vc12) provides header + // we do not defined all macros here - only used by OCCT framework + #ifdef _WIN64 + #define PRIdPTR "I64d" + #define PRIuPTR "I64u" + #define SCNdPTR "I64d" + #define SCNuPTR "I64u" + #else + #define PRIdPTR "d" + #define PRIuPTR "u" + #define SCNdPTR "d" + #define SCNuPTR "u" + #endif +#else + // should be just since C++11 + // however we use this code for compatibility with old C99 compilers + #ifndef __STDC_FORMAT_MACROS + #define __STDC_FORMAT_MACROS + #endif + #include +#endif + #define Standard_False (Standard_Boolean)0 #define Standard_True (Standard_Boolean)1 @@ -37,19 +60,20 @@ #include #endif -typedef int Standard_Integer; -typedef double Standard_Real; -typedef unsigned int Standard_Boolean; -typedef float Standard_ShortReal; -typedef char Standard_Character; -typedef short Standard_ExtCharacter; -typedef unsigned char Standard_Byte; -typedef void* Standard_Address; -typedef size_t Standard_Size; +typedef int Standard_Integer; +typedef double Standard_Real; +typedef unsigned int Standard_Boolean; +typedef float Standard_ShortReal; +typedef char Standard_Character; +typedef short Standard_ExtCharacter; +typedef unsigned char Standard_Byte; +typedef void* Standard_Address; +typedef size_t Standard_Size; +typedef std::time_t Standard_Time; // -typedef const char* Standard_CString; -typedef const short* Standard_ExtString; +typedef const char* Standard_CString; +typedef const short* Standard_ExtString; // Unicode primitives, char16_t, char32_t typedef char Standard_Utf8Char; //!< signed UTF-8 char @@ -58,6 +82,4 @@ typedef uint16_t Standard_Utf16Char; //!< UTF-16 char (always unsigned) typedef uint32_t Standard_Utf32Char; //!< UTF-32 char (always unsigned) typedef wchar_t Standard_WideChar; //!< wide char (unsigned UTF-16 on Windows platform and signed UTF-32 on Linux) -typedef std::time_t Standard_Time; - -#endif +#endif // _Standard_TypeDef_HeaderFile diff --git a/src/VrmlData/VrmlData_Scene.cxx b/src/VrmlData/VrmlData_Scene.cxx index b5d11dd1a8..b82cf5f420 100755 --- a/src/VrmlData/VrmlData_Scene.cxx +++ b/src/VrmlData/VrmlData_Scene.cxx @@ -17,7 +17,6 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - #include #include #include @@ -1132,8 +1131,10 @@ void dumpNode (Standard_OStream& theStream, const Standard_Integer ** ppDummy; const Standard_Size nCoord = aNode->Coordinates()->Length(); const Standard_Size nPoly = aNode->Polygons (ppDummy); - char buf[64]; - Sprintf (buf, "IndexedFaceSet (%d vertices, %d polygons)", nCoord, nPoly); + char buf[80]; + Sprintf (buf, "IndexedFaceSet (%" PRIuPTR " vertices, %" PRIuPTR " polygons)", + nCoord, nPoly); + dumpNodeHeader (theStream, theIndent, buf, theNode->Name()); } else if (theNode->IsKind(STANDARD_TYPE(VrmlData_IndexedLineSet))) { const Handle(VrmlData_IndexedLineSet) aNode = @@ -1141,8 +1142,11 @@ void dumpNode (Standard_OStream& theStream, const Standard_Integer ** ppDummy; const Standard_Size nCoord = aNode->Coordinates()->Length(); const Standard_Size nPoly = aNode->Polygons (ppDummy); - char buf[64]; - Sprintf (buf, "IndexedLineSet (%d vertices, %d polygons)", nCoord, nPoly); + + char buf[80]; + Sprintf(buf, "IndexedLineSet (%" PRIuPTR " vertices, %" PRIuPTR " polygons)", + nCoord, nPoly); + dumpNodeHeader (theStream, theIndent, buf, theNode->Name()); } else if (theNode->IsKind(STANDARD_TYPE(VrmlData_Material))) { // const Handle(VrmlData_Material) aMaterial =