[Scummvm-cvs-logs] scummvm master -> 8754c86686116cd937f5483a65a5eeda48cca02d
fingolfin
max at quendi.de
Tue May 10 11:10:48 CEST 2011
This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
db82d282ea N64: Remove (u)int64 typedefs from common/scummsys.h
6eba8e8292 N64: Fix code formatting
dfff22e56b COMMON: Unify definition of scumm_str(n)icmp
49ab6d0289 COMMON: If config.h is present, don't use hardcoded settings from scummsys.h
3920cfe69e COMMON: Do not #undef _MSC_VER
76780268f2 COMMON: Refactor scummsys.h
8754c86686 COMMON: Refactor typedefs a bit
Commit: db82d282ead67bab5b7889566bbb989c70bf3d12
https://github.com/scummvm/scummvm/commit/db82d282ead67bab5b7889566bbb989c70bf3d12
Author: Max Horn (max at quendi.de)
Date: 2011-05-09T07:23:21-07:00
Commit Message:
N64: Remove (u)int64 typedefs from common/scummsys.h
Changed paths:
backends/platform/n64/osys_n64_base.cpp
common/scummsys.h
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index 32b2b98..6ec9b66 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -32,6 +32,8 @@
#include "framfs_save_manager.h"
#include "backends/fs/n64/n64-fs-factory.h"
+typedef unsigned long long uint64;
+
extern uint8 _romfs; // Defined by linker (used to calculate position of romfs image)
inline uint16 colRGB888toBGR555(byte r, byte g, byte b);
diff --git a/common/scummsys.h b/common/scummsys.h
index 46f900b..909f2b0 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -309,9 +309,6 @@
typedef unsigned int uint32;
typedef signed int int32;
- typedef unsigned long long uint64;
- typedef signed long long int64;
-
#elif defined(__PSP__)
#include <malloc.h>
Commit: 6eba8e8292579a50fe83ddf5f767131a18360f91
https://github.com/scummvm/scummvm/commit/6eba8e8292579a50fe83ddf5f767131a18360f91
Author: Max Horn (max at quendi.de)
Date: 2011-05-09T07:23:21-07:00
Commit Message:
N64: Fix code formatting
Changed paths:
backends/platform/n64/osys_n64_base.cpp
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index 6ec9b66..ae8d23d 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -92,9 +92,9 @@ OSystem_N64::OSystem_N64() {
_shakeOffset = 0;
// Allocate memory for offscreen buffers
- _offscreen_hic = (uint16*)memalign(8, _screenWidth * _screenHeight * 2);
- _offscreen_pal = (uint8*)memalign(8, _screenWidth * _screenHeight);
- _overlayBuffer = (uint16*)memalign(8, _overlayWidth * _overlayHeight * sizeof(OverlayColor));
+ _offscreen_hic = (uint16 *)memalign(8, _screenWidth * _screenHeight * 2);
+ _offscreen_pal = (uint8 *)memalign(8, _screenWidth * _screenHeight);
+ _overlayBuffer = (uint16 *)memalign(8, _overlayWidth * _overlayHeight * sizeof(OverlayColor));
_cursor_pal = NULL;
_cursor_hic = NULL;
@@ -113,9 +113,9 @@ OSystem_N64::OSystem_N64() {
_graphicMode = OVERS_NTSC_340X240;
// Clear palette array
- _screenPalette = (uint16*)memalign(8, 256 * sizeof(uint16));
+ _screenPalette = (uint16 *)memalign(8, 256 * sizeof(uint16));
#ifndef N64_EXTREME_MEMORY_SAVING
- _screenExactPalette = (uint8*)memalign(8, 256 * 3);
+ _screenExactPalette = (uint8 *)memalign(8, 256 * 3);
memset(_screenExactPalette, 0, 256 * 3);
#endif
memset(_screenPalette, 0, 256 * sizeof(uint16));
@@ -127,7 +127,7 @@ OSystem_N64::OSystem_N64() {
_audioEnabled = false;
// Initialize ROMFS access interface
- initRomFSmanager((uint8*)(((uint32)&_romfs + (uint32)0xc00) | (uint32)0xB0000000));
+ initRomFSmanager((uint8 *)(((uint32)&_romfs + (uint32)0xc00) | (uint32)0xB0000000));
_mouseVisible = false;
@@ -376,7 +376,7 @@ void OSystem_N64::rebuildOffscreenGameBuffer(void) {
for (int h = 0; h < _gameHeight; h++) {
for (int w = 0; w < _gameWidth; w += 4) {
- four_col_pal = *(uint32*)(_offscreen_pal + ((h * _screenWidth) + w));
+ four_col_pal = *(uint32 *)(_offscreen_pal + ((h * _screenWidth) + w));
four_col_hi = 0;
four_col_hi |= (uint64)_screenPalette[((four_col_pal >> 24) & 0xFF)] << 48;
@@ -385,7 +385,7 @@ void OSystem_N64::rebuildOffscreenGameBuffer(void) {
four_col_hi |= (uint64)_screenPalette[((four_col_pal >> 0) & 0xFF)] << 0;
// Save the converted pixels into hicolor buffer
- *(uint64*)((_offscreen_hic) + (h * _screenWidth) + w) = four_col_hi;
+ *(uint64 *)((_offscreen_hic) + (h * _screenWidth) + w) = four_col_hi;
}
}
}
@@ -522,7 +522,7 @@ void OSystem_N64::updateScreen() {
// Obtain the framebuffer
while (!(_dc = lockDisplay()));
- uint16 *overlay_framebuffer = (uint16*)_dc->conf.framebuffer; // Current screen framebuffer
+ uint16 *overlay_framebuffer = (uint16 *)_dc->conf.framebuffer; // Current screen framebuffer
uint16 *game_framebuffer = overlay_framebuffer + (_frameBufferWidth * skip_lines * 2); // Skip some lines to center the image vertically
uint16 currentHeight, currentWidth;
@@ -534,8 +534,8 @@ void OSystem_N64::updateScreen() {
tmpDst = game_framebuffer;
tmpSrc = _offscreen_hic + (_shakeOffset * _screenWidth);
for (currentHeight = _shakeOffset; currentHeight < _gameHeight; currentHeight++) {
- uint64 *game_dest = (uint64*)(tmpDst + skip_pixels + _offscrPixels);
- uint64 *game_src = (uint64*)tmpSrc;
+ uint64 *game_dest = (uint64 *)(tmpDst + skip_pixels + _offscrPixels);
+ uint64 *game_src = (uint64 *)tmpSrc;
// With uint64 we copy 4 pixels at a time
for (currentWidth = 0; currentWidth < _gameWidth; currentWidth += 4) {
@@ -554,8 +554,8 @@ void OSystem_N64::updateScreen() {
tmpDst = overlay_framebuffer;
tmpSrc = _overlayBuffer;
for (currentHeight = 0; currentHeight < _overlayHeight; currentHeight++) {
- uint64 *over_dest = (uint64*)(tmpDst + _offscrPixels);
- uint64 *over_src = (uint64*)tmpSrc;
+ uint64 *over_dest = (uint64 *)(tmpDst + _offscrPixels);
+ uint64 *over_src = (uint64 *)tmpSrc;
// Copy 4 pixels at a time
for (currentWidth = 0; currentWidth < _overlayWidth; currentWidth += 4) {
@@ -792,8 +792,8 @@ void OSystem_N64::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
}
if (!_cursor_pal) {
- _cursor_pal = (uint8*)malloc(w * h);
- _cursor_hic = (uint16*)malloc(w * h * sizeof(uint16));
+ _cursor_pal = (uint8 *)malloc(w * h);
+ _cursor_hic = (uint16 *)malloc(w * h * sizeof(uint16));
}
_cursorWidth = w;
@@ -909,7 +909,7 @@ void OSystem_N64::setupMixer(void) {
/* Check all controller ports for a compatible input adapter. */
void OSystem_N64::detectControllers(void) {
- controller_data_status *ctrl_status = (controller_data_status*)memalign(8, sizeof(controller_data_status));
+ controller_data_status *ctrl_status = (controller_data_status *)memalign(8, sizeof(controller_data_status));
controller_Read_Status(ctrl_status);
_controllerPort = -1; // Default no controller
Commit: dfff22e56b4a62a2ec2e3e0564344597fd6605c6
https://github.com/scummvm/scummvm/commit/dfff22e56b4a62a2ec2e3e0564344597fd6605c6
Author: Max Horn (max at quendi.de)
Date: 2011-05-09T07:23:22-07:00
Commit Message:
COMMON: Unify definition of scumm_str(n)icmp
Changed paths:
common/scummsys.h
diff --git a/common/scummsys.h b/common/scummsys.h
index 909f2b0..b661aca 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -140,6 +140,20 @@
#define SCUMMVM_DONT_DEFINE_TYPES
#endif
+//
+// Define scumm_stricmp and scumm_strnicmp
+//
+#if defined(_WIN32_WCE) || defined(_MSC_VER)
+ #define scumm_stricmp stricmp
+ #define scumm_strnicmp _strnicmp
+#elif defined(__MINGW32__) || defined(__GP32__) || defined(__DS__)
+ #define scumm_stricmp stricmp
+ #define scumm_strnicmp strnicmp
+#else
+ #define scumm_stricmp strcasecmp
+ #define scumm_strnicmp strncasecmp
+#endif
+
//
// By default we try to use pragma push/pop to ensure various structs we use
@@ -157,9 +171,6 @@
#if defined(__SYMBIAN32__)
- #define scumm_stricmp strcasecmp
- #define scumm_strnicmp strncasecmp
-
#define SCUMM_LITTLE_ENDIAN
#define SCUMM_NEED_ALIGNMENT
@@ -184,8 +195,6 @@
#elif defined(_WIN32_WCE)
- #define scumm_stricmp stricmp
- #define scumm_strnicmp _strnicmp
#define snprintf _snprintf
#define SCUMM_LITTLE_ENDIAN
@@ -202,8 +211,6 @@
#elif defined(_MSC_VER)
- #define scumm_stricmp stricmp
- #define scumm_strnicmp _strnicmp
#define snprintf _snprintf
#define SCUMM_LITTLE_ENDIAN
@@ -215,19 +222,13 @@
#elif defined(__MINGW32__)
- #define scumm_stricmp stricmp
- #define scumm_strnicmp strnicmp
-
#define SCUMM_LITTLE_ENDIAN
#define PLUGIN_EXPORT __declspec(dllexport)
#elif defined(UNIX)
- #define scumm_stricmp strcasecmp
- #define scumm_strnicmp strncasecmp
-
- #ifndef CONFIG_H
+ #if !defined(CONFIG_H) && defined(SDL_BACKEND)
/* need this for the SDL_BYTEORDER define */
#include <SDL_byteorder.h>
@@ -252,17 +253,11 @@
#elif defined(__DC__)
- #define scumm_stricmp strcasecmp
- #define scumm_strnicmp strncasecmp
-
#define SCUMM_LITTLE_ENDIAN
#define SCUMM_NEED_ALIGNMENT
#elif defined(__GP32__)
- #define scumm_stricmp stricmp
- #define scumm_strnicmp strnicmp
-
#define SCUMM_LITTLE_ENDIAN
#define SCUMM_NEED_ALIGNMENT
@@ -281,17 +276,11 @@
#elif defined(__PLAYSTATION2__)
- #define scumm_stricmp strcasecmp
- #define scumm_strnicmp strncasecmp
-
#define SCUMM_LITTLE_ENDIAN
#define SCUMM_NEED_ALIGNMENT
#elif defined(__N64__)
- #define scumm_stricmp strcasecmp
- #define scumm_strnicmp strncasecmp
-
#define SCUMM_BIG_ENDIAN
#define SCUMM_NEED_ALIGNMENT
@@ -314,9 +303,6 @@
#include <malloc.h>
#include "backends/platform/psp/memory.h"
- #define scumm_stricmp strcasecmp
- #define scumm_strnicmp strncasecmp
-
#define SCUMM_LITTLE_ENDIAN
#define SCUMM_NEED_ALIGNMENT
@@ -325,16 +311,10 @@
#elif defined(__amigaos4__)
- #define scumm_stricmp strcasecmp
- #define scumm_strnicmp strncasecmp
-
#define SCUMM_BIG_ENDIAN
#define SCUMM_NEED_ALIGNMENT
-#elif defined (__DS__)
-
- #define scumm_stricmp stricmp
- #define scumm_strnicmp strnicmp
+#elif defined(__DS__)
#define SCUMM_NEED_ALIGNMENT
#define SCUMM_LITTLE_ENDIAN
@@ -346,9 +326,6 @@
#elif defined(__WII__)
- #define scumm_stricmp strcasecmp
- #define scumm_strnicmp strncasecmp
-
#define SCUMM_BIG_ENDIAN
#define SCUMM_NEED_ALIGNMENT
Commit: 49ab6d028984a582a9683e30d6e995c7efa3f804
https://github.com/scummvm/scummvm/commit/49ab6d028984a582a9683e30d6e995c7efa3f804
Author: Max Horn (max at quendi.de)
Date: 2011-05-09T07:23:22-07:00
Commit Message:
COMMON: If config.h is present, don't use hardcoded settings from scummsys.h
Changed paths:
common/scummsys.h
diff --git a/common/scummsys.h b/common/scummsys.h
index b661aca..55429fb 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -116,6 +116,21 @@
#endif
+//
+// Define scumm_stricmp and scumm_strnicmp
+//
+#if defined(_WIN32_WCE) || defined(_MSC_VER)
+ #define scumm_stricmp stricmp
+ #define scumm_strnicmp _strnicmp
+#elif defined(__MINGW32__) || defined(__GP32__) || defined(__DS__)
+ #define scumm_stricmp stricmp
+ #define scumm_strnicmp strnicmp
+#else
+ #define scumm_stricmp strcasecmp
+ #define scumm_strnicmp strncasecmp
+#endif
+
+
// In the following we configure various targets, in particular those
// which can't use our "configure" tool and hence don't use config.h.
//
@@ -134,26 +149,6 @@
// - ...
// ...
-// We define all types in config.h, so we don't want to typedef those types
-// here again!
-#ifdef HAVE_CONFIG_H
-#define SCUMMVM_DONT_DEFINE_TYPES
-#endif
-
-//
-// Define scumm_stricmp and scumm_strnicmp
-//
-#if defined(_WIN32_WCE) || defined(_MSC_VER)
- #define scumm_stricmp stricmp
- #define scumm_strnicmp _strnicmp
-#elif defined(__MINGW32__) || defined(__GP32__) || defined(__DS__)
- #define scumm_stricmp stricmp
- #define scumm_strnicmp strnicmp
-#else
- #define scumm_stricmp strcasecmp
- #define scumm_strnicmp strncasecmp
-#endif
-
//
// By default we try to use pragma push/pop to ensure various structs we use
@@ -169,7 +164,11 @@
#define SCUMMVM_USE_PRAGMA_PACK
-#if defined(__SYMBIAN32__)
+#if defined(HAVE_CONFIG_H)
+ // All settings should have been set in config.h
+ #define SCUMMVM_DONT_DEFINE_TYPES
+
+#elif defined(__SYMBIAN32__)
#define SCUMM_LITTLE_ENDIAN
#define SCUMM_NEED_ALIGNMENT
Commit: 3920cfe69e6bd4a0b5da07e43694853dcfd7fc5e
https://github.com/scummvm/scummvm/commit/3920cfe69e6bd4a0b5da07e43694853dcfd7fc5e
Author: Max Horn (max at quendi.de)
Date: 2011-05-09T07:23:22-07:00
Commit Message:
COMMON: Do not #undef _MSC_VER
Changed paths:
common/scummsys.h
diff --git a/common/scummsys.h b/common/scummsys.h
index 55429fb..b5fda99 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -110,12 +110,6 @@
#include "config.h"
#endif
-// make sure we really are compiling for WIN32
-#ifndef WIN32
-#undef _MSC_VER
-#endif
-
-
//
// Define scumm_stricmp and scumm_strnicmp
//
Commit: 76780268f27e3151a375fd2a0afa1d9823d9d167
https://github.com/scummvm/scummvm/commit/76780268f27e3151a375fd2a0afa1d9823d9d167
Author: Max Horn (max at quendi.de)
Date: 2011-05-09T07:23:22-07:00
Commit Message:
COMMON: Refactor scummsys.h
Changed paths:
common/scummsys.h
diff --git a/common/scummsys.h b/common/scummsys.h
index b5fda99..e1c99ef 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -116,6 +116,7 @@
#if defined(_WIN32_WCE) || defined(_MSC_VER)
#define scumm_stricmp stricmp
#define scumm_strnicmp _strnicmp
+ #define snprintf _snprintf
#elif defined(__MINGW32__) || defined(__GP32__) || defined(__DS__)
#define scumm_stricmp stricmp
#define scumm_strnicmp strnicmp
@@ -167,8 +168,6 @@
#define SCUMM_LITTLE_ENDIAN
#define SCUMM_NEED_ALIGNMENT
- #define SMALL_SCREEN_DEVICE
-
// Enable Symbians own datatypes
// This is done for two reasons
// a) uint is already defined by Symbians libc component
@@ -188,37 +187,16 @@
#elif defined(_WIN32_WCE)
- #define snprintf _snprintf
-
#define SCUMM_LITTLE_ENDIAN
- #ifndef __GNUC__
- #define FORCEINLINE __forceinline
- #define NORETURN_PRE __declspec(noreturn)
- #endif
- #define PLUGIN_EXPORT __declspec(dllexport)
-
- #if _WIN32_WCE < 300
- #define SMALL_SCREEN_DEVICE
- #endif
-
#elif defined(_MSC_VER)
- #define snprintf _snprintf
-
#define SCUMM_LITTLE_ENDIAN
- #define FORCEINLINE __forceinline
- #define NORETURN_PRE __declspec(noreturn)
- #define PLUGIN_EXPORT __declspec(dllexport)
-
-
#elif defined(__MINGW32__)
#define SCUMM_LITTLE_ENDIAN
- #define PLUGIN_EXPORT __declspec(dllexport)
-
#elif defined(UNIX)
#if !defined(CONFIG_H) && defined(SDL_BACKEND)
@@ -234,16 +212,6 @@
#endif
#endif
- // You need to set this manually if necessary
-// #define SCUMM_NEED_ALIGNMENT
-
- // Very BAD hack following, used to avoid triggering an assert in uClibc dingux library
- // "toupper" when pressing keyboard function keys.
- #if defined(DINGUX)
- #undef toupper
- #define toupper(c) (((c & 0xFF) >= 97) && ((c & 0xFF) <= 122) ? ((c & 0xFF) - 32) : (c & 0xFF))
- #endif
-
#elif defined(__DC__)
#define SCUMM_LITTLE_ENDIAN
@@ -277,8 +245,6 @@
#define SCUMM_BIG_ENDIAN
#define SCUMM_NEED_ALIGNMENT
- #define STRINGBUFLEN 256
-
#define SCUMMVM_DONT_DEFINE_TYPES
typedef unsigned char byte;
@@ -293,15 +259,9 @@
#elif defined(__PSP__)
- #include <malloc.h>
- #include "backends/platform/psp/memory.h"
-
#define SCUMM_LITTLE_ENDIAN
#define SCUMM_NEED_ALIGNMENT
- /* to make an efficient, inlined memcpy implementation */
- #define memcpy(dst, src, size) psp_memcpy(dst, src, size)
-
#elif defined(__amigaos4__)
#define SCUMM_BIG_ENDIAN
@@ -314,9 +274,6 @@
#define SCUMMVM_DONT_DEFINE_TYPES
- #define STRINGBUFLEN 256
-// #define printf(fmt, ...) consolePrintf(fmt, ##__VA_ARGS__)
-
#elif defined(__WII__)
#define SCUMM_BIG_ENDIAN
@@ -329,47 +286,96 @@
//
-// GCC specific stuff
+// Some more system specific settings.
+// TODO/FIXME: All of these should be moved to backend specific files (such as portdefs.h)
//
-#if defined(__GNUC__)
- #define NORETURN_POST __attribute__((__noreturn__))
- #define PACKED_STRUCT __attribute__((__packed__))
- #define GCC_PRINTF(x,y) __attribute__((__format__(__printf__, x, y)))
+#if defined(__SYMBIAN32__)
- #if !defined(FORCEINLINE) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
- #define FORCEINLINE inline __attribute__((__always_inline__))
+ #define SMALL_SCREEN_DEVICE
+
+#elif defined(_WIN32_WCE)
+
+ #if _WIN32_WCE < 300
+ #define SMALL_SCREEN_DEVICE
#endif
-#elif defined(__INTEL_COMPILER)
- #define NORETURN_POST __attribute__((__noreturn__))
- #define PACKED_STRUCT __attribute__((__packed__))
- #define GCC_PRINTF(x,y) __attribute__((__format__(__printf__, x, y)))
-#else
- #define PACKED_STRUCT
- #define GCC_PRINTF(x,y)
+
+#elif defined(DINGUX)
+
+ // Very BAD hack following, used to avoid triggering an assert in uClibc dingux library
+ // "toupper" when pressing keyboard function keys.
+ #undef toupper
+ #define toupper(c) (((c & 0xFF) >= 97) && ((c & 0xFF) <= 122) ? ((c & 0xFF) - 32) : (c & 0xFF))
+
+#elif defined(__PSP__)
+
+ #include <malloc.h>
+ #include "backends/platform/psp/memory.h"
+
+ /* to make an efficient, inlined memcpy implementation */
+ #define memcpy(dst, src, size) psp_memcpy(dst, src, size)
+
#endif
//
// Fallbacks / default values for various special macros
//
+#ifndef GCC_PRINTF
+ #if defined(__GNUC__) || defined(__INTEL_COMPILER)
+ #define GCC_PRINTF(x,y) __attribute__((__format__(__printf__, x, y)))
+ #else
+ #define GCC_PRINTF(x,y)
+ #endif
+#endif
+
+#ifndef PACKED_STRUCT
+ #if defined(__GNUC__) || defined(__INTEL_COMPILER)
+ #define PACKED_STRUCT __attribute__((__packed__))
+ #else
+ #define PACKED_STRUCT
+ #endif
+#endif
+
#ifndef FORCEINLINE
-#define FORCEINLINE inline
+ #if defined(_MSC_VER)
+ #define FORCEINLINE __forceinline
+ #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+ #define FORCEINLINE inline __attribute__((__always_inline__))
+ #else
+ #define FORCEINLINE inline
+ #endif
#endif
#ifndef PLUGIN_EXPORT
-#define PLUGIN_EXPORT
+ #if defined(_MSC_VER) || defined(_WIN32_WCE) || defined(__MINGW32__)
+ #define PLUGIN_EXPORT __declspec(dllexport)
+ #else
+ #define PLUGIN_EXPORT
+ #endif
#endif
#ifndef NORETURN_PRE
-#define NORETURN_PRE
+ #if defined(_MSC_VER)
+ #define NORETURN_PRE __declspec(noreturn)
+ #else
+ #define NORETURN_PRE
+ #endif
#endif
#ifndef NORETURN_POST
-#define NORETURN_POST
+ #if defined(__GNUC__) || defined(__INTEL_COMPILER)
+ #define NORETURN_POST __attribute__((__noreturn__))
+ #else
+ #define NORETURN_POST
+ #endif
#endif
#ifndef STRINGBUFLEN
-#define STRINGBUFLEN 1024
+ #if defined(__N64__) || defined(__DS__)
+ #define STRINGBUFLEN 256
+ #else
+ #define STRINGBUFLEN 1024
+ #endif
#endif
#ifndef MAXPATHLEN
Commit: 8754c86686116cd937f5483a65a5eeda48cca02d
https://github.com/scummvm/scummvm/commit/8754c86686116cd937f5483a65a5eeda48cca02d
Author: Max Horn (max at quendi.de)
Date: 2011-05-10T02:02:08-07:00
Commit Message:
COMMON: Refactor typedefs a bit
Changed paths:
common/scummsys.h
diff --git a/common/scummsys.h b/common/scummsys.h
index e1c99ef..8ba983f 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -136,10 +136,6 @@
// - Define this on a big endian target
// SCUMM_NEED_ALIGNMENT
// - Define this if your system has problems reading e.g. an int32 from an odd address
-// SCUMMVM_DONT_DEFINE_TYPES
-// - Define this if you need to provide your own typedefs, e.g. because your
-// system headers conflict with our typenames, or because you have odd
-// type requirements.
// SMALL_SCREEN_DEVICE
// - ...
// ...
@@ -161,30 +157,12 @@
#if defined(HAVE_CONFIG_H)
// All settings should have been set in config.h
- #define SCUMMVM_DONT_DEFINE_TYPES
#elif defined(__SYMBIAN32__)
#define SCUMM_LITTLE_ENDIAN
#define SCUMM_NEED_ALIGNMENT
- // Enable Symbians own datatypes
- // This is done for two reasons
- // a) uint is already defined by Symbians libc component
- // b) Symbian is using its "own" datatyping, and the Scummvm port
- // should follow this to ensure the best compability possible.
- #define SCUMMVM_DONT_DEFINE_TYPES
- typedef unsigned char byte;
-
- typedef unsigned char uint8;
- typedef signed char int8;
-
- typedef unsigned short int uint16;
- typedef signed short int int16;
-
- typedef unsigned long int uint32;
- typedef signed long int int32;
-
#elif defined(_WIN32_WCE)
#define SCUMM_LITTLE_ENDIAN
@@ -197,19 +175,16 @@
#define SCUMM_LITTLE_ENDIAN
-#elif defined(UNIX)
-
- #if !defined(CONFIG_H) && defined(SDL_BACKEND)
- /* need this for the SDL_BYTEORDER define */
- #include <SDL_byteorder.h>
+#elif defined(SDL_BACKEND)
+ /* need this for the SDL_BYTEORDER define */
+ #include <SDL_byteorder.h>
- #if SDL_BYTEORDER == SDL_LIL_ENDIAN
- #define SCUMM_LITTLE_ENDIAN
- #elif SDL_BYTEORDER == SDL_BIG_ENDIAN
- #define SCUMM_BIG_ENDIAN
- #else
- #error Neither SDL_BIG_ENDIAN nor SDL_LIL_ENDIAN is set.
- #endif
+ #if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ #define SCUMM_LITTLE_ENDIAN
+ #elif SDL_BYTEORDER == SDL_BIG_ENDIAN
+ #define SCUMM_BIG_ENDIAN
+ #else
+ #error Neither SDL_BIG_ENDIAN nor SDL_LIL_ENDIAN is set.
#endif
#elif defined(__DC__)
@@ -222,19 +197,6 @@
#define SCUMM_LITTLE_ENDIAN
#define SCUMM_NEED_ALIGNMENT
- // Override typenames. uint is already defined by system header files.
- #define SCUMMVM_DONT_DEFINE_TYPES
- typedef unsigned char byte;
-
- typedef unsigned char uint8;
- typedef signed char int8;
-
- typedef unsigned short int uint16;
- typedef signed short int int16;
-
- typedef unsigned long int uint32;
- typedef signed long int int32;
-
#elif defined(__PLAYSTATION2__)
#define SCUMM_LITTLE_ENDIAN
@@ -245,18 +207,6 @@
#define SCUMM_BIG_ENDIAN
#define SCUMM_NEED_ALIGNMENT
- #define SCUMMVM_DONT_DEFINE_TYPES
- typedef unsigned char byte;
-
- typedef unsigned char uint8;
- typedef signed char int8;
-
- typedef unsigned short int uint16;
- typedef signed short int int16;
-
- typedef unsigned int uint32;
- typedef signed int int32;
-
#elif defined(__PSP__)
#define SCUMM_LITTLE_ENDIAN
@@ -272,8 +222,6 @@
#define SCUMM_NEED_ALIGNMENT
#define SCUMM_LITTLE_ENDIAN
- #define SCUMMVM_DONT_DEFINE_TYPES
-
#elif defined(__WII__)
#define SCUMM_BIG_ENDIAN
@@ -384,9 +332,60 @@
//
-// Typedef our system types unless SCUMMVM_DONT_DEFINE_TYPES is set.
+// Typedef our system types
//
-#ifndef SCUMMVM_DONT_DEFINE_TYPES
+#if !defined(HAVE_CONFIG_H) && defined(__SYMBIAN32__)
+
+ // Enable Symbians own datatypes
+ // This is done for two reasons
+ // a) uint is already defined by Symbians libc component
+ // b) Symbian is using its "own" datatyping, and the Scummvm port
+ // should follow this to ensure the best compability possible.
+ typedef unsigned char byte;
+
+ typedef unsigned char uint8;
+ typedef signed char int8;
+
+ typedef unsigned short int uint16;
+ typedef signed short int int16;
+
+ typedef unsigned long int uint32;
+ typedef signed long int int32;
+
+#elif !defined(HAVE_CONFIG_H) && defined(__GP32__)
+
+ // Override typenames. uint is already defined by system header files.
+ typedef unsigned char byte;
+
+ typedef unsigned char uint8;
+ typedef signed char int8;
+
+ typedef unsigned short int uint16;
+ typedef signed short int int16;
+
+ typedef unsigned long int uint32;
+ typedef signed long int int32;
+
+#elif !defined(HAVE_CONFIG_H) && defined(__N64__)
+
+ typedef unsigned char byte;
+
+ typedef unsigned char uint8;
+ typedef signed char int8;
+
+ typedef unsigned short int uint16;
+ typedef signed short int int16;
+
+ typedef unsigned int uint32;
+ typedef signed int int32;
+
+#elif !defined(HAVE_CONFIG_H) && defined(__DS__)
+
+ // Do nothing, the SDK defines all types we need in nds/ndstypes.h,
+ // which we include in our portsdef.h
+
+#else
+
typedef unsigned char byte;
typedef unsigned char uint8;
typedef signed char int8;
More information about the Scummvm-git-logs
mailing list