diff options
author | Simon Howard | 2007-06-21 11:33:46 +0000 |
---|---|---|
committer | Simon Howard | 2007-06-21 11:33:46 +0000 |
commit | ed6191430b27a5447ef2675f2cfe19d8f0b88333 (patch) | |
tree | e7cd1d4d3d54a76717c6bc7f27050d865b4973bf /src/d_iwad.c | |
parent | ee2a6fda9fd817c191d74d0f1a00a4c05b4ed433 (diff) | |
download | chocolate-doom-ed6191430b27a5447ef2675f2cfe19d8f0b88333.tar.gz chocolate-doom-ed6191430b27a5447ef2675f2cfe19d8f0b88333.tar.bz2 chocolate-doom-ed6191430b27a5447ef2675f2cfe19d8f0b88333.zip |
Add arrlen() macro as a clearer way of doing sizeof(array) /
sizeof(*array)
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 922
Diffstat (limited to 'src/d_iwad.c')
-rw-r--r-- | src/d_iwad.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/d_iwad.c b/src/d_iwad.c index 895b5afb..320ee835 100644 --- a/src/d_iwad.c +++ b/src/d_iwad.c @@ -194,7 +194,7 @@ static void CheckUninstallStrings(void) { unsigned int i; - for (i=0; i<sizeof(uninstall_values) / sizeof(*uninstall_values); ++i) + for (i=0; i<arrlen(uninstall_values); ++i) { char *val; char *path; @@ -237,8 +237,7 @@ static void CheckCollectorsEdition(void) return; } - for (i=0; i<sizeof(collectors_edition_subdirs) - / sizeof(*collectors_edition_subdirs); ++i) + for (i=0; i<arrlen(collectors_edition_subdirs); ++i) { subpath = malloc(strlen(install_path) + strlen(collectors_edition_subdirs[i]) @@ -273,7 +272,7 @@ static char *SearchDirectoryForIWAD(char *dir) { size_t i; - for (i=0; i<sizeof(iwads) / sizeof(*iwads); ++i) + for (i=0; i<arrlen(iwads); ++i) { char *filename; char *iwadname; @@ -312,7 +311,7 @@ static void IdentifyIWADByName(char *name) gamemission = none; - for (i=0; i<sizeof(iwads) / sizeof(*iwads); ++i) + for (i=0; i<arrlen(iwads); ++i) { char *iwadname; @@ -592,7 +591,7 @@ void D_SetSaveGameDir(void) // This ensures that doom1.wad and doom.wad saves are stored // in the same place. - for (i=0; i<sizeof(iwads) / sizeof(*iwads); ++i) + for (i=0; i<arrlen(iwads); ++i) { if (gamemission == iwads[i].mission) { @@ -653,7 +652,7 @@ static char *GetGameName(char *gamename) size_t i; char *deh_sub; - for (i=0; i<sizeof(banners) / sizeof(*banners); ++i) + for (i=0; i<arrlen(banners); ++i) { // Has the banner been replaced? @@ -801,7 +800,7 @@ void D_FindInstalledIWADs(void) result = 0; - for (i=0; i<sizeof(iwads) / sizeof(*iwads); ++i) + for (i=0; i<arrlen(iwads); ++i) { if (D_FindWADByName(iwads[i].name) != NULL) { |