summaryrefslogtreecommitdiff
path: root/apps/plugins/chip8.c
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2008-05-13 09:57:56 +0000
committerSteve Bavin <pondlife@pondlife.me>2008-05-13 09:57:56 +0000
commit652657781805d9cc10d744a49fb23eb17019fbbf (patch)
tree2d1a6ae597a17531f726b57fd9f8cbaa2a46a07f /apps/plugins/chip8.c
parenta94e40d5153ab698fa8a1b6b57d91fcb6acc905e (diff)
downloadrockbox-652657781805d9cc10d744a49fb23eb17019fbbf.zip
rockbox-652657781805d9cc10d744a49fb23eb17019fbbf.tar.gz
rockbox-652657781805d9cc10d744a49fb23eb17019fbbf.tar.bz2
rockbox-652657781805d9cc10d744a49fb23eb17019fbbf.tar.xz
Plugin parameters should be const.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17492 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/chip8.c')
-rw-r--r--apps/plugins/chip8.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index e00e421..d62ff5a 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -24,7 +24,7 @@
PLUGIN_HEADER
-static struct plugin_api* rb; /* here is a global api struct pointer */
+static const struct plugin_api* rb; /* here is a global api struct pointer */
#define EXTERN static
#define STATIC static
@@ -1287,7 +1287,7 @@ static void chip8_interrupt (void)
starttimer = newtimer - runtime;
}
-static bool chip8_init(char* file)
+static bool chip8_init(const char* file)
{
int numread;
int fd;
@@ -1307,14 +1307,16 @@ static bool chip8_init(char* file)
rb->close(fd);
/* is there a c8k file (chip8 keys) ? */
+ char c8kname[MAX_PATH];
+ rb->strcpy(c8kname, file);
for(i=0; i<16; i++) {
chip8_virtual_keys[i] = 0;
chip8_keymap[i] = i;
}
- len = rb->strlen(file);
- file[len-2] = '8';
- file[len-1] = 'k';
- fd = rb->open(file, O_RDONLY);
+ len = rb->strlen(c8kname);
+ c8kname[len-2] = '8';
+ c8kname[len-1] = 'k';
+ fd = rb->open(c8kname, O_RDONLY);
if (fd!=-1) {
rb->lcd_puts(0, 6, "File&Keymap OK.");
numread = rb->read(fd, chip8_keymap, 16);
@@ -1340,7 +1342,7 @@ static bool chip8_init(char* file)
return true;
}
-bool chip8_run(char* file)
+bool chip8_run(const char* file)
{
int ok;
@@ -1406,9 +1408,9 @@ bool chip8_run(char* file)
/***************** Plugin Entry Point *****************/
-enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
+enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
{
- char* filename;
+ const char* filename;
rb = api; /* copy to global api pointer */