diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/gwps-common.c | 4 | ||||
-rw-r--r-- | apps/recorder/bmp.c | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 11e92a640d..1cda8c0f24 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -326,6 +326,10 @@ bool wps_data_preload_tags(struct wps_data *data, char *buf, | |||
326 | 326 | ||
327 | if (ret > 0) | 327 | if (ret > 0) |
328 | { | 328 | { |
329 | #if LCD_DEPTH == 16 | ||
330 | if (ret % 2) ret++; | ||
331 | /* Always consume an even number of bytes */ | ||
332 | #endif | ||
329 | /* Update the image cache. */ | 333 | /* Update the image cache. */ |
330 | if (bmp_cache_write && bmp_cache_fd >= 0) | 334 | if (bmp_cache_write && bmp_cache_fd >= 0) |
331 | { | 335 | { |
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index e41bd2dd77..598d26ba29 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c | |||
@@ -68,11 +68,6 @@ struct rgb_quad { /* Little endian */ | |||
68 | unsigned char reserved; | 68 | unsigned char reserved; |
69 | } STRUCT_PACKED; | 69 | } STRUCT_PACKED; |
70 | 70 | ||
71 | #ifdef ROCKBOX_LITTLE_ENDIAN | ||
72 | #define readshort(x) *(x) | ||
73 | #define readlong(x) *(x) | ||
74 | #else | ||
75 | |||
76 | /* big endian functions */ | 71 | /* big endian functions */ |
77 | static short readshort(short *value) { | 72 | static short readshort(short *value) { |
78 | unsigned char* bytes = (unsigned char*) value; | 73 | unsigned char* bytes = (unsigned char*) value; |
@@ -85,8 +80,6 @@ static long readlong(long *value) { | |||
85 | ((long)bytes[2] << 16) | ((long)bytes[3] << 24); | 80 | ((long)bytes[2] << 16) | ((long)bytes[3] << 24); |
86 | } | 81 | } |
87 | 82 | ||
88 | #endif | ||
89 | |||
90 | unsigned char brightness(struct rgb_quad color) | 83 | unsigned char brightness(struct rgb_quad color) |
91 | { | 84 | { |
92 | return (3 * (unsigned int)color.red + 6 * (unsigned int)color.green | 85 | return (3 * (unsigned int)color.red + 6 * (unsigned int)color.green |