diff options
author | Tomas Salfischberger <tomas@rockbox.org> | 2005-05-02 16:06:05 +0000 |
---|---|---|
committer | Tomas Salfischberger <tomas@rockbox.org> | 2005-05-02 16:06:05 +0000 |
commit | 23028f579b011601b2c9e7d37868d4e1b577d910 (patch) | |
tree | cba7df08a348baa576e7c09900bc97252a989205 /apps | |
parent | e2f5dba61c77d83b42676b0572f89d876007a019 (diff) | |
download | rockbox-23028f579b011601b2c9e7d37868d4e1b577d910.tar.gz rockbox-23028f579b011601b2c9e7d37868d4e1b577d910.zip |
Adapted Miika's tool to rockbox coding style *oops*
(And removed some tabs from my own last minute edits in dict.c)
Changed the place of endian conversion form the device to the convertor.
Should speed it up a little.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6397 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/dict.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/apps/plugins/dict.c b/apps/plugins/dict.c index efaeab2ed3..d3fea1d52d 100644 --- a/apps/plugins/dict.c +++ b/apps/plugins/dict.c | |||
@@ -52,7 +52,7 @@ void init_screen(void) | |||
52 | } | 52 | } |
53 | 53 | ||
54 | /* for endian problems */ | 54 | /* for endian problems */ |
55 | #ifdef LITTLE_ENDIAN | 55 | #ifdef ROCKBOX_BIG_ENDIAN |
56 | #define readlong(x) x | 56 | #define readlong(x) x |
57 | #else | 57 | #else |
58 | long readlong(void* value) | 58 | long readlong(void* value) |
@@ -140,7 +140,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
140 | { | 140 | { |
141 | DEBUGF("Not found.\n"); | 141 | DEBUGF("Not found.\n"); |
142 | rb->splash(HZ*2, true, "Not found."); | 142 | rb->splash(HZ*2, true, "Not found."); |
143 | rb->close(fIndex); | 143 | rb->close(fIndex); |
144 | return PLUGIN_OK; | 144 | return PLUGIN_OK; |
145 | } | 145 | } |
146 | 146 | ||
@@ -152,7 +152,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
152 | { | 152 | { |
153 | DEBUGF("Err: Failed to open description file.\n"); | 153 | DEBUGF("Err: Failed to open description file.\n"); |
154 | rb->splash(HZ*2, true, "Failed to open descriptions."); | 154 | rb->splash(HZ*2, true, "Failed to open descriptions."); |
155 | rb->close(fIndex); | 155 | rb->close(fIndex); |
156 | return PLUGIN_ERROR; | 156 | return PLUGIN_ERROR; |
157 | } | 157 | } |
158 | 158 | ||
@@ -187,14 +187,15 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
187 | { | 187 | { |
188 | /* copy one lcd line */ | 188 | /* copy one lcd line */ |
189 | rb->strncpy(output, ptr, display_columns); | 189 | rb->strncpy(output, ptr, display_columns); |
190 | output[display_columns] = '\0'; | 190 | output[display_columns] = '\0'; |
191 | 191 | ||
192 | /* unsigned to kill a warning... */ | 192 | /* typecast to kill a warning... */ |
193 | if((int)rb->strlen(ptr) < display_columns) { | 193 | if((int)rb->strlen(ptr) < display_columns) |
194 | rb->lcd_puts(0, lines, output); | 194 | { |
195 | rb->lcd_puts(0, lines, output); | ||
195 | lines++; | 196 | lines++; |
196 | break; | 197 | break; |
197 | } | 198 | } |
198 | 199 | ||
199 | 200 | ||
200 | /* get the last spacechar */ | 201 | /* get the last spacechar */ |
@@ -210,7 +211,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
210 | next = display_columns; | 211 | next = display_columns; |
211 | } | 212 | } |
212 | 213 | ||
213 | /* put the line on screen */ | 214 | /* put the line on screen */ |
214 | rb->lcd_puts(0, lines, output); | 215 | rb->lcd_puts(0, lines, output); |
215 | 216 | ||
216 | /* get output count */ | 217 | /* get output count */ |
@@ -240,6 +241,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
240 | } | 241 | } |
241 | 242 | ||
242 | rb->close(fIndex); | 243 | rb->close(fIndex); |
243 | rb->close(fData); | 244 | rb->close(fData); |
244 | return PLUGIN_OK; | 245 | return PLUGIN_OK; |
245 | } | 246 | } |