mirror of https://gitlab.com/rnger/amath
Fix 64 bit warnings
This commit is contained in:
parent
d148be57b3
commit
818df0fc87
|
@ -126,7 +126,7 @@ void CharBuffer::EnsureSize(unsigned int size)
|
||||||
} else { // Buffer already in use.
|
} else { // Buffer already in use.
|
||||||
// Make at least double size
|
// Make at least double size
|
||||||
cursize = cursize < tempsize * 2 ? tempsize * 2 : cursize;
|
cursize = cursize < tempsize * 2 ? tempsize * 2 : cursize;
|
||||||
unsigned int offset = ptr - buf;
|
unsigned int offset = (unsigned int)(ptr - buf);
|
||||||
char *temp = new char[cursize];
|
char *temp = new char[cursize];
|
||||||
MemCopy(temp, buf, tempsize);
|
MemCopy(temp, buf, tempsize);
|
||||||
delete [] buf;
|
delete [] buf;
|
||||||
|
@ -144,7 +144,7 @@ void CharBuffer::EnsureSize(unsigned int blocksize, unsigned int blocks)
|
||||||
buf = new char[cursize];
|
buf = new char[cursize];
|
||||||
ptr = buf;
|
ptr = buf;
|
||||||
} else {
|
} else {
|
||||||
unsigned int tptr = ptr - buf;
|
unsigned int tptr = (unsigned int)(ptr - buf);
|
||||||
char *temp = new char[blocksize * blocks];
|
char *temp = new char[blocksize * blocks];
|
||||||
MemCopy(temp, buf, cursize);
|
MemCopy(temp, buf, cursize);
|
||||||
delete [] buf;
|
delete [] buf;
|
||||||
|
@ -157,7 +157,7 @@ void CharBuffer::EnsureSize(unsigned int blocksize, unsigned int blocks)
|
||||||
|
|
||||||
void CharBuffer::EnsureGrowth(unsigned int size)
|
void CharBuffer::EnsureGrowth(unsigned int size)
|
||||||
{
|
{
|
||||||
EnsureSize((ptr - buf) + size);
|
EnsureSize((unsigned int)((ptr - buf) + size));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CharBuffer::Is(const char* string)
|
bool CharBuffer::Is(const char* string)
|
||||||
|
|
|
@ -63,6 +63,8 @@
|
||||||
#include <clib/dos_protos.h>
|
#include <clib/dos_protos.h>
|
||||||
#include <clib/intuition_protos.h>
|
#include <clib/intuition_protos.h>
|
||||||
#include <clib/locale_protos.h>
|
#include <clib/locale_protos.h>
|
||||||
|
#else
|
||||||
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *vers = TXTDOSVERSION;
|
const char *vers = TXTDOSVERSION;
|
||||||
|
|
|
@ -213,8 +213,8 @@ void FreeAllSafe()
|
||||||
void MemUsage(long *blocks, long *size, long *peak)
|
void MemUsage(long *blocks, long *size, long *peak)
|
||||||
{
|
{
|
||||||
*blocks = list->count;
|
*blocks = list->count;
|
||||||
*size = list->size;
|
*size = (long)list->size;
|
||||||
*peak = list->peak;;
|
*peak = (long)list->peak;;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -388,7 +388,7 @@ tU32 FormatScientific
|
||||||
RJ_ASSERT( bufferSize > 0 );
|
RJ_ASSERT( bufferSize > 0 );
|
||||||
pCurOut[0] = '\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';
|
*pCurOut = '\0';
|
||||||
return pCurOut - pOutBuffer;
|
return (tU32)(pCurOut - pOutBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//******************************************************************************
|
//******************************************************************************
|
||||||
|
|
|
@ -1157,5 +1157,5 @@ tU32 Dragon4
|
||||||
|
|
||||||
// return the number of digits output
|
// return the number of digits output
|
||||||
RJ_ASSERT(pCurDigit - pOutBuffer <= (tPtrDiff)bufferSize);
|
RJ_ASSERT(pCurDigit - pOutBuffer <= (tPtrDiff)bufferSize);
|
||||||
return pCurDigit - pOutBuffer;
|
return (tU32)(pCurDigit - pOutBuffer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,10 +46,7 @@
|
||||||
#define EULERS 2.718281828459045235360287471352
|
#define EULERS 2.718281828459045235360287471352
|
||||||
#define sgn(x) (x > 0.0 ? 1.0 : x < 0.0 ? -1.0 : 0.0)
|
#define sgn(x) (x > 0.0 ? 1.0 : x < 0.0 ? -1.0 : 0.0)
|
||||||
#define log2p(x,y) (log(x)/log(y))
|
#define log2p(x,y) (log(x)/log(y))
|
||||||
|
#define abs(x) (x > 0 ? x : -x)
|
||||||
#ifdef AMIGA
|
|
||||||
# define abs(x) (x > 0 ? x : -x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -100,12 +100,6 @@ typedef int bool;
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__STDC__) && !defined(AMIGA)
|
|
||||||
# ifndef STDLIBS
|
|
||||||
# define STDLIBS
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef AMIGA
|
#ifdef AMIGA
|
||||||
# include <dos/var.h>
|
# include <dos/var.h>
|
||||||
# include <dos/exall.h>
|
# include <dos/exall.h>
|
||||||
|
@ -120,25 +114,20 @@ typedef int bool;
|
||||||
# include <devices/conunit.h>
|
# include <devices/conunit.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STDLIBS
|
|
||||||
# include <stdio.h>
|
|
||||||
# include <stdint.h>
|
|
||||||
# include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAIKU
|
#ifdef HAIKU
|
||||||
|
# include <stdint.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# include <dirent.h>
|
# include <dirent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
|
# include <stdint.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# include <dirent.h>
|
# include <dirent.h>
|
||||||
# include <termios.h>
|
# include <termios.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# include <stdio.h>
|
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue