diff --git a/desmume/src/movie.cpp b/desmume/src/movie.cpp index 132343875..a189972dc 100644 --- a/desmume/src/movie.cpp +++ b/desmume/src/movie.cpp @@ -181,7 +181,7 @@ void MovieRecord::dump(EMUFILE &fp) //dump the misc commands //*os << '|' << setw(1) << (int)commands; fp.fputc('|'); - putdec(fp,commands); + putdec(fp,commands); fp.fputc('|'); dumpPad(fp, pad); @@ -944,7 +944,7 @@ void FCEUI_SaveMovie(const char *fname, std::wstring author, START_FROM startFro // osd->addFixed(180, 176, "%s", "Recording"); } - /*extern uint8 joy[4]; + /*extern u8 joy[4]; memcpy(&cur_input_display,joy,4);*/ } diff --git a/desmume/src/saves.cpp b/desmume/src/saves.cpp index df9df4c26..61cb28bb7 100644 --- a/desmume/src/saves.cpp +++ b/desmume/src/saves.cpp @@ -1344,7 +1344,7 @@ bool savestate_load(EMUFILE &is) #ifdef HAVE_LIBZ uLongf uncomprlen = len; - int error = uncompress((uint8*)&buf[0],&uncomprlen,(uint8*)&cbuf[0],comprlen); + int error = uncompress((u8*)&buf[0],&uncomprlen,(u8*)&cbuf[0],comprlen); if (error != Z_OK || uncomprlen != len) return false; #endif diff --git a/desmume/src/types.h b/desmume/src/types.h index a4c3b3a15..6bb598dc0 100644 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -19,6 +19,7 @@ #ifndef TYPES_HPP #define TYPES_HPP +#include #include #include #include @@ -229,44 +230,15 @@ #endif #endif -#if defined(__LP64__) -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef unsigned long long u64; +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; -typedef signed char s8; -typedef signed short s16; -typedef signed int s32; -typedef signed long long s64; -#else -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -#if defined(_MSC_VER) || defined(__INTEL_COMPILER) -typedef unsigned __int64 u64; -#else -typedef unsigned long long u64; -#endif - -typedef signed char s8; -typedef signed short s16; -typedef signed int s32; -#if defined(_MSC_VER) || defined(__INTEL_COMPILER) -typedef __int64 s64; -#else -typedef signed long long s64; -#endif -#endif - -typedef u8 uint8; -typedef u16 uint16; - -#ifndef OBJ_C -typedef u32 uint32; -#else -#define uint32 u32 //uint32 is defined in Leopard somewhere, avoid conflicts -#endif +typedef int8_t s8; +typedef int16_t s16; +typedef int32_t s32; +typedef int64_t s64; #ifdef ENABLE_ALTIVEC #ifndef __APPLE_ALTIVEC__ @@ -378,7 +350,7 @@ typedef __m512 v512f32; typedef s32 f32; #define inttof32(n) ((n) << 12) #define f32toint(n) ((n) >> 12) -#define floattof32(n) ((int32)((n) * (1 << 12))) +#define floattof32(n) ((s32)((n) * (1 << 12))) #define f32tofloat(n) (((float)(n)) / (float)(1<<12)) typedef s16 t16; diff --git a/desmume/src/utils/guid.cpp b/desmume/src/utils/guid.cpp index 6b32e1c20..5fce4f89b 100644 --- a/desmume/src/utils/guid.cpp +++ b/desmume/src/utils/guid.cpp @@ -68,7 +68,7 @@ Desmume_Guid Desmume_Guid::fromString(std::string str) return ret; } -uint8 Desmume_Guid::hexToByte(char** ptrptr) +u8 Desmume_Guid::hexToByte(char** ptrptr) { char a = toupper(**ptrptr); (*ptrptr)++; diff --git a/desmume/src/utils/guid.h b/desmume/src/utils/guid.h index 05712cbeb..2b03f3531 100644 --- a/desmume/src/utils/guid.h +++ b/desmume/src/utils/guid.h @@ -43,7 +43,7 @@ struct Desmume_Guid : public ValueArray void newGuid(); std::string toString(); static Desmume_Guid fromString(std::string str); - static uint8 hexToByte(char** ptrptr); + static u8 hexToByte(char** ptrptr); void scan(std::string& str); };