1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-21 22:44:14 +01:00

WINGs: 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:20 +01:00
committed by Carlos R. Mafra
parent fd47650717
commit a3b6b62049
4 changed files with 6 additions and 6 deletions

View File

@@ -550,7 +550,7 @@ WMScreen *WMCreateScreenWithRContext(Display * display, int screen, RContext * c
"_NET_WM_ICON_NAME",
"_NET_WM_ICON",
};
Atom atoms[sizeof(atomNames) / sizeof(atomNames[0])];
Atom atoms[wlengthof(atomNames)];
int i;
if (!initialized) {
@@ -801,9 +801,9 @@ WMScreen *WMCreateScreenWithRContext(Display * display, int screen, RContext * c
}
#ifdef HAVE_XINTERNATOMS
XInternAtoms(display, atomNames, sizeof(atomNames) / sizeof(atomNames[0]), False, atoms);
XInternAtoms(display, atomNames, wlengthof(atomNames), False, atoms);
#else
for (i = 0; i < sizeof(atomNames) / sizeof(atomNames[0]); i++) {
for (i = 0; i < wlengthof(atomNames); i++) {
atoms[i] = XInternAtom(display, atomNames[i], False);
}
#endif