diff gui/app.c @ 32931:03b1051bed5c

Rename the 'NumberOf' members of the listItems structure. Since the NumberOfMainItems, NumberOfBarItems and NumberOfMenuItems members actually hold the last index used rather than the number of items, rename them 'IndexOf' to avoid further confusion. Besides, change their loop conditions to meet the new name.
author ib
date Thu, 03 Mar 2011 14:37:47 +0000
parents b52831437104
children e95ec1b2feea
line wrap: on
line diff
--- a/gui/app.c	Thu Mar 03 14:13:41 2011 +0000
+++ b/gui/app.c	Thu Mar 03 14:37:47 2011 +0000
@@ -106,9 +106,9 @@
 
 void appResetStruct(void)
 {
-    appMPlayer.NumberOfMainItems = -1;
-    appMPlayer.NumberOfBarItems  = -1;
-    appMPlayer.NumberOfMenuItems = -1;
+    appMPlayer.IndexOfMainItems = -1;
+    appMPlayer.IndexOfBarItems  = -1;
+    appMPlayer.IndexOfMenuItems = -1;
 
     appMPlayer.sub.x = -1;   // NOTE TO MYSELF: is this really necessary?
     appMPlayer.sub.y = -1;   // NOTE TO MYSELF: is this really necessary?
@@ -130,11 +130,11 @@
     appClearItem(&appMPlayer.menuSelected);
     appMPlayer.menuIsPresent = 0;
 
-    for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++)
+    for (i = 0; i <= appMPlayer.IndexOfMainItems; i++)
         appClearItem(&appMPlayer.mainItems[i]);
-    for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++)
+    for (i = 0; i <= appMPlayer.IndexOfBarItems; i++)
         appClearItem(&appMPlayer.barItems[i]);
-    for (i = 0; i < appMPlayer.NumberOfMenuItems + 1; i++)
+    for (i = 0; i <= appMPlayer.IndexOfMenuItems; i++)
         appClearItem(&appMPlayer.menuItems[i]);
 
     appResetStruct();
@@ -155,7 +155,7 @@
 {
     int i;
 
-    for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++) {
+    for (i = 0; i <= appMPlayer.IndexOfMainItems; i++) {
         if (appMPlayer.mainItems[i].message == event) {
             switch (appMPlayer.mainItems[i].type) {
             case itButton:
@@ -176,7 +176,7 @@
         }
     }
 
-    for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++) {
+    for (i = 0; i <= appMPlayer.IndexOfBarItems; i++) {
         if (appMPlayer.barItems[i].message == event) {
             switch (appMPlayer.barItems[i].type) {
             case itButton:
@@ -202,14 +202,14 @@
 {
     int i;
 
-    for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++) {
+    for (i = 0; i <= appMPlayer.IndexOfMainItems; i++) {
         if (appMPlayer.mainItems[i].message == event) {
             appMPlayer.mainItems[i].pressed = set;
             appMPlayer.barItems[i].tmp      = 0;
         }
     }
 
-    for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++) {
+    for (i = 0; i <= appMPlayer.IndexOfBarItems; i++) {
         if (appMPlayer.barItems[i].message == event) {
             appMPlayer.barItems[i].pressed = set;
             appMPlayer.barItems[i].tmp     = 0;