More warning fixes

This commit is contained in:
Henrik Rydgård 2014-04-08 15:26:47 +02:00
parent 06ec64fa62
commit ea404141d7
3 changed files with 5 additions and 5 deletions

View File

@ -86,11 +86,11 @@ bool writeDataToFile(bool text_file, const void* data, const unsigned int size,
uint64_t GetSize(FILE *f)
{
// can't use off_t here because it can be 32-bit
uint64_t pos = ftell(f);
size_t pos = ftell(f);
if (fseek(f, 0, SEEK_END) != 0) {
return 0;
}
uint64_t size = ftell(f);
size_t size = ftell(f);
// Reset the seek position to where it was when we started.
if ((size != pos) && (fseek(f, pos, SEEK_SET) != 0)) {
// Should error here

View File

@ -3,6 +3,8 @@
#include <string>
#include <vector>
#include <inttypes.h>
// Whole-file reading/writing
bool writeStringToFile(bool text_file, const std::string &str, const char *filename);
bool readFileToString(bool text_file, const char *filename, std::string &str);
@ -18,7 +20,7 @@ struct FileInfo {
bool exists;
bool isDirectory;
bool isWritable;
size_t size;
uint64_t size;
bool operator <(const FileInfo &other) const;
};

View File

@ -50,8 +50,6 @@ int ezuncompress(unsigned char* pDest, long* pnDestLen, const unsigned char* pSr
return nExtraChunks ? Z_BUF_ERROR : Z_OK;
}
static const char magic[5] = "ZIMG";
static unsigned int log2i(unsigned int val) {
unsigned int ret = -1;
while (val != 0) {