1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 13:28:05 +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

@@ -415,7 +415,7 @@ void StartUp(Bool defaultScreenOnly)
#ifdef HAVE_XRANDR
int dummy;
#endif
Atom atom[sizeof(atomNames) / sizeof(atomNames[0])];
Atom atom[wlengthof(atomNames)];
/*
* Ignore CapsLock in modifiers
@@ -437,12 +437,12 @@ void StartUp(Bool defaultScreenOnly)
/* _XA_VERSION = XInternAtom(dpy, "VERSION", False); */
#ifdef HAVE_XINTERNATOMS
XInternAtoms(dpy, atomNames, sizeof(atomNames) / sizeof(atomNames[0]), False, atom);
XInternAtoms(dpy, atomNames, wlengthof(atomNames), False, atom);
#else
{
int i;
for (i = 0; i < sizeof(atomNames) / sizeof(atomNames[0]); i++)
for (i = 0; i < wlengthof(atomNames); i++)
atom[i] = XInternAtom(dpy, atomNames[i], False);
}
#endif