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:
committed by
Carlos R. Mafra
parent
a3b6b62049
commit
be022d9623
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user