/[svn]/libgig/trunk/src/RIFF.cpp
ViewVC logotype

Diff of /libgig/trunk/src/RIFF.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1207 by persson, Sat May 26 13:59:40 2007 UTC revision 1301 by persson, Sat Aug 25 09:59:53 2007 UTC
# Line 1268  namespace RIFF { Line 1268  namespace RIFF {
1268          if (!pSubChunks) {          if (!pSubChunks) {
1269              pSubChunks    = new ChunkList();              pSubChunks    = new ChunkList();
1270              pSubChunksMap = new ChunkMap();              pSubChunksMap = new ChunkMap();
1271                #if defined(WIN32)
1272                if (pFile->hFileRead == INVALID_HANDLE_VALUE) return;
1273                #else
1274              if (!pFile->hFileRead) return;              if (!pFile->hFileRead) return;
1275                #endif
1276              unsigned long uiOriginalPos = GetPos();              unsigned long uiOriginalPos = GetPos();
1277              SetPos(0); // jump to beginning of list chunk body              SetPos(0); // jump to beginning of list chunk body
1278              while (RemainingBytes() >= CHUNK_HEADER_SIZE) {              while (RemainingBytes() >= CHUNK_HEADER_SIZE) {
# Line 1498  namespace RIFF { Line 1502  namespace RIFF {
1502                                                       NULL, OPEN_EXISTING,                                                       NULL, OPEN_EXISTING,
1503                                                       FILE_ATTRIBUTE_NORMAL, NULL                                                       FILE_ATTRIBUTE_NORMAL, NULL
1504                                                   );                                                   );
1505                          throw Exception("Could not (re)open file \"" + Filename + "\" in read mode");                          throw Exception("Could not (re)open file \"" + Filename + "\" in read+write mode");
1506                      }                      }
1507                      #else                      #else
1508                      if (hFileRead) fclose(hFileRead);                      if (hFileRead) fclose(hFileRead);
# Line 1690  namespace RIFF { Line 1694  namespace RIFF {
1694          // forget all resized chunks          // forget all resized chunks
1695          ResizedChunks.clear();          ResizedChunks.clear();
1696    
1697          if (Filename.length() > 0) {          #if POSIX
1698              #if POSIX          if (hFileWrite) close(hFileWrite);
1699              close(hFileWrite);          #elif defined(WIN32)
1700              #elif defined(WIN32)          if (hFileWrite != INVALID_HANDLE_VALUE) CloseHandle(hFileWrite);
1701              CloseHandle(hFileWrite);          #else
1702              #else          if (hFileWrite) fclose(hFileWrite);
1703              fclose(hFileWrite);          #endif
1704              #endif          hFileWrite = hFileRead;
             hFileWrite = hFileRead;  
         }  
1705    
1706          // associate new file with this File object from now on          // associate new file with this File object from now on
1707          Filename = path;          Filename = path;

Legend:
Removed from v.1207  
changed lines
  Added in v.1301

  ViewVC Help
Powered by ViewVC