From 78972b912e34885a98b03bfe99cefb17d829fd41 Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Tue, 30 Oct 2007 14:10:17 +0000 Subject: [PATCH] Removed unnecessary _ALIGNED_ON macro usage. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2860 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/dummy.c | 2 +- sc2/src/sc2code/libs/memlib.h | 3 +++ sc2/src/sc2code/races.h | 22 +++++++++------------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 60e812bcc..d21c012bb 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Removed unnecessary _ALIGNED_ON macro usage - SvdB - The current directory is now among the locations searched for the content when no explicit location has been specified. (bug fix) - from Nic - Non-3DO Shipspin anims now use Presentations - Michael diff --git a/sc2/src/sc2code/dummy.c b/sc2/src/sc2code/dummy.c index 204241c36..3e686df0d 100644 --- a/sc2/src/sc2code/dummy.c +++ b/sc2/src/sc2code/dummy.c @@ -33,7 +33,7 @@ typedef struct { - MEM_HANDLE handle _ALIGNED_ON(sizeof (MEM_HANDLE)); + MEM_HANDLE handle; RACE_DESC data _ALIGNED_ANY; } CODERES_STRUCT; diff --git a/sc2/src/sc2code/libs/memlib.h b/sc2/src/sc2code/libs/memlib.h index c0452d5a1..7db94d60e 100644 --- a/sc2/src/sc2code/libs/memlib.h +++ b/sc2/src/sc2code/libs/memlib.h @@ -100,6 +100,9 @@ typedef UWORD MEM_FLAGS; typedef struct mem_header { MEM_HANDLE handle; } _ALIGNED_ANY MEM_HEADER; +// _ALIGNED_ANY adds padding to the end of MEM_HEADER, so that the following +// address is aligned for any object (if the address of the MEM_HEADER +// itself is aligned for any object). #define GET_MEM_HEADER(addr) ((MEM_HEADER *) \ (((char *) addr) - sizeof (MEM_HEADER))) diff --git a/sc2/src/sc2code/races.h b/sc2/src/sc2code/races.h index e2ecfb889..8ff5d09e0 100644 --- a/sc2/src/sc2code/races.h +++ b/sc2/src/sc2code/races.h @@ -148,16 +148,12 @@ struct race_desc DATA_STUFF ship_data _ALIGNED_ANY; INTEL_STUFF cyborg_control _ALIGNED_ANY; - UNINIT_FUNC *uninit_func - _ALIGNED_ON(sizeof (UNINIT_FUNC *)); - PREPROCESS_FUNC *preprocess_func - _ALIGNED_ON(sizeof (PREPROCESS_FUNC *)); - POSTPROCESS_FUNC *postprocess_func - _ALIGNED_ON(sizeof (POSTPROCESS_FUNC *)); - INIT_WEAPON_FUNC *init_weapon_func - _ALIGNED_ON(sizeof (INIT_WEAPON_FUNC *)); + UNINIT_FUNC *uninit_func; + PREPROCESS_FUNC *preprocess_func; + POSTPROCESS_FUNC *postprocess_func; + INIT_WEAPON_FUNC *init_weapon_func; - void *CodeRef _ALIGNED_ON(sizeof (void *)); + void *CodeRef; }; #define SHIP_BASE_COMMON \ @@ -208,11 +204,11 @@ typedef struct // In battle: frames left before energy regeneration BYTE ship_input_state; - STATUS_FLAGS cur_status_flags _ALIGNED_ON(sizeof (STATUS_FLAGS)); - STATUS_FLAGS old_status_flags _ALIGNED_ON(sizeof (STATUS_FLAGS)); + STATUS_FLAGS cur_status_flags; + STATUS_FLAGS old_status_flags; - HELEMENT hShip _ALIGNED_ON(sizeof (HELEMENT)); - COUNT ShipFacing _ALIGNED_ON(sizeof (COUNT)); + HELEMENT hShip; + COUNT ShipFacing; } STARSHIP; static inline STARSHIP *