1
0
Fork 0

(svn r11480) -Codechange: Rename the function ALIGN fitting to the naming style

This fixes also FS#1450
release/0.6
skidd13 2007-11-19 20:40:14 +00:00
parent d076ea8697
commit 58bb5c7525
10 changed files with 9 additions and 18 deletions

View File

@ -518,7 +518,7 @@ static bool TarListAddFile(const char *filename)
if (_tar_filelist.insert(TarFileList::value_type(name, entry)).second) num++; if (_tar_filelist.insert(TarFileList::value_type(name, entry)).second) num++;
/* Skip to the next block.. */ /* Skip to the next block.. */
skip = ALIGN(skip, 512); skip = Align(skip, 512);
fseek(f, skip, SEEK_CUR); fseek(f, skip, SEEK_CUR);
pos += skip; pos += skip;
} }

View File

@ -1015,8 +1015,8 @@ void RedrawScreenRect(int left, int top, int right, int bottom)
void DrawDirtyBlocks() void DrawDirtyBlocks()
{ {
byte *b = _dirty_blocks; byte *b = _dirty_blocks;
const int w = ALIGN(_screen.width, 64); const int w = Align(_screen.width, 64);
const int h = ALIGN(_screen.height, 8); const int h = Align(_screen.height, 8);
int x; int x;
int y; int y;

View File

@ -553,7 +553,7 @@ template<typename T> static inline T ROR(const T x, const uint8 n)
* @param n The base of the number we are searching * @param n The base of the number we are searching
* @return The smallest multiple of n equal or greater than x * @return The smallest multiple of n equal or greater than x
*/ */
template<typename T> static inline T ALIGN(const T x, uint n) { template<typename T> static inline T Align(const T x, uint n) {
n--; n--;
return (T)((x + n) & ~(n)); return (T)((x + n) & ~(n));
} }

View File

@ -202,11 +202,6 @@ static inline bool SetNoDelay(SOCKET d)
#endif #endif
} }
#ifdef __APPLE__
/* Looks like sys/socket.h uses a name we got in macros.h */
#undef ALIGN
#endif
#endif /* ENABLE_NETWORK */ #endif /* ENABLE_NETWORK */
#endif /* NETWORK_CORE_OS_ABSTRACTION_H */ #endif /* NETWORK_CORE_OS_ABSTRACTION_H */

View File

@ -84,7 +84,7 @@ static bool MakeBmpImage(const char *name, ScreenshotCallback *callb, void *user
if (f == NULL) return false; if (f == NULL) return false;
/* each scanline must be aligned on a 32bit boundary */ /* 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; if (pixelformat == 8) pal_size = sizeof(RgbQuad) * 256;

View File

@ -97,7 +97,7 @@ static void *pool_alloc(SettingsMemoryPool **pool, uint size)
uint pos; uint pos;
SettingsMemoryPool *p = *pool; SettingsMemoryPool *p = *pool;
size = ALIGN(size, sizeof(void*)); size = Align(size, sizeof(void*));
/* first check if there's memory in the next pool */ /* first check if there's memory in the next pool */
if (p->next && p->next->pos + size <= p->next->size) { if (p->next && p->next->pos + size <= p->next->size) {

View File

@ -47,7 +47,7 @@ static SpriteCache *AllocateSpriteCache(uint index)
{ {
if (index >= _spritecache_items) { if (index >= _spritecache_items) {
/* Add another 1024 items to the 'pool' */ /* 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)); DEBUG(sprite, 4, "Increasing sprite cache to %d items (%d bytes)", items, items * sizeof(*_spritecache));
@ -436,7 +436,7 @@ void* AllocSprite(size_t mem_req)
/* Align this to an uint32 boundary. This also makes sure that the 2 least /* 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. */ * 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 (;;) { for (;;) {
MemBlock* s; MemBlock* s;

View File

@ -360,8 +360,6 @@ CDECL error(const char *str, ...);
#elif defined(OPENBSD) #elif defined(OPENBSD)
/* OpenBSD uses strcasecmp(3) */ /* OpenBSD uses strcasecmp(3) */
#define _stricmp strcasecmp #define _stricmp strcasecmp
/* OpenBSD furthermore already has an ALIGN macro. */
#undef ALIGN
#endif #endif
#if !defined(MORPHOS) && !defined(OPENBSD) #if !defined(MORPHOS) && !defined(OPENBSD)

View File

@ -52,8 +52,6 @@ extern "C" void HideMenuBar();
#endif #endif
/* Defined in ppc/param.h or i386/param.h included from sys/param.h */
#undef ALIGN
/* Defined in stdbool.h */ /* Defined in stdbool.h */
#ifndef __cplusplus #ifndef __cplusplus
# ifndef __BEOS__ # ifndef __BEOS__

View File

@ -686,7 +686,7 @@ static bool AllocateDibSection(int w, int h)
return false; return false;
_screen.width = w; _screen.width = w;
_screen.pitch = (bpp == 8) ? ALIGN(w, 4) : w; _screen.pitch = (bpp == 8) ? Align(w, 4) : w;
_screen.height = h; _screen.height = h;
bi = (BITMAPINFO*)alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256); bi = (BITMAPINFO*)alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256); memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);