summaryrefslogtreecommitdiff
path: root/tools/checkwps/checkwps.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2008-03-26 23:35:34 +0000
committerDave Chapman <dave@dchapman.com>2008-03-26 23:35:34 +0000
commit78d29f535ff14a5f213125baf63fa2961be17d79 (patch)
treea3d0992ab3a87ab073ed5aafa0529821dcedd31e /tools/checkwps/checkwps.c
parentd75bb78fdad9f3252df21e469c6f07346e250de4 (diff)
downloadrockbox-78d29f535ff14a5f213125baf63fa2961be17d79.tar.gz
rockbox-78d29f535ff14a5f213125baf63fa2961be17d79.zip
Major cleanup of checkwps - fix all warnings and add a script to build versions for all supported targets (plus some unsupported ones). You now need to run the version of checkwps that matches the device your WPS is for.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16831 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/checkwps/checkwps.c')
-rw-r--r--tools/checkwps/checkwps.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/tools/checkwps/checkwps.c b/tools/checkwps/checkwps.c
index ddaaf49b73..1051244538 100644
--- a/tools/checkwps/checkwps.c
+++ b/tools/checkwps/checkwps.c
@@ -1,5 +1,7 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <stdlib.h> 2#include <stdlib.h>
3#include <fcntl.h>
4#include "config.h"
3#include "gwps.h" 5#include "gwps.h"
4 6
5#define MIN(x,y) ((x) > (y) ? (y) : (x)) 7#define MIN(x,y) ((x) > (y) ? (y) : (x))
@@ -20,7 +22,7 @@ int errno;
20unsigned short letoh16(unsigned short x) 22unsigned short letoh16(unsigned short x)
21{ 23{
22 unsigned short n = 0x1234; 24 unsigned short n = 0x1234;
23 unsigned char* ch = &n; 25 unsigned char* ch = (unsigned char*)&n;
24 26
25 if (*ch == 0x34) 27 if (*ch == 0x34)
26 { 28 {
@@ -34,7 +36,7 @@ unsigned short letoh16(unsigned short x)
34unsigned int htole32(unsigned int x) 36unsigned int htole32(unsigned int x)
35{ 37{
36 unsigned short n = 0x1234; 38 unsigned short n = 0x1234;
37 unsigned char* ch = &n; 39 unsigned char* ch = (unsigned char*)&n;
38 40
39 if (*ch == 0x34) 41 if (*ch == 0x34)
40 { 42 {
@@ -80,6 +82,11 @@ bool load_wps_backdrop(char* filename)
80 return true; 82 return true;
81} 83}
82 84
85bool load_remote_wps_backdrop(char* filename)
86{
87 return true;
88}
89
83static char pluginbuf[PLUGIN_BUFFER_SIZE]; 90static char pluginbuf[PLUGIN_BUFFER_SIZE];
84 91
85static int dummy_func1(void) 92static int dummy_func1(void)
@@ -105,12 +112,17 @@ struct screen screens[NB_SCREENS] =
105 .width=LCD_WIDTH, 112 .width=LCD_WIDTH,
106 .height=LCD_HEIGHT, 113 .height=LCD_HEIGHT,
107 .depth=LCD_DEPTH, 114 .depth=LCD_DEPTH,
115#ifdef HAVE_LCD_COLOR
108 .is_color=true, 116 .is_color=true,
109 .has_disk_led=false, 117#else
118 .is_color=false,
119#endif
110 .getxmargin=dummy_func1, 120 .getxmargin=dummy_func1,
111 .getymargin=dummy_func1, 121 .getymargin=dummy_func1,
122#if LCD_DEPTH > 1
112 .get_foreground=dummy_func2, 123 .get_foreground=dummy_func2,
113 .get_background=dummy_func2, 124 .get_background=dummy_func2,
125#endif
114 }, 126 },
115#ifdef HAVE_REMOTE_LCD 127#ifdef HAVE_REMOTE_LCD
116 { 128 {
@@ -119,10 +131,12 @@ struct screen screens[NB_SCREENS] =
119 .height=LCD_REMOTE_HEIGHT, 131 .height=LCD_REMOTE_HEIGHT,
120 .depth=LCD_REMOTE_DEPTH, 132 .depth=LCD_REMOTE_DEPTH,
121 .is_color=false,/* No color remotes yet */ 133 .is_color=false,/* No color remotes yet */
122 .getxmargin=dummy_func, 134 .getxmargin=dummy_func1,
123 .getymargin=dummy_func, 135 .getymargin=dummy_func1,
124 .get_foreground=dummy_func, 136#if LCD_REMOTE_DEPTH > 1
125 .get_background=dummy_func, 137 .get_foreground=dummy_func2,
138 .get_background=dummy_func2,
139#endif
126 } 140 }
127#endif 141#endif
128}; 142};