From e47dab84f3f6606d6d6e95774b16d7d4e8d7daa6 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 25 Apr 2014 09:56:15 -0700 Subject: Cmake generated projects for IDEs include headers in project files. --- src/OSSupport/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'src/OSSupport') diff --git a/src/OSSupport/CMakeLists.txt b/src/OSSupport/CMakeLists.txt index 497cd0ba3..dee60b450 100644 --- a/src/OSSupport/CMakeLists.txt +++ b/src/OSSupport/CMakeLists.txt @@ -5,6 +5,7 @@ project (MCServer) include_directories ("${PROJECT_SOURCE_DIR}/../") file(GLOB SOURCE "*.cpp" + "*.h" ) add_library(OSSupport ${SOURCE}) -- cgit v1.2.3 From 80b97fd9dd584c439ca25efaa7e5172da1509628 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 25 Apr 2014 20:49:55 -0700 Subject: Fixed mobs that don't naturally spawn. --- src/OSSupport/File.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/OSSupport') diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp index 7f0f0ad2f..f1b3bcf9e 100644 --- a/src/OSSupport/File.cpp +++ b/src/OSSupport/File.cpp @@ -67,11 +67,11 @@ bool cFile::Open(const AString & iFileName, eMode iMode) case fmRead: Mode = "rb"; break; case fmWrite: Mode = "wb"; break; case fmReadWrite: Mode = "rb+"; break; - default: - { - ASSERT(!"Unhandled file mode"); - return false; - } + } + if (Mode == NULL) + { + ASSERT(!"Unhandled file mode"); + return false; } #ifdef _WIN32 -- cgit v1.2.3 From a1765a2896714c956deb8eefcde93af074901f8e Mon Sep 17 00:00:00 2001 From: jfhumann Date: Sat, 26 Apr 2014 14:23:53 +0200 Subject: Fixed unitialized member in gZipFile (CID 43673) --- src/OSSupport/GZipFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/OSSupport') diff --git a/src/OSSupport/GZipFile.cpp b/src/OSSupport/GZipFile.cpp index 7a8433f4f..22d887783 100644 --- a/src/OSSupport/GZipFile.cpp +++ b/src/OSSupport/GZipFile.cpp @@ -11,7 +11,7 @@ cGZipFile::cGZipFile(void) : - m_File(NULL) + m_File(NULL), m_Mode(fmRead) { } -- cgit v1.2.3 From a42480cf8266a1e066209823aab42c9a3829adbc Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 28 Apr 2014 10:31:07 -0700 Subject: Template Magic Removed need to allocate a fake meta block by using templates to provide a version of the code that does not use metas. Also changed the function to a template argument to make sure that the compilier is able to inline it. --- src/OSSupport/File.cpp | 4 ++-- src/OSSupport/File.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/OSSupport') diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp index f1b3bcf9e..33b9cfc3f 100644 --- a/src/OSSupport/File.cpp +++ b/src/OSSupport/File.cpp @@ -143,7 +143,7 @@ bool cFile::IsEOF(void) const -int cFile::Read (void * iBuffer, int iNumBytes) +int cFile::Read (void * iBuffer, size_t iNumBytes) { ASSERT(IsOpen()); @@ -159,7 +159,7 @@ int cFile::Read (void * iBuffer, int iNumBytes) -int cFile::Write(const void * iBuffer, int iNumBytes) +int cFile::Write(const void * iBuffer, size_t iNumBytes) { ASSERT(IsOpen()); diff --git a/src/OSSupport/File.h b/src/OSSupport/File.h index b394c5cb9..2a7ecf0ed 100644 --- a/src/OSSupport/File.h +++ b/src/OSSupport/File.h @@ -80,10 +80,10 @@ public: bool IsEOF(void) const; /** Reads up to iNumBytes bytes into iBuffer, returns the number of bytes actually read, or -1 on failure; asserts if not open */ - int Read (void * iBuffer, int iNumBytes); + int Read (void * iBuffer, size_t iNumBytes); /** Writes up to iNumBytes bytes from iBuffer, returns the number of bytes actually written, or -1 on failure; asserts if not open */ - int Write(const void * iBuffer, int iNumBytes); + int Write(const void * iBuffer, size_t iNumBytes); /** Seeks to iPosition bytes from file start, returns old position or -1 for failure; asserts if not open */ int Seek (int iPosition); -- cgit v1.2.3