From d8378f071e54512f41e076547357f663125bea7f Mon Sep 17 00:00:00 2001 From: AG Date: Mon, 26 Oct 2015 22:28:24 +0100 Subject: min & max are not from std namespace u_int8_t is unsigned char strings.h file is missing errors generated by deprecated functions are now hidden (C4996 warning) --- lib/backupstore/BackupStoreFile.cpp | 4 ++-- lib/backupstore/BackupStoreRefCountDatabase.cpp | 2 +- lib/common/BoxPlatform.h | 5 +++-- lib/httpserver/HTTPRequest.cpp | 1 - lib/win32/emu.h | 19 ++++++++++--------- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/backupstore/BackupStoreFile.cpp b/lib/backupstore/BackupStoreFile.cpp index 99562685..5ceefe90 100644 --- a/lib/backupstore/BackupStoreFile.cpp +++ b/lib/backupstore/BackupStoreFile.cpp @@ -304,7 +304,7 @@ void BackupStoreFile::VerifyStream::Write(const void *pBuffer, int NBytes, int T size_t BytesLeftInCurrentUnit = mCurrentUnitSize - mCurrentUnitData.GetSize(); // Add however many bytes are needed/available to the current unit's buffer. - BytesToAdd = std::min(BytesLeftInCurrentUnit, (size_t)NBytes); + BytesToAdd = min(BytesLeftInCurrentUnit, (size_t)NBytes); } // We must make progress here, or we could have infinite recursion. @@ -502,7 +502,7 @@ void BackupStoreFile::VerifyStream::Close(bool CloseCopyStream) CollectInBufferStream* pPreviousBuffer = mCurrentBufferIsAlternate ? &mCurrentUnitData : &mAlternateData; - int64_t BytesFromCurrentBuffer = std::min(mBlockIndexSize, + int64_t BytesFromCurrentBuffer = min(mBlockIndexSize, (int64_t)pCurrentBuffer->GetSize()); int64_t BytesFromPreviousBuffer = mBlockIndexSize - BytesFromCurrentBuffer; diff --git a/lib/backupstore/BackupStoreRefCountDatabase.cpp b/lib/backupstore/BackupStoreRefCountDatabase.cpp index 8b51b70a..24c7b38e 100644 --- a/lib/backupstore/BackupStoreRefCountDatabase.cpp +++ b/lib/backupstore/BackupStoreRefCountDatabase.cpp @@ -346,7 +346,7 @@ int BackupStoreRefCountDatabase::ReportChangesTo(BackupStoreRefCountDatabase& rO int64_t MaxNewObjectId = GetLastObjectIDUsed(); for (int64_t ObjectID = BACKUPSTORE_ROOT_DIRECTORY_ID; - ObjectID < std::max(MaxOldObjectId, MaxNewObjectId); + ObjectID < max(MaxOldObjectId, MaxNewObjectId); ObjectID++) { typedef BackupStoreRefCountDatabase::refcount_t refcount_t; diff --git a/lib/common/BoxPlatform.h b/lib/common/BoxPlatform.h index 06f34d5c..12d6c3d7 100644 --- a/lib/common/BoxPlatform.h +++ b/lib/common/BoxPlatform.h @@ -109,12 +109,13 @@ #endif #if defined WIN32 && !defined __MINGW32__ - typedef __int8 int8_t; + typedef signed char int8_t; + typedef unsigned char u_int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; - typedef unsigned __int8 u_int8_t; + //typedef unsigned __int8 u_int8_t; typedef unsigned __int16 u_int16_t; typedef unsigned __int32 u_int32_t; typedef unsigned __int64 u_int64_t; diff --git a/lib/httpserver/HTTPRequest.cpp b/lib/httpserver/HTTPRequest.cpp index 1e3e2694..9ab1717a 100644 --- a/lib/httpserver/HTTPRequest.cpp +++ b/lib/httpserver/HTTPRequest.cpp @@ -10,7 +10,6 @@ #include "Box.h" #include -#include #include #include diff --git a/lib/win32/emu.h b/lib/win32/emu.h index 5669c411..d1622233 100644 --- a/lib/win32/emu.h +++ b/lib/win32/emu.h @@ -44,8 +44,8 @@ typedef __int32 int32_t; typedef unsigned __int16 uint16_t; typedef __int16 int16_t; - typedef unsigned __int8 uint8_t; - typedef __int8 int8_t; + typedef unsigned char uint8_t; + typedef signed char int8_t; #endif // emulated types, present on MinGW but not MSVC or vice versa @@ -83,13 +83,14 @@ #ifdef _MSC_VER // Microsoft decided to deprecate the standard POSIX functions. Great! -#define open(file,flags,mode) _open(file,flags,mode) -#define close(fd) _close(fd) -#define dup(fd) _dup(fd) -#define read(fd,buf,count) _read(fd,buf,count) -#define write(fd,buf,count) _write(fd,buf,count) -#define lseek(fd,off,whence) _lseek(fd,off,whence) -#define fileno(struct_file) _fileno(struct_file) +// #define open(file,flags,mode) _open(file,flags,mode) +// #define close(fd) _close(fd) +// #define dup(fd) _dup(fd) +// #define read(fd,buf,count) _read(fd,buf,count) //collision with lib\httpserver\decode.h@61 (istream_in.read((char*)code, N);) +// #define write(fd,buf,count) _write(fd,buf,count) //collision with lib\httpserver\decode.h@64 ostream_in.write((const char*)plaintext, plainlength); +// #define lseek(fd,off,whence) _lseek(fd,off,whence) +// #define fileno(struct_file) _fileno(struct_file) +#define strncasecmp(buf, msg, cbLength) _strnicmp(buf, msg, cbLength) #endif struct passwd { -- cgit v1.2.3