WPrefs: replaced a few constants by the macro 'wlengthof'

This reduce the risk to miss something in case the array they refer to gets
updated, because with the macro the proper number of element will be
evaluated by the compiler automatically.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS authored and Carlos R. Mafra committed 2014-11-02 13:13:19 +01:00
1 parent 6ac27ba842
commit 4bb93d3dab
4 files changed
+16 -16

No files matched your search

+2 -2
View File
@@ -73,7 +73,7 @@ static void storeData(_Panel * panel)
{
int i;
for (i = 0; i < 5; i++) {
for (i = 0; i < wlengthof(panel->scrB); i++) {
if (WMGetButtonSelected(panel->scrB[i]))
break;
}
@@ -106,7 +106,7 @@ static void createPanel(Panel * p)
buf1 = wmalloc(strlen(SPEED_IMAGE) + 1);
buf2 = wmalloc(strlen(SPEED_IMAGE_S) + 1);
for (i = 0; i < 5; i++) {
for (i = 0; i < wlengthof(panel->scrB); i++) {
panel->scrB[i] = WMCreateCustomButton(panel->scrF, WBBStateChangeMask);
WMResizeWidget(panel->scrB[i], 40, 40);
WMMoveWidget(panel->scrB[i], 15 + (40 * i), 30);