Mercurial > mplayer.hg
comparison gui/app.c @ 32929:6ea9e024f05e
Clean up appInitStruct().
There is no need to memset or set a variable to zero
after it has already been erased.
Additionally, rearrange statements to meet order in structure.
author | ib |
---|---|
date | Thu, 03 Mar 2011 14:09:50 +0000 |
parents | 0ef78cd3063b |
children | b52831437104 |
comparison
equal
deleted
inserted
replaced
32928:0ef78cd3063b | 32929:6ea9e024f05e |
---|---|
118 | 118 |
119 void appInitStruct(void) | 119 void appInitStruct(void) |
120 { | 120 { |
121 int i; | 121 int i; |
122 | 122 |
123 appClearItem(&appMPlayer.main); | |
124 appMPlayer.mainDecoration = 0; | |
125 | |
126 appClearItem(&appMPlayer.sub); | |
127 | |
128 appClearItem(&appMPlayer.bar); | |
129 appMPlayer.barIsPresent = 0; | |
130 | |
131 appClearItem(&appMPlayer.menuBase); | |
132 appClearItem(&appMPlayer.menuSelected); | |
133 appMPlayer.menuIsPresent = 0; | |
134 | |
123 for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++) | 135 for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++) |
124 appClearItem(&appMPlayer.mainItems[i]); | 136 appClearItem(&appMPlayer.mainItems[i]); |
125 for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++) | 137 for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++) |
126 appClearItem(&appMPlayer.barItems[i]); | 138 appClearItem(&appMPlayer.barItems[i]); |
127 for (i = 0; i < appMPlayer.NumberOfMenuItems + 1; i++) | 139 for (i = 0; i < appMPlayer.NumberOfMenuItems + 1; i++) |
128 appClearItem(&appMPlayer.menuItems[i]); | 140 appClearItem(&appMPlayer.menuItems[i]); |
129 | |
130 memset(appMPlayer.mainItems, 0, 256 * sizeof(wItem)); | |
131 | |
132 memset(appMPlayer.menuItems, 0, 64 * sizeof(wItem)); | |
133 | |
134 memset(appMPlayer.barItems, 0, 256 * sizeof(wItem)); | |
135 | |
136 appClearItem(&appMPlayer.main); | |
137 appMPlayer.mainDecoration = 0; | |
138 | |
139 appClearItem(&appMPlayer.sub); | |
140 appMPlayer.sub.width = 0; | |
141 appMPlayer.sub.height = 0; | |
142 | |
143 appClearItem(&appMPlayer.bar); | |
144 appClearItem(&appMPlayer.menuBase); | |
145 appClearItem(&appMPlayer.menuSelected); | |
146 | |
147 appMPlayer.sub.R = appMPlayer.sub.G = appMPlayer.sub.B = 0; | |
148 appMPlayer.bar.R = appMPlayer.bar.G = appMPlayer.bar.B = 0; | |
149 appMPlayer.main.R = appMPlayer.main.G = appMPlayer.main.B = 0; | |
150 appMPlayer.barIsPresent = 0; | |
151 appMPlayer.menuIsPresent = 0; | |
152 | 141 |
153 appResetStruct(); | 142 appResetStruct(); |
154 } | 143 } |
155 | 144 |
156 int appFindMessage(unsigned char *str) | 145 int appFindMessage(unsigned char *str) |