From ea404141d76ac58db4f0d77080d994b8eee79c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 8 Apr 2014 15:26:47 +0200 Subject: [PATCH] More warning fixes --- file/file_util.cpp | 4 ++-- file/file_util.h | 4 +++- image/zim_load.cpp | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/file/file_util.cpp b/file/file_util.cpp index d0d8a212e3..130d8c8ada 100644 --- a/file/file_util.cpp +++ b/file/file_util.cpp @@ -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 diff --git a/file/file_util.h b/file/file_util.h index ff3290e5c5..6b659bea9b 100644 --- a/file/file_util.h +++ b/file/file_util.h @@ -3,6 +3,8 @@ #include #include +#include + // 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; }; diff --git a/image/zim_load.cpp b/image/zim_load.cpp index 70d564628e..ec6266a4b2 100644 --- a/image/zim_load.cpp +++ b/image/zim_load.cpp @@ -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) {