# HG changeset patch # User skidd13 # Date 1195504814 0 # Node ID 3a3289a049f9ec50d8fc6c06b15049897cedb50f # Parent 01d19beae592b6de65c90743d36a32cd1e20be00 (svn r11480) -Codechange: Rename the function ALIGN fitting to the naming style This fixes also FS#1450 diff -r 01d19beae592 -r 3a3289a049f9 src/fileio.cpp --- a/src/fileio.cpp Mon Nov 19 20:18:27 2007 +0000 +++ b/src/fileio.cpp Mon Nov 19 20:40:14 2007 +0000 @@ -518,7 +518,7 @@ if (_tar_filelist.insert(TarFileList::value_type(name, entry)).second) num++; /* Skip to the next block.. */ - skip = ALIGN(skip, 512); + skip = Align(skip, 512); fseek(f, skip, SEEK_CUR); pos += skip; } diff -r 01d19beae592 -r 3a3289a049f9 src/gfx.cpp --- a/src/gfx.cpp Mon Nov 19 20:18:27 2007 +0000 +++ b/src/gfx.cpp Mon Nov 19 20:40:14 2007 +0000 @@ -1015,8 +1015,8 @@ void DrawDirtyBlocks() { byte *b = _dirty_blocks; - const int w = ALIGN(_screen.width, 64); - const int h = ALIGN(_screen.height, 8); + const int w = Align(_screen.width, 64); + const int h = Align(_screen.height, 8); int x; int y; diff -r 01d19beae592 -r 3a3289a049f9 src/macros.h --- a/src/macros.h Mon Nov 19 20:18:27 2007 +0000 +++ b/src/macros.h Mon Nov 19 20:40:14 2007 +0000 @@ -553,7 +553,7 @@ * @param n The base of the number we are searching * @return The smallest multiple of n equal or greater than x */ -template static inline T ALIGN(const T x, uint n) { +template static inline T Align(const T x, uint n) { n--; return (T)((x + n) & ~(n)); } diff -r 01d19beae592 -r 3a3289a049f9 src/network/core/os_abstraction.h --- a/src/network/core/os_abstraction.h Mon Nov 19 20:18:27 2007 +0000 +++ b/src/network/core/os_abstraction.h Mon Nov 19 20:40:14 2007 +0000 @@ -202,11 +202,6 @@ #endif } -#ifdef __APPLE__ -/* Looks like sys/socket.h uses a name we got in macros.h */ -#undef ALIGN -#endif - #endif /* ENABLE_NETWORK */ #endif /* NETWORK_CORE_OS_ABSTRACTION_H */ diff -r 01d19beae592 -r 3a3289a049f9 src/screenshot.cpp --- a/src/screenshot.cpp Mon Nov 19 20:18:27 2007 +0000 +++ b/src/screenshot.cpp Mon Nov 19 20:40:14 2007 +0000 @@ -84,7 +84,7 @@ if (f == NULL) return false; /* each scanline must be aligned on a 32bit boundary */ - padw = ALIGN(w, 4); + padw = Align(w, 4); if (pixelformat == 8) pal_size = sizeof(RgbQuad) * 256; diff -r 01d19beae592 -r 3a3289a049f9 src/settings.cpp --- a/src/settings.cpp Mon Nov 19 20:18:27 2007 +0000 +++ b/src/settings.cpp Mon Nov 19 20:40:14 2007 +0000 @@ -97,7 +97,7 @@ uint pos; SettingsMemoryPool *p = *pool; - size = ALIGN(size, sizeof(void*)); + size = Align(size, sizeof(void*)); /* first check if there's memory in the next pool */ if (p->next && p->next->pos + size <= p->next->size) { diff -r 01d19beae592 -r 3a3289a049f9 src/spritecache.cpp --- a/src/spritecache.cpp Mon Nov 19 20:18:27 2007 +0000 +++ b/src/spritecache.cpp Mon Nov 19 20:40:14 2007 +0000 @@ -47,7 +47,7 @@ { if (index >= _spritecache_items) { /* Add another 1024 items to the 'pool' */ - uint items = ALIGN(index + 1, 1024); + uint items = Align(index + 1, 1024); DEBUG(sprite, 4, "Increasing sprite cache to %d items (%d bytes)", items, items * sizeof(*_spritecache)); @@ -436,7 +436,7 @@ /* Align this to an uint32 boundary. This also makes sure that the 2 least * bits are not used, so we could use those for other things. */ - mem_req = ALIGN(mem_req, sizeof(uint32)); + mem_req = Align(mem_req, sizeof(uint32)); for (;;) { MemBlock* s; diff -r 01d19beae592 -r 3a3289a049f9 src/stdafx.h --- a/src/stdafx.h Mon Nov 19 20:18:27 2007 +0000 +++ b/src/stdafx.h Mon Nov 19 20:40:14 2007 +0000 @@ -360,8 +360,6 @@ #elif defined(OPENBSD) /* OpenBSD uses strcasecmp(3) */ #define _stricmp strcasecmp -/* OpenBSD furthermore already has an ALIGN macro. */ -#undef ALIGN #endif #if !defined(MORPHOS) && !defined(OPENBSD) diff -r 01d19beae592 -r 3a3289a049f9 src/video/cocoa_v.mm --- a/src/video/cocoa_v.mm Mon Nov 19 20:18:27 2007 +0000 +++ b/src/video/cocoa_v.mm Mon Nov 19 20:40:14 2007 +0000 @@ -52,8 +52,6 @@ #endif -/* Defined in ppc/param.h or i386/param.h included from sys/param.h */ -#undef ALIGN /* Defined in stdbool.h */ #ifndef __cplusplus # ifndef __BEOS__ diff -r 01d19beae592 -r 3a3289a049f9 src/video/win32_v.cpp --- a/src/video/win32_v.cpp Mon Nov 19 20:18:27 2007 +0000 +++ b/src/video/win32_v.cpp Mon Nov 19 20:40:14 2007 +0000 @@ -686,7 +686,7 @@ return false; _screen.width = w; - _screen.pitch = (bpp == 8) ? ALIGN(w, 4) : w; + _screen.pitch = (bpp == 8) ? Align(w, 4) : w; _screen.height = h; bi = (BITMAPINFO*)alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256); memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);