Some [U]INT_MAX --> [U]INT32_MAX.

git-svn-id: https://svn.eduke32.com/eduke32@2986 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-09-02 14:06:30 +00:00
parent 7f74880c96
commit 52bb35361b
4 changed files with 10 additions and 10 deletions

View file

@ -2269,8 +2269,8 @@ static inline int32_t boundmulscale(int32_t a, int32_t d, int32_t c)
{ // courtesy of Ken
int64_t p;
p = (((int64_t)a)*((int64_t)d))>>c;
if (p >= INT_MAX) p = INT_MAX;
if (p < INT_MIN) p = INT_MIN;
if (p >= INT32_MAX) p = INT32_MAX;
if (p < INT32_MIN) p = INT32_MIN;
return((int32_t)p);
}

View file

@ -3240,7 +3240,7 @@ void overheadeditor(void)
if (zoom >= 768)
{
int32_t alwaysshowgray =
(showinnergray || !(editorzrange[0]==INT32_MIN && editorzrange[1]==INT_MAX));
(showinnergray || !(editorzrange[0]==INT32_MIN && editorzrange[1]==INT32_MAX));
for (i=0, k=0; (m32_sideview && k<m32_swcnt) || (!m32_sideview && i<MAXSPRITES); i++, k++)
{
@ -7919,7 +7919,7 @@ int32_t getpointhighlight(int32_t xplc, int32_t yplc, int32_t point)
{
int32_t i, j, dst, dist = 512, closest = -1;
int32_t dax,day;
int32_t alwaysshowgray = (showinnergray || !(editorzrange[0]==INT32_MIN && editorzrange[1]==INT_MAX));
int32_t alwaysshowgray = (showinnergray || !(editorzrange[0]==INT32_MIN && editorzrange[1]==INT32_MAX));
if (numwalls == 0)
return -1;

View file

@ -826,7 +826,7 @@ char *Bstrupr(char *s)
uint32_t Bgetsysmemsize(void)
{
#ifdef _WIN32
uint32_t siz = UINT_MAX;
uint32_t siz = UINT32_MAX;
HMODULE lib = LoadLibrary("KERNEL32.DLL");
if (lib)
@ -840,7 +840,7 @@ uint32_t Bgetsysmemsize(void)
MEMORYSTATUSEX memst;
memst.dwLength = sizeof(MEMORYSTATUSEX);
if (aGlobalMemoryStatusEx(&memst))
siz = (uint32_t)min(UINT_MAX, memst.ullTotalPhys);
siz = (uint32_t)min(UINT32_MAX, memst.ullTotalPhys);
}
else
{
@ -854,7 +854,7 @@ uint32_t Bgetsysmemsize(void)
return siz;
#elif (defined(_SC_PAGE_SIZE) || defined(_SC_PAGESIZE)) && defined(_SC_PHYS_PAGES) && !defined(GEKKO)
uint32_t siz = UINT_MAX;
uint32_t siz = UINT32_MAX;
int64_t scpagesiz, scphyspages;
#ifdef _SC_PAGE_SIZE
@ -864,14 +864,14 @@ uint32_t Bgetsysmemsize(void)
#endif
scphyspages = sysconf(_SC_PHYS_PAGES);
if (scpagesiz >= 0 && scphyspages >= 0)
siz = (uint32_t)min(UINT_MAX, (int64_t)scpagesiz * (int64_t)scphyspages);
siz = (uint32_t)min(UINT32_MAX, (int64_t)scpagesiz * (int64_t)scphyspages);
//initprintf("Bgetsysmemsize(): %d pages of %d bytes, %d bytes of system memory\n",
// scphyspages, scpagesiz, siz);
return siz;
#else
return UINT_MAX;
return UINT32_MAX;
#endif
}

View file

@ -2687,7 +2687,7 @@ nullquote:
int64_t dax=Gv_GetVarX(*insptr++), day=Gv_GetVarX(*insptr++);
int64_t hypsq = dax*dax + day*day;
if (hypsq > (int64_t)INT_MAX)
if (hypsq > (int64_t)INT32_MAX)
Gv_SetVarX(retvar, (int32_t)sqrt((double)hypsq));
else
Gv_SetVarX(retvar, ksqrt((uint32_t)hypsq));