diff options
author | Torne Wuff <torne@wolfpuppy.org.uk> | 2010-01-17 22:28:36 +0000 |
---|---|---|
committer | Torne Wuff <torne@wolfpuppy.org.uk> | 2010-01-17 22:28:36 +0000 |
commit | d10bcd6429b78768a1d5edcc831bdd72e6f648f0 (patch) | |
tree | b2fe379fd9a141c73ef10ac8e86b8725b4037683 /apps | |
parent | 7f28c94eda576e3f972fc05468188986f2e45885 (diff) | |
download | rockbox-d10bcd6429b78768a1d5edcc831bdd72e6f648f0.tar.gz rockbox-d10bcd6429b78768a1d5edcc831bdd72e6f648f0.zip |
Fix warnings in frotz, one of which is a real bug :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24268 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/frotz/dumb_init.c | 2 | ||||
-rw-r--r-- | apps/plugins/frotz/fastmem.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/apps/plugins/frotz/dumb_init.c b/apps/plugins/frotz/dumb_init.c index ea08447c0c..e4ab3ad824 100644 --- a/apps/plugins/frotz/dumb_init.c +++ b/apps/plugins/frotz/dumb_init.c | |||
@@ -53,7 +53,7 @@ int os_random_seed (void) | |||
53 | { | 53 | { |
54 | if (user_random_seed == -1) | 54 | if (user_random_seed == -1) |
55 | /* Use the rockbox tick as seed value */ | 55 | /* Use the rockbox tick as seed value */ |
56 | return ((int)rb->current_tick) & 0x7fff; | 56 | return ((int)*rb->current_tick) & 0x7fff; |
57 | else return user_random_seed; | 57 | else return user_random_seed; |
58 | } | 58 | } |
59 | 59 | ||
diff --git a/apps/plugins/frotz/fastmem.c b/apps/plugins/frotz/fastmem.c index cdb4bce602..ba0c95f5ce 100644 --- a/apps/plugins/frotz/fastmem.c +++ b/apps/plugins/frotz/fastmem.c | |||
@@ -342,7 +342,7 @@ void init_memory (void) | |||
342 | } | 342 | } |
343 | 343 | ||
344 | /* Assign left over memory as the arena for undo alloc */ | 344 | /* Assign left over memory as the arena for undo alloc */ |
345 | arena_start = arena_next = (void*)((int)(zmp + story_size + 3) & ~3); | 345 | arena_start = arena_next = (void*)((intptr_t)(zmp + story_size + 3) & ~3); |
346 | arena_end = zmp + buf_size; | 346 | arena_end = zmp + buf_size; |
347 | 347 | ||
348 | /* Load story file in chunks of 32KB */ | 348 | /* Load story file in chunks of 32KB */ |
@@ -385,7 +385,7 @@ void init_undo (void) | |||
385 | if ((arena_end - arena_start) >= size) { | 385 | if ((arena_end - arena_start) >= size) { |
386 | prev_zmp = arena_start; | 386 | prev_zmp = arena_start; |
387 | undo_diff = arena_start + h_dynamic_size; | 387 | undo_diff = arena_start + h_dynamic_size; |
388 | arena_start = (void*)((int)(arena_start + size + 3) & ~3); | 388 | arena_start = (void*)((intptr_t)(arena_start + size + 3) & ~3); |
389 | arena_next = arena_start; | 389 | arena_next = arena_start; |
390 | memcpy (prev_zmp, zmp, h_dynamic_size); | 390 | memcpy (prev_zmp, zmp, h_dynamic_size); |
391 | } else | 391 | } else |
@@ -691,7 +691,7 @@ static long mem_diff (zbyte *a, zbyte *b, zword mem_size, zbyte *diff) | |||
691 | unsigned size = mem_size; | 691 | unsigned size = mem_size; |
692 | zbyte *p = diff; | 692 | zbyte *p = diff; |
693 | unsigned j; | 693 | unsigned j; |
694 | zbyte c; | 694 | zbyte c = 0; |
695 | 695 | ||
696 | for (;;) { | 696 | for (;;) { |
697 | for (j = 0; size > 0 && (c = *a++ ^ *b++) == 0; j++) | 697 | for (j = 0; size > 0 && (c = *a++ ^ *b++) == 0; j++) |
@@ -928,7 +928,7 @@ int save_undo (void) | |||
928 | if ((arena_end - arena_next) >= size) { | 928 | if ((arena_end - arena_next) >= size) { |
929 | /* Trivial: enough room at the end */ | 929 | /* Trivial: enough room at the end */ |
930 | p = arena_next; | 930 | p = arena_next; |
931 | arena_next = (void*)((int)(arena_next + size + 3) & ~3); | 931 | arena_next = (void*)((intptr_t)(arena_next + size + 3) & ~3); |
932 | } else { | 932 | } else { |
933 | /* Need to wrap */ | 933 | /* Need to wrap */ |
934 | arena_next = arena_start; | 934 | arena_next = arena_start; |
@@ -939,7 +939,7 @@ int save_undo (void) | |||
939 | if (((void*)first_undo - arena_next) >= size) { | 939 | if (((void*)first_undo - arena_next) >= size) { |
940 | /* There is room before the "first" undo */ | 940 | /* There is room before the "first" undo */ |
941 | p = arena_next; | 941 | p = arena_next; |
942 | arena_next = (void*)((int)(arena_next + size + 3) & ~3); | 942 | arena_next = (void*)((intptr_t)(arena_next + size + 3) & ~3); |
943 | } else { | 943 | } else { |
944 | /* Not enough room, just need to free some */ | 944 | /* Not enough room, just need to free some */ |
945 | p = NULL; | 945 | p = NULL; |