From ab80b20a305728ecbe402ab0461c9a10cd7570b5 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 7 Aug 2011 10:19:30 +0200 Subject: COMMON: Replace x + ARRAYSIZE(x) by the simpler ARRAYEND(x). --- devtools/create_kyradat/create_kyradat.cpp | 8 ++++---- devtools/create_kyradat/extract.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'devtools') diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp index ddcc8ad6d1..627b517c62 100644 --- a/devtools/create_kyradat/create_kyradat.cpp +++ b/devtools/create_kyradat/create_kyradat.cpp @@ -331,7 +331,7 @@ const TypeTable gameTable[] = { }; byte getGameID(int game) { - return std::find(gameTable, gameTable + ARRAYSIZE(gameTable) - 1, game)->value; + return std::find(gameTable, ARRAYEND(gameTable) - 1, game)->value; } const TypeTable languageTable[] = { @@ -347,7 +347,7 @@ const TypeTable languageTable[] = { }; byte getLanguageID(int lang) { - return std::find(languageTable, languageTable + ARRAYSIZE(languageTable) - 1, lang)->value; + return std::find(languageTable, ARRAYEND(languageTable) - 1, lang)->value; } const TypeTable platformTable[] = { @@ -360,7 +360,7 @@ const TypeTable platformTable[] = { }; byte getPlatformID(int platform) { - return std::find(platformTable, platformTable + ARRAYSIZE(platformTable) - 1, platform)->value; + return std::find(platformTable, ARRAYEND(platformTable) - 1, platform)->value; } const TypeTable specialTable[] = { @@ -373,7 +373,7 @@ const TypeTable specialTable[] = { }; byte getSpecialID(int special) { - return std::find(specialTable, specialTable + ARRAYSIZE(specialTable) - 1, special)->value; + return std::find(specialTable, ARRAYEND(specialTable) - 1, special)->value; } // filename processing diff --git a/devtools/create_kyradat/extract.cpp b/devtools/create_kyradat/extract.cpp index 2aa9fc0d39..371f2f4e2b 100644 --- a/devtools/create_kyradat/extract.cpp +++ b/devtools/create_kyradat/extract.cpp @@ -127,7 +127,7 @@ const ExtractType *findExtractType(const int type) { } byte getTypeID(int type) { - return std::find(typeTable, typeTable + ARRAYSIZE(typeTable) - 1, type)->value; + return std::find(typeTable, ARRAYEND(typeTable) - 1, type)->value; } // Extractor implementation -- cgit v1.2.3