* fixed crappy min/max problems (hopefully)

* aaaand one more try to get std::ios_base::openmode in func_fopen() nulled...
This commit is contained in:
false_genesis 2008-03-28 19:23:47 +00:00
parent b4a5cebc77
commit 1288cd8f2a
3 changed files with 5 additions and 10 deletions

View File

@ -17,7 +17,7 @@ DefReturnResult DefScriptPackage::func_fopen(CmdSet& Set)
if(fh->is_open()) if(fh->is_open())
return ""; return "";
std::string mode = stringToLower(Set.arg[1]); std::string mode = stringToLower(Set.arg[1]);
std::ios::openmode m = 0; std::ios::openmode m = (std::ios::openmode)(0);
if(mode.find('b') != std::string::npos) if(mode.find('b') != std::string::npos)
m |= std::ios_base::binary; m |= std::ios_base::binary;
if(mode.find('a') != std::string::npos) if(mode.find('a') != std::string::npos)

View File

@ -297,8 +297,8 @@ void SceneWorld::UpdateTerrain(void)
for(s32 i=0; i<terrain->getSize().Width+1; i++) for(s32 i=0; i<terrain->getSize().Width+1; i++)
{ {
curheight = terrain->getHeight(i,j); curheight = terrain->getHeight(i,j);
highest = max(highest,curheight); highest = MAX(highest,curheight);
lowest = min(lowest,curheight); lowest = MIN(lowest,curheight);
} }
// f32 heightdiff = highest - lowest; // f32 heightdiff = highest - lowest;

View File

@ -87,13 +87,8 @@
#define SIGQUIT 3 #define SIGQUIT 3
#endif #endif
#ifndef min #define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define min(a, b) ((a < b) ? a : b) #define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef max
#define max(a, b) ((a > b) ? a : b)
#endif
#if COMPILER == COMPILER_MICROSOFT #if COMPILER == COMPILER_MICROSOFT
# if _MSC_VER >= 1500 # if _MSC_VER >= 1500