diff --git a/app/lib/charbuf.cpp b/app/lib/charbuf.cpp index b0207450..9fb0a220 100644 --- a/app/lib/charbuf.cpp +++ b/app/lib/charbuf.cpp @@ -126,7 +126,7 @@ void CharBuffer::EnsureSize(unsigned int size) } else { // Buffer already in use. // Make at least double size cursize = cursize < tempsize * 2 ? tempsize * 2 : cursize; - unsigned int offset = ptr - buf; + unsigned int offset = (unsigned int)(ptr - buf); char *temp = new char[cursize]; MemCopy(temp, buf, tempsize); delete [] buf; @@ -144,7 +144,7 @@ void CharBuffer::EnsureSize(unsigned int blocksize, unsigned int blocks) buf = new char[cursize]; ptr = buf; } else { - unsigned int tptr = ptr - buf; + unsigned int tptr = (unsigned int)(ptr - buf); char *temp = new char[blocksize * blocks]; MemCopy(temp, buf, cursize); delete [] buf; @@ -157,7 +157,7 @@ void CharBuffer::EnsureSize(unsigned int blocksize, unsigned int blocks) void CharBuffer::EnsureGrowth(unsigned int size) { - EnsureSize((ptr - buf) + size); + EnsureSize((unsigned int)((ptr - buf) + size)); } bool CharBuffer::Is(const char* string) diff --git a/app/system/base/io.cpp b/app/system/base/io.cpp index c5ac5d63..f9945509 100644 --- a/app/system/base/io.cpp +++ b/app/system/base/io.cpp @@ -63,6 +63,8 @@ #include #include #include +#else +#include #endif const char *vers = TXTDOSVERSION; diff --git a/lib/clib/mem.c b/lib/clib/mem.c index 173eaaed..dc0dd8bd 100644 --- a/lib/clib/mem.c +++ b/lib/clib/mem.c @@ -213,8 +213,8 @@ void FreeAllSafe() void MemUsage(long *blocks, long *size, long *peak) { *blocks = list->count; - *size = list->size; - *peak = list->peak;; + *size = (long)list->size; + *peak = (long)list->peak;; } /** diff --git a/lib/dconv/dprint.cpp b/lib/dconv/dprint.cpp index 85e9d422..0829a631 100644 --- a/lib/dconv/dprint.cpp +++ b/lib/dconv/dprint.cpp @@ -388,7 +388,7 @@ tU32 FormatScientific RJ_ASSERT( bufferSize > 0 ); pCurOut[0] = '\0'; - return pCurOut - pOutBuffer; + return (tU32)(pCurOut - pOutBuffer); } //****************************************************************************** @@ -418,7 +418,7 @@ static tU32 PrintHex(tC8 * pOutBuffer, tU32 bufferSize, tU64 value, tU32 width) } *pCurOut = '\0'; - return pCurOut - pOutBuffer; + return (tU32)(pCurOut - pOutBuffer); } //****************************************************************************** diff --git a/lib/dconv/dragon4.cpp b/lib/dconv/dragon4.cpp index 9b6e3bd3..30646a5d 100755 --- a/lib/dconv/dragon4.cpp +++ b/lib/dconv/dragon4.cpp @@ -1157,5 +1157,5 @@ tU32 Dragon4 // return the number of digits output RJ_ASSERT(pCurDigit - pOutBuffer <= (tPtrDiff)bufferSize); - return pCurDigit - pOutBuffer; + return (tU32)(pCurDigit - pOutBuffer); } diff --git a/lib/math.h b/lib/math.h index 20ecd0da..4c807a37 100644 --- a/lib/math.h +++ b/lib/math.h @@ -46,10 +46,7 @@ #define EULERS 2.718281828459045235360287471352 #define sgn(x) (x > 0.0 ? 1.0 : x < 0.0 ? -1.0 : 0.0) #define log2p(x,y) (log(x)/log(y)) - -#ifdef AMIGA -# define abs(x) (x > 0 ? x : -x) -#endif +#define abs(x) (x > 0 ? x : -x) #ifdef __cplusplus extern "C" { diff --git a/lib/platform.h b/lib/platform.h index 3e544ce8..ea2b851b 100644 --- a/lib/platform.h +++ b/lib/platform.h @@ -100,12 +100,6 @@ typedef int bool; # endif #endif -#if defined(__STDC__) && !defined(AMIGA) -# ifndef STDLIBS -# define STDLIBS -# endif -#endif - #ifdef AMIGA # include # include @@ -120,25 +114,20 @@ typedef int bool; # include #endif -#ifdef STDLIBS -# include -# include -# include -#endif - #ifdef HAIKU +# include # include # include #endif #ifdef UNIX +# include # include # include # include #endif #ifdef _WIN32 -# include # include #endif