diff --git a/src/Debug.cpp b/src/Debug.cpp index 2c3a7b4f6..1b01f70ba 100644 --- a/src/Debug.cpp +++ b/src/Debug.cpp @@ -14,7 +14,7 @@ #include -#ifdef WIN32 +#ifdef WIN32__ void RaiseDebugger() { #ifdef DEBUG @@ -119,7 +119,7 @@ void RaiseDebugger() { #endif -#ifdef WIN32 +#ifdef WIN32__ #include "AuxLib.h" // for Windows.h @@ -355,7 +355,7 @@ void OlxWriteCoreDump(const char* fileName) #endif #include #include -#include +//#include #include #include @@ -373,7 +373,7 @@ static void GdbWriteCoreDump(const char* fname) { if(p) { fprintf(p, "%s", gdbparam); fflush(p); - int status = 0; wait(&status); + //int status = 0; wait(&status); pclose(p); } } @@ -447,7 +447,7 @@ void DumpCallstack(void (*PrintOutFct) (const std::string&)) { free(strs); } -#elif defined(WIN32) +#elif defined(WIN32__) #include "StackWalker.h" // Call Luke Stackwalker for help @@ -489,7 +489,7 @@ void DumpCallstack(void (*LineOutFct) (const std::string&)) #else -#warning No DumpCallstack implementation for this arch/sys +//#warning No DumpCallstack implementation for this arch/sys void DumpCallstackPrintf(void* callpnt) { printf("DumpCallstackPrintf not implemented\n"); diff --git a/src/FindFile.cpp b/src/FindFile.cpp index dbb6a4e79..8caab4a24 100644 --- a/src/FindFile.cpp +++ b/src/FindFile.cpp @@ -507,6 +507,7 @@ size_t FileSize(const std::string& path) return size; } +#define uchar unsigned char // Checks if the given path is absolute bool IsAbsolutePath(const std::string& path) { diff --git a/src/Unicode.h b/src/Unicode.h index e69747237..f7acce54c 100644 --- a/src/Unicode.h +++ b/src/Unicode.h @@ -154,7 +154,7 @@ std::string Utf16ToUtf8(const Utf16String& str); Utf16String Utf8ToUtf16(const std::string& str); std::string UnicodeToUtf8(const UnicodeString& str); UnicodeString Utf8ToUnicode(const std::string& str); -#ifdef WIN32 +#ifdef WIN32__ std::string Utf8ToSystemNative(const std::string& utf8str); std::string SystemNativeToUtf8(const std::string& natstr); #else // Other platforms use natively utf8 (at least we suppose so) diff --git a/src/ai/vortelite.cpp b/src/ai/vortelite.cpp index c1b49b5fa..11e267fae 100644 --- a/src/ai/vortelite.cpp +++ b/src/ai/vortelite.cpp @@ -111,10 +111,10 @@ reprocess: ; { if (objects[o].ai.vortelite.timesincefire > VORTELITE_MIN_TIME_BETWEEN_FIRE) { - if (rnd()%VORTELITE_FIRE_PROB == (VORTELITE_FIRE_PROB/2)) + if (rand()%VORTELITE_FIRE_PROB == (VORTELITE_FIRE_PROB/2)) { // let's fire // usually shoot toward keen - if (rnd()%5 != 0) + if (rand()%5 != 0) { if (objects[o].x < player[primaryplayer].x) { @@ -295,7 +295,7 @@ void vortelite_initiatejump(int o) objects[o].ai.vortelite.frame = 0; objects[o].ai.vortelite.animtimer = 0; objects[o].ai.vortelite.inertiay = \ - -((rnd()%(VORTELITE_MAX_JUMP_HEIGHT-VORTELITE_MIN_JUMP_HEIGHT))+VORTELITE_MIN_JUMP_HEIGHT); + -((rand()%(VORTELITE_MAX_JUMP_HEIGHT-VORTELITE_MIN_JUMP_HEIGHT))+VORTELITE_MIN_JUMP_HEIGHT); if (objects[o].ai.vortelite.movedir==RIGHT) { diff --git a/src/ai/vortelite.h b/src/ai/vortelite.h index 59f1e2fa9..fb1262b8e 100644 --- a/src/ai/vortelite.h +++ b/src/ai/vortelite.h @@ -3,8 +3,6 @@ char spawn_object(int x, int y, int otype); unsigned int getmaptileat(unsigned int x, unsigned int y); -uint rnd(void); - void vortelite_ai(int o); void vortelite_initiatejump(int o); diff --git a/src/fileio/CPatcher.cpp b/src/fileio/CPatcher.cpp index deb7be977..2533cfc17 100644 --- a/src/fileio/CPatcher.cpp +++ b/src/fileio/CPatcher.cpp @@ -55,7 +55,7 @@ void CPatcher::patchMemory() TrimSpaces(newbuf); size_t p = newbuf.find(' '); if(p != std::string::npos) { - size_t offset = 0; + long offset = 0; sscanf(newbuf.substr(0,p).c_str(), "%lx", &offset); // Only hexadecimal numbers supported std::string patch_file_name = newbuf.substr(p+1); TrimSpaces(patch_file_name); @@ -125,7 +125,7 @@ bool CPatcher::loadPatchfile() return true; } -void CPatcher::patchMemfromFile(const std::string& patch_file_name, int offset) +void CPatcher::patchMemfromFile(const std::string& patch_file_name, long offset) { unsigned char *buf_to_patch; unsigned char byte; diff --git a/src/fileio/CPatcher.h b/src/fileio/CPatcher.h index 9880fee16..7137ea9f9 100644 --- a/src/fileio/CPatcher.h +++ b/src/fileio/CPatcher.h @@ -17,7 +17,7 @@ public: virtual ~CPatcher(); void patchMemory(); - void patchMemfromFile(const std::string& patch_file_name, int offset); + void patchMemfromFile(const std::string& patch_file_name, long offset); private: diff --git a/src/misc.cpp b/src/misc.cpp index 2fc4012b6..0674eca68 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -1102,15 +1102,6 @@ int dlgX,dlgY,dlgW,dlgH; } while(1); } -// a random number generator -ulong random_seed; -void srnd(ulong newseed) { random_seed = newseed; } -uint rnd(void) -{ - random_seed = random_seed * 1103515245 + 12345; - return (uint)(random_seed / 65536) % 32768; -} - int endsequence(stCloneKeenPlus *pCKP) {