1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

wmaker: Use the macro 'wlengthof' to get the number of element in an array

The new macro 'wlengthof' from WUtil makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-11-08 21:18:21 +01:00
committed by Carlos R. Mafra
parent a3b6b62049
commit be022d9623
5 changed files with 22 additions and 24 deletions

View File

@@ -772,7 +772,7 @@ static void initDefaults(void)
WMPLSetCaseSensitive(False);
for (i = 0; i < sizeof(optionList) / sizeof(optionList[0]); i++) {
for (i = 0; i < wlengthof(optionList); i++) {
entry = &optionList[i];
entry->plkey = WMCreatePLString(entry->key);
@@ -782,7 +782,7 @@ static void initDefaults(void)
entry->plvalue = NULL;
}
for (i = 0; i < sizeof(staticOptionList) / sizeof(staticOptionList[0]); i++) {
for (i = 0; i < wlengthof(staticOptionList); i++) {
entry = &staticOptionList[i];
entry->plkey = WMCreatePLString(entry->key);
@@ -937,7 +937,7 @@ void wReadStaticDefaults(WMPropList * dict)
unsigned int i;
void *tdata;
for (i = 0; i < sizeof(staticOptionList) / sizeof(staticOptionList[0]); i++) {
for (i = 0; i < wlengthof(staticOptionList); i++) {
entry = &staticOptionList[i];
if (dict)
@@ -1094,7 +1094,7 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
needs_refresh = 0;
for (i = 0; i < sizeof(optionList) / sizeof(optionList[0]); i++) {
for (i = 0; i < wlengthof(optionList); i++) {
entry = &optionList[i];
if (new_dict)