Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Sep 13, 2011
1 parent 9f2a8df commit 4ce49e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/wadfile.h
Expand Up @@ -46,7 +46,7 @@ typedef struct wadfile_s {
void** _lumpCache;
} wadfile_t;

wadfile_t* WadFile_New(const lumpinfo_t* info, streamfile_t* handle);
wadfile_t* WadFile_New(const lumpinfo_t* info, streamfile_t* sf);
void WadFile_Delete(wadfile_t* wad);

/// Close this file if open and release any acquired file identifiers.
Expand Down Expand Up @@ -122,6 +122,6 @@ int WadFile_LumpCount(wadfile_t* wad);
* Does the specified file appear to be in WAD format.
* @return @c true iff this is a file that can be represented using WadFile.
*/
boolean WadFile_Recognise(streamfile_t* handle);
boolean WadFile_Recognise(streamfile_t* sf);

#endif /* LIBDENG_FILESYS_WADFILE_H */
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/wadfile.c
Expand Up @@ -442,11 +442,11 @@ int WadFile_LumpCount(wadfile_t* file)
return file->_lumpCount;
}

boolean WadFile_Recognise(streamfile_t* handle)
boolean WadFile_Recognise(streamfile_t* sf)
{
boolean knownFormat = false;
wadheader_t hdr;
if(WadFile_ReadArchiveHeader(handle, &hdr) &&
if(WadFile_ReadArchiveHeader(sf, &hdr) &&
!(memcmp(hdr.identification, "IWAD", 4) && memcmp(hdr.identification, "PWAD", 4)))
{
knownFormat = true;
Expand Down
12 changes: 6 additions & 6 deletions doomsday/engine/portable/src/zipfile.c
Expand Up @@ -709,13 +709,13 @@ int ZipFile_LumpCount(zipfile_t* file)
return file->_lumpCount;
}

boolean ZipFile_Recognise(streamfile_t* handle)
boolean ZipFile_Recognise(streamfile_t* sf)
{
boolean knownFormat = false;
localfileheader_t hdr;
size_t readBytes, initPos = F_Tell(handle);
F_Seek(handle, 0, SEEK_SET);
readBytes = F_Read(handle, (uint8_t*)&hdr, sizeof(hdr));
size_t readBytes, initPos = F_Tell(sf);
F_Seek(sf, 0, SEEK_SET);
readBytes = F_Read(sf, (uint8_t*)&hdr, sizeof(hdr));
if(!(readBytes < sizeof(hdr)))
{
// Seek to the start of the signature.
Expand All @@ -724,7 +724,7 @@ boolean ZipFile_Recognise(streamfile_t* handle)
knownFormat = true;
}
}
// Reposition the file stream in case another handler needs to process this file.
F_Seek(handle, initPos, SEEK_SET);
// Reposition the stream in case another handler needs to process this file.
F_Seek(sf, initPos, SEEK_SET);
return knownFormat;
}

0 comments on commit 4ce49e3

Please sign in to comment.