summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-09-25 18:36:18 +0000
committerThomas Martitz <kugel@rockbox.org>2009-09-25 18:36:18 +0000
commitd045f59989137afc5e9138277bcb24dcfc4c5f3f (patch)
tree2e3313a15bdf24658f527478dd0511de1cf90368 /apps/gui
parentbcd890d7bbac710dcdb1d29e2805989e27f55484 (diff)
downloadrockbox-d045f59989137afc5e9138277bcb24dcfc4c5f3f.tar.gz
rockbox-d045f59989137afc5e9138277bcb24dcfc4c5f3f.zip
Redo 22825 but this time with caring about alignment.
Change coordinate members in struct skin_albumart to ints. That alone gives a tiny binsize decrease. Change the struct layout (some reordering) to enable more efficient alignment which reclaims 4 of the 8 bytes. Since there's usually only 1 aa struct this should be a net gain. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22835 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/skin_engine/skin_parser.c13
-rw-r--r--apps/gui/skin_engine/wps_internals.h14
2 files changed, 9 insertions, 18 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index ede1871414..b03bdb013d 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -983,18 +983,9 @@ static int parse_albumart_load(const char *wps_bufptr,
983 return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl7 */ 983 return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl7 */
984 984
985 _pos = wps_bufptr + 1; 985 _pos = wps_bufptr + 1;
986 if (!isdigit(*_pos)) 986 _pos = parse_list("dd", NULL, '|', _pos, &aa->albumart_x, &aa->albumart_y);
987 return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl|@ */
988 aa->albumart_x = atoi(_pos);
989 987
990 _pos = strchr(_pos, '|'); 988 if (!_pos || _pos > newline || *_pos != '|')
991 if (!_pos || _pos > newline || !isdigit(*(++_pos)))
992 return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl|7\n or %Cl|7|@ */
993
994 aa->albumart_y = atoi(_pos);
995
996 _pos = strchr(_pos, '|');
997 if (!_pos || _pos > newline)
998 return WPS_ERROR_INVALID_PARAM; /* malformed token: no | after y coordinate 989 return WPS_ERROR_INVALID_PARAM; /* malformed token: no | after y coordinate
999 e.g. %Cl|7|59\n */ 990 e.g. %Cl|7|59\n */
1000 991
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index e2330a777e..a5fc70d1ef 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -226,15 +226,15 @@ struct touchregion {
226struct skin_albumart { 226struct skin_albumart {
227 /* Album art support */ 227 /* Album art support */
228 struct viewport *vp;/* The viewport this is in */ 228 struct viewport *vp;/* The viewport this is in */
229 unsigned char wps_uses_albumart; /* WPS_ALBUMART_NONE, _CHECK, _LOAD */ 229 int albumart_x;
230 short albumart_x; 230 int albumart_y;
231 short albumart_y; 231 int albumart_max_width;
232 unsigned char albumart_xalign; /* WPS_ALBUMART_ALIGN_LEFT, _CENTER, _RIGHT */ 232 int albumart_max_height;
233 unsigned char albumart_yalign; /* WPS_ALBUMART_ALIGN_TOP, _CENTER, _BOTTOM */
234 short albumart_max_width;
235 short albumart_max_height;
236 233
237 bool draw; 234 bool draw;
235 unsigned char albumart_xalign; /* WPS_ALBUMART_ALIGN_LEFT, _CENTER, _RIGHT */
236 unsigned char albumart_yalign; /* WPS_ALBUMART_ALIGN_TOP, _CENTER, _BOTTOM */
237 unsigned char wps_uses_albumart; /* WPS_ALBUMART_NONE, _CHECK, _LOAD */
238}; 238};
239#endif 239#endif
240 240