diff options
author | Tobias Off <tobias.off@redheads.de> | 2019-11-19 12:01:27 (GMT) |
---|---|---|
committer | Tobias Off <tobias.off@redheads.de> | 2019-11-28 09:43:57 (GMT) |
commit | 6382986b77d302be187d95aaa850eff132ec1d7d (patch) | |
tree | 37babfa1b0b12db5ccdb7fa4f386690e6e949a66 /src/definition.cpp | |
parent | 2972f6ddc491f615f814b1277ec715b6f707c419 (diff) | |
download | Doxygen-6382986b77d302be187d95aaa850eff132ec1d7d.zip Doxygen-6382986b77d302be187d95aaa850eff132ec1d7d.tar.gz Doxygen-6382986b77d302be187d95aaa850eff132ec1d7d.tar.bz2 |
Refactoring of portable.h and portable.cpp functions to be contained in a namespace
Fixing some memory issues caused by not correctly freed pointers
Diffstat (limited to 'src/definition.cpp')
-rw-r--r-- | src/definition.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/definition.cpp b/src/definition.cpp index 80060ba..734d949 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -744,12 +744,12 @@ class FilterCache // file already processed, get the results after filtering from the tmp file Debug::print(Debug::FilterOutput,0,"Reusing filter result for %s from %s at offset=%d size=%d\n", qPrint(fileName),qPrint(Doxygen::filterDBFileName),(int)item->filePos,(int)item->fileSize); - f = portable_fopen(Doxygen::filterDBFileName,"rb"); + f = Portables::fopen(Doxygen::filterDBFileName,"rb"); if (f) { bool success=TRUE; str.resize(item->fileSize+1); - if (portable_fseek(f,item->filePos,SEEK_SET)==-1) + if (Portables::fseek(f,item->filePos,SEEK_SET)==-1) { err("Failed to seek to position %d in filter database file %s\n",(int)item->filePos,qPrint(Doxygen::filterDBFileName)); success=FALSE; @@ -780,8 +780,8 @@ class FilterCache // filter file QCString cmd=filter+" \""+fileName+"\""; Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd)); - f = portable_popen(cmd,"r"); - FILE *bf = portable_fopen(Doxygen::filterDBFileName,"a+b"); + f = Portables::popen(cmd,"r"); + FILE *bf = Portables::fopen(Doxygen::filterDBFileName,"a+b"); FilterCacheItem *item = new FilterCacheItem; item->filePos = m_endPos; if (bf==0) @@ -790,7 +790,7 @@ class FilterCache err("Error opening filter database file %s\n",qPrint(Doxygen::filterDBFileName)); str.addChar('\0'); delete item; - portable_pclose(f); + Portables::pclose(f); return FALSE; } // append the filtered output to the database file @@ -806,7 +806,7 @@ class FilterCache qPrint(Doxygen::filterDBFileName),bytesWritten,bytesRead); str.addChar('\0'); delete item; - portable_pclose(f); + Portables::pclose(f); fclose(bf); return FALSE; } @@ -821,14 +821,14 @@ class FilterCache qPrint(fileName),qPrint(Doxygen::filterDBFileName),(int)item->filePos,(int)item->fileSize); // update end of file position m_endPos += size; - portable_pclose(f); + Portables::pclose(f); fclose(bf); } else // no filtering { // normal file //printf("getFileContents(%s): no filter\n",qPrint(fileName)); - f = portable_fopen(fileName,"r"); + f = Portables::fopen(fileName,"r"); while (!feof(f)) { int bytesRead = fread(buf,1,blockSize,f); |