Fix 64 bit warnings

This commit is contained in:
Carsten Larsen 2017-02-04 14:41:34 +01:00
parent f2a11509ba
commit d1135f9d06
7 changed files with 13 additions and 25 deletions

View File

@ -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)

View File

@ -63,6 +63,8 @@
#include <clib/dos_protos.h>
#include <clib/intuition_protos.h>
#include <clib/locale_protos.h>
#else
#include <stdio.h>
#endif
const char *vers = TXTDOSVERSION;

View File

@ -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;;
}
/**

View File

@ -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);
}
//******************************************************************************

View File

@ -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);
}

View File

@ -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" {

View File

@ -100,12 +100,6 @@ typedef int bool;
# endif
#endif
#if defined(__STDC__) && !defined(AMIGA)
# ifndef STDLIBS
# define STDLIBS
# endif
#endif
#ifdef AMIGA
# include <dos/var.h>
# include <dos/exall.h>
@ -120,25 +114,20 @@ typedef int bool;
# include <devices/conunit.h>
#endif
#ifdef STDLIBS
# include <stdio.h>
# include <stdint.h>
# include <stdlib.h>
#endif
#ifdef HAIKU
# include <stdint.h>
# include <unistd.h>
# include <dirent.h>
#endif
#ifdef UNIX
# include <stdint.h>
# include <unistd.h>
# include <dirent.h>
# include <termios.h>
#endif
#ifdef _WIN32
# include <stdio.h>
# include <stdint.h>
#endif