Fix further 'variable set but not used' warnings reported from GCC 4.6.0.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29809 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-05-01 13:48:28 +00:00
parent 08fb3f6574
commit f7c4594134
17 changed files with 344 additions and 355 deletions

View File

@ -54,7 +54,6 @@ enum codec_status codec_run(void)
static NeAACDecFrameInfo frame_info; static NeAACDecFrameInfo frame_info;
NeAACDecHandle decoder; NeAACDecHandle decoder;
size_t n; size_t n;
void *ret;
unsigned int i; unsigned int i;
unsigned char* buffer; unsigned char* buffer;
int err, consumed, pkt_offset, skipped = 0; int err, consumed, pkt_offset, skipped = 0;
@ -192,7 +191,7 @@ enum codec_status codec_run(void)
/* Decode one block - returned samples will be host-endian */ /* Decode one block - returned samples will be host-endian */
for(i = 0; i < rmctx.sub_packet_cnt; i++) { for(i = 0; i < rmctx.sub_packet_cnt; i++) {
ret = NeAACDecDecode(decoder, &frame_info, buffer, rmctx.sub_packet_lengths[i]); NeAACDecDecode(decoder, &frame_info, buffer, rmctx.sub_packet_lengths[i]);
buffer += rmctx.sub_packet_lengths[i]; buffer += rmctx.sub_packet_lengths[i];
if (frame_info.error > 0) { if (frame_info.error > 0) {
DEBUGF("FAAD: decode error '%s'\n", NeAACDecGetErrorMessage(frame_info.error)); DEBUGF("FAAD: decode error '%s'\n", NeAACDecGetErrorMessage(frame_info.error));

View File

@ -315,7 +315,10 @@ void option_select_next_val(const struct settings_list *setting,
static int selection_to_val(const struct settings_list *setting, int selection) static int selection_to_val(const struct settings_list *setting, int selection)
{ {
int min = 0, max = 0, step = 1; /* rockbox: comment 'set but unused' variables
int min = 0;
*/
int max = 0, step = 1;
if (((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING) || if (((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING) ||
((setting->flags & F_CHOICE_SETTING) == F_CHOICE_SETTING)) ((setting->flags & F_CHOICE_SETTING) == F_CHOICE_SETTING))
return selection; return selection;
@ -339,10 +342,10 @@ static int selection_to_val(const struct settings_list *setting, int selection)
#ifndef ASCENDING_INT_SETTINGS #ifndef ASCENDING_INT_SETTINGS
step = sound_steps(setting_id); step = sound_steps(setting_id);
max = sound_max(setting_id); max = sound_max(setting_id);
min = sound_min(setting_id); /* min = sound_min(setting_id); */
#else #else
step = -sound_steps(setting_id); step = -sound_steps(setting_id);
min = sound_max(setting_id); /* min = sound_max(setting_id); */
max = sound_min(setting_id); max = sound_min(setting_id);
#endif #endif
} }
@ -350,12 +353,12 @@ static int selection_to_val(const struct settings_list *setting, int selection)
{ {
const struct int_setting *info = setting->int_setting; const struct int_setting *info = setting->int_setting;
#ifndef ASCENDING_INT_SETTINGS #ifndef ASCENDING_INT_SETTINGS
min = info->min; /* min = info->min; */
max = info->max; max = info->max;
step = info->step; step = info->step;
#else #else
max = info->min; max = info->min;
min = info->max; /* min = info->max; */
step = -info->step; step = -info->step;
#endif #endif
} }

View File

@ -223,7 +223,7 @@ static int rm_parse_header(int fd, RMContext *rmctx, struct mp3entry *id3)
struct real_object_t obj; struct real_object_t obj;
int res; int res;
int skipped; int skipped;
off_t curpos; off_t curpos __attribute__((unused));
uint8_t len; /* Holds a string_length, which is then passed to read_string() */ uint8_t len; /* Holds a string_length, which is then passed to read_string() */
#ifdef SIMULATOR #ifdef SIMULATOR

View File

@ -1953,7 +1953,7 @@ static int bubbles_remove(struct game_context* bb) {
******************************************************************************/ ******************************************************************************/
static void bubbles_anchored(struct game_context* bb, int row, int col) { static void bubbles_anchored(struct game_context* bb, int row, int col) {
int i, adj; int i, adj;
int myrow, mycol, mytype; int myrow, mycol;
int count = 0; int count = 0;
struct coord { struct coord {
@ -1971,7 +1971,6 @@ static void bubbles_anchored(struct game_context* bb, int row, int col) {
for(i=0; i<count; i++) { for(i=0; i<count; i++) {
myrow = search[i].row; myrow = search[i].row;
mycol = search[i].col; mycol = search[i].col;
mytype = bb->playboard[myrow][mycol].type;
adj = myrow%2; adj = myrow%2;
if(mycol-1 >= 0) { if(mycol-1 >= 0) {

View File

@ -321,7 +321,6 @@ void cb_saveposition ( void ) {
/* ---- Restore saved position ---- */ /* ---- Restore saved position ---- */
void cb_restoreposition ( void ) { void cb_restoreposition ( void ) {
int fd; int fd;
int c;
short sq; short sq;
unsigned short m; unsigned short m;
@ -357,7 +356,7 @@ void cb_restoreposition ( void ) {
else else
--color[sq]; --color[sq];
} }
GameCnt = -1; c = '?'; GameCnt = -1;
while (rb->read(fd, &(GameList[++GameCnt].gmove), while (rb->read(fd, &(GameList[++GameCnt].gmove),
sizeof(GameList[GameCnt].gmove)) > 0) { sizeof(GameList[GameCnt].gmove)) > 0) {
rb->read(fd, &(GameList[GameCnt].score), rb->read(fd, &(GameList[GameCnt].score),

View File

@ -392,7 +392,6 @@ static void chopTerrainNodeDeleteAndShift(struct CTerrain *ter,int nodeIndex)
int chopUpdateTerrainRecycling(struct CTerrain *ter) int chopUpdateTerrainRecycling(struct CTerrain *ter)
{ {
int i=1; int i=1;
int ret = 0;
int iNewNodePos,g,v; int iNewNodePos,g,v;
while(i < ter->iNodesCount) while(i < ter->iNodesCount)
{ {
@ -412,8 +411,6 @@ int chopUpdateTerrainRecycling(struct CTerrain *ter)
v*=5; v*=5;
chopAddTerrainNode(ter,iNewNodePos,g - iR(-v,v)); chopAddTerrainNode(ter,iNewNodePos,g - iR(-v,v));
ret=1;
} }
i++; i++;
@ -426,7 +423,7 @@ int chopUpdateTerrainRecycling(struct CTerrain *ter)
int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX) int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX)
{ {
int iNodeIndexOne=0,iNodeIndexTwo=0, h, terY1, terY2, terX1, terX2, a, b; int iNodeIndexOne=0,iNodeIndexTwo=0, h, terY1, terY2, terX2, a, b;
float c,d; float c,d;
int i=0; int i=0;
@ -444,7 +441,7 @@ int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX)
terY1 = ter->mNodes[iNodeIndexOne].y; terY1 = ter->mNodes[iNodeIndexOne].y;
terY2 = ter->mNodes[iNodeIndexTwo].y; terY2 = ter->mNodes[iNodeIndexTwo].y;
terX1 = 0; /* terX1 = 0; */
terX2 = ter->mNodes[iNodeIndexTwo].x - ter->mNodes[iNodeIndexOne].x; terX2 = ter->mNodes[iNodeIndexTwo].x - ter->mNodes[iNodeIndexOne].x;
pX-= ter->mNodes[iNodeIndexOne].x; pX-= ter->mNodes[iNodeIndexOne].x;

View File

@ -1,5 +1,5 @@
/* fastmem.c - Memory related functions (fast version without virtual memory) /* fastmem.c - Memory related functions (fast version without virtual memory)
* Copyright (c) 1995-1997 Stefan Jokisch * Copyright (c) 1995-1997 Stefan Jokisch
* *
* Changes for Rockbox copyright 2009 Torne Wuff * Changes for Rockbox copyright 2009 Torne Wuff
* *
@ -93,7 +93,7 @@ zword get_header_extension (int entry)
zword val; zword val;
if (h_extension_table == 0 || entry > hx_table_size) if (h_extension_table == 0 || entry > hx_table_size)
return 0; return 0;
addr = h_extension_table + 2 * entry; addr = h_extension_table + 2 * entry;
LOW_WORD (addr, val) LOW_WORD (addr, val)
@ -114,7 +114,7 @@ void set_header_extension (int entry, zword val)
zword addr; zword addr;
if (h_extension_table == 0 || entry > hx_table_size) if (h_extension_table == 0 || entry > hx_table_size)
return; return;
addr = h_extension_table + 2 * entry; addr = h_extension_table + 2 * entry;
SET_WORD (addr, val) SET_WORD (addr, val)
@ -141,39 +141,39 @@ void restart_header (void)
SET_WORD (H_FLAGS, h_flags) SET_WORD (H_FLAGS, h_flags)
if (h_version >= V4) { if (h_version >= V4) {
SET_BYTE (H_INTERPRETER_NUMBER, h_interpreter_number) SET_BYTE (H_INTERPRETER_NUMBER, h_interpreter_number)
SET_BYTE (H_INTERPRETER_VERSION, h_interpreter_version) SET_BYTE (H_INTERPRETER_VERSION, h_interpreter_version)
SET_BYTE (H_SCREEN_ROWS, h_screen_rows) SET_BYTE (H_SCREEN_ROWS, h_screen_rows)
SET_BYTE (H_SCREEN_COLS, h_screen_cols) SET_BYTE (H_SCREEN_COLS, h_screen_cols)
} }
/* It's less trouble to use font size 1x1 for V5 games, especially /* It's less trouble to use font size 1x1 for V5 games, especially
because of a bug in the unreleased German version of "Zork 1" */ because of a bug in the unreleased German version of "Zork 1" */
if (h_version != V6) { if (h_version != V6) {
screen_x_size = (zword) h_screen_cols; screen_x_size = (zword) h_screen_cols;
screen_y_size = (zword) h_screen_rows; screen_y_size = (zword) h_screen_rows;
font_x_size = 1; font_x_size = 1;
font_y_size = 1; font_y_size = 1;
} else { } else {
screen_x_size = h_screen_width; screen_x_size = h_screen_width;
screen_y_size = h_screen_height; screen_y_size = h_screen_height;
font_x_size = h_font_width; font_x_size = h_font_width;
font_y_size = h_font_height; font_y_size = h_font_height;
} }
if (h_version >= V5) { if (h_version >= V5) {
SET_WORD (H_SCREEN_WIDTH, screen_x_size) SET_WORD (H_SCREEN_WIDTH, screen_x_size)
SET_WORD (H_SCREEN_HEIGHT, screen_y_size) SET_WORD (H_SCREEN_HEIGHT, screen_y_size)
SET_BYTE (H_FONT_HEIGHT, font_y_size) SET_BYTE (H_FONT_HEIGHT, font_y_size)
SET_BYTE (H_FONT_WIDTH, font_x_size) SET_BYTE (H_FONT_WIDTH, font_x_size)
SET_BYTE (H_DEFAULT_BACKGROUND, h_default_background) SET_BYTE (H_DEFAULT_BACKGROUND, h_default_background)
SET_BYTE (H_DEFAULT_FOREGROUND, h_default_foreground) SET_BYTE (H_DEFAULT_FOREGROUND, h_default_foreground)
} }
if (h_version == V6) if (h_version == V6)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
storeb ((zword) (H_USER_NAME + i), h_user_name[i]); storeb ((zword) (H_USER_NAME + i), h_user_name[i]);
SET_BYTE (H_STANDARD_HIGH, h_standard_high) SET_BYTE (H_STANDARD_HIGH, h_standard_high)
SET_BYTE (H_STANDARD_LOW, h_standard_low) SET_BYTE (H_STANDARD_LOW, h_standard_low)
@ -197,41 +197,41 @@ void init_memory (void)
size_t buf_size; size_t buf_size;
static struct { static struct {
enum story story_id; enum story story_id;
zword release; zword release;
zbyte serial[6]; zbyte serial[6];
} records[] = { } records[] = {
{ SHERLOCK, 21, "871214" }, { SHERLOCK, 21, "871214" },
{ SHERLOCK, 26, "880127" }, { SHERLOCK, 26, "880127" },
{ BEYOND_ZORK, 47, "870915" }, { BEYOND_ZORK, 47, "870915" },
{ BEYOND_ZORK, 49, "870917" }, { BEYOND_ZORK, 49, "870917" },
{ BEYOND_ZORK, 51, "870923" }, { BEYOND_ZORK, 51, "870923" },
{ BEYOND_ZORK, 57, "871221" }, { BEYOND_ZORK, 57, "871221" },
{ ZORK_ZERO, 296, "881019" }, { ZORK_ZERO, 296, "881019" },
{ ZORK_ZERO, 366, "890323" }, { ZORK_ZERO, 366, "890323" },
{ ZORK_ZERO, 383, "890602" }, { ZORK_ZERO, 383, "890602" },
{ ZORK_ZERO, 393, "890714" }, { ZORK_ZERO, 393, "890714" },
{ SHOGUN, 292, "890314" }, { SHOGUN, 292, "890314" },
{ SHOGUN, 295, "890321" }, { SHOGUN, 295, "890321" },
{ SHOGUN, 311, "890510" }, { SHOGUN, 311, "890510" },
{ SHOGUN, 322, "890706" }, { SHOGUN, 322, "890706" },
{ ARTHUR, 54, "890606" }, { ARTHUR, 54, "890606" },
{ ARTHUR, 63, "890622" }, { ARTHUR, 63, "890622" },
{ ARTHUR, 74, "890714" }, { ARTHUR, 74, "890714" },
{ JOURNEY, 26, "890316" }, { JOURNEY, 26, "890316" },
{ JOURNEY, 30, "890322" }, { JOURNEY, 30, "890322" },
{ JOURNEY, 77, "890616" }, { JOURNEY, 77, "890616" },
{ JOURNEY, 83, "890706" }, { JOURNEY, 83, "890706" },
{ LURKING_HORROR, 203, "870506" }, { LURKING_HORROR, 203, "870506" },
{ LURKING_HORROR, 219, "870912" }, { LURKING_HORROR, 219, "870912" },
{ LURKING_HORROR, 221, "870918" }, { LURKING_HORROR, 221, "870918" },
{ UNKNOWN, 0, "------" } { UNKNOWN, 0, "------" }
}; };
/* Open story file */ /* Open story file */
if ((story_fp = rb->open(story_name, O_RDONLY)) < 0) if ((story_fp = rb->open(story_name, O_RDONLY)) < 0)
os_fatal ("Cannot open story file"); os_fatal ("Cannot open story file");
/* Allocate memory for story header */ /* Allocate memory for story header */
@ -240,19 +240,19 @@ void init_memory (void)
/* Load header into memory */ /* Load header into memory */
if (fread (zmp, 1, 64, story_fp) != 64) if (fread (zmp, 1, 64, story_fp) != 64)
os_fatal ("Story file read error"); os_fatal ("Story file read error");
/* Copy header fields to global variables */ /* Copy header fields to global variables */
LOW_BYTE (H_VERSION, h_version) LOW_BYTE (H_VERSION, h_version)
if (h_version < V1 || h_version > V8) if (h_version < V1 || h_version > V8)
os_fatal ("Unknown Z-code version"); os_fatal ("Unknown Z-code version");
LOW_BYTE (H_CONFIG, h_config) LOW_BYTE (H_CONFIG, h_config)
if (h_version == V3 && (h_config & CONFIG_BYTE_SWAPPED)) if (h_version == V3 && (h_config & CONFIG_BYTE_SWAPPED))
os_fatal ("Byte swapped story file"); os_fatal ("Byte swapped story file");
LOW_WORD (H_RELEASE, h_release) LOW_WORD (H_RELEASE, h_release)
LOW_WORD (H_RESIDENT_SIZE, h_resident_size) LOW_WORD (H_RESIDENT_SIZE, h_resident_size)
@ -264,7 +264,7 @@ void init_memory (void)
LOW_WORD (H_FLAGS, h_flags) LOW_WORD (H_FLAGS, h_flags)
for (i = 0, addr = H_SERIAL; i < 6; i++, addr++) for (i = 0, addr = H_SERIAL; i < 6; i++, addr++)
LOW_BYTE (addr, h_serial[i]) LOW_BYTE (addr, h_serial[i])
/* Auto-detect buggy story files that need special fixes */ /* Auto-detect buggy story files that need special fixes */
@ -272,15 +272,15 @@ void init_memory (void)
for (i = 0; records[i].story_id != UNKNOWN; i++) { for (i = 0; records[i].story_id != UNKNOWN; i++) {
if (h_release == records[i].release) { if (h_release == records[i].release) {
for (j = 0; j < 6; j++) for (j = 0; j < 6; j++)
if (h_serial[j] != records[i].serial[j]) if (h_serial[j] != records[i].serial[j])
goto no_match; goto no_match;
story_id = records[i].story_id; story_id = records[i].story_id;
} }
no_match: ; /* null statement */ no_match: ; /* null statement */
@ -293,18 +293,18 @@ void init_memory (void)
if (h_file_size != 0) { if (h_file_size != 0) {
story_size = (long) 2 * h_file_size; story_size = (long) 2 * h_file_size;
if (h_version >= V4) if (h_version >= V4)
story_size *= 2; story_size *= 2;
if (h_version >= V6) if (h_version >= V6)
story_size *= 2; story_size *= 2;
} else { /* some old games lack the file size entry */ } else { /* some old games lack the file size entry */
fseek (story_fp, 0, SEEK_END); fseek (story_fp, 0, SEEK_END);
story_size = ftell (story_fp); story_size = ftell (story_fp);
fseek (story_fp, 64, SEEK_SET); fseek (story_fp, 64, SEEK_SET);
} }
@ -318,27 +318,27 @@ void init_memory (void)
/* Zork Zero Macintosh doesn't have the graphics flag set */ /* Zork Zero Macintosh doesn't have the graphics flag set */
if (story_id == ZORK_ZERO && h_release == 296) if (story_id == ZORK_ZERO && h_release == 296)
h_flags |= GRAPHICS_FLAG; h_flags |= GRAPHICS_FLAG;
/* Adjust opcode tables */ /* Adjust opcode tables */
if (h_version <= V4) { if (h_version <= V4) {
op0_opcodes[0x09] = z_pop; op0_opcodes[0x09] = z_pop;
op1_opcodes[0x0f] = z_not; op1_opcodes[0x0f] = z_not;
} else { } else {
op0_opcodes[0x09] = z_catch; op0_opcodes[0x09] = z_catch;
op1_opcodes[0x0f] = z_call_n; op1_opcodes[0x0f] = z_call_n;
} }
/* Allocate memory for story data */ /* Allocate memory for story data */
if ((size_t)story_size > buf_size) if ((size_t)story_size > buf_size)
{ {
audiobuf = rb->plugin_get_audio_buffer(&buf_size); audiobuf = rb->plugin_get_audio_buffer(&buf_size);
if ((size_t)story_size > buf_size) if ((size_t)story_size > buf_size)
os_fatal ("Out of memory"); os_fatal ("Out of memory");
rb->memcpy(audiobuf, zmp, 64); rb->memcpy(audiobuf, zmp, 64);
zmp = audiobuf; zmp = audiobuf;
} }
/* Assign left over memory as the arena for undo alloc */ /* Assign left over memory as the arena for undo alloc */
@ -351,13 +351,13 @@ void init_memory (void)
for (size = 64; size < story_size; size += n) { for (size = 64; size < story_size; size += n) {
if (story_size - size < 0x8000) if (story_size - size < 0x8000)
n = (unsigned) (story_size - size); n = (unsigned) (story_size - size);
SET_PC (size) SET_PC (size)
if (fread (pcp, 1, n, story_fp) != (signed)n) if (fread (pcp, 1, n, story_fp) != (signed)n)
os_fatal ("Story file read error"); os_fatal ("Story file read error");
} }
@ -383,13 +383,13 @@ void init_undo (void)
+ 1.5 h_dynamic_size for Quetzal diff + 2. */ + 1.5 h_dynamic_size for Quetzal diff + 2. */
int size = (h_dynamic_size * 5) / 2 + 2; int size = (h_dynamic_size * 5) / 2 + 2;
if ((arena_end - arena_start) >= size) { if ((arena_end - arena_start) >= size) {
prev_zmp = arena_start; prev_zmp = arena_start;
undo_diff = arena_start + h_dynamic_size; undo_diff = arena_start + h_dynamic_size;
arena_start = (void*)((intptr_t)(arena_start + size + 3) & ~3); arena_start = (void*)((intptr_t)(arena_start + size + 3) & ~3);
arena_next = arena_start; arena_next = arena_start;
memcpy (prev_zmp, zmp, h_dynamic_size); memcpy (prev_zmp, zmp, h_dynamic_size);
} else } else
f_setup.undo_slots = 0; f_setup.undo_slots = 0;
}/* init_undo */ }/* init_undo */
@ -402,21 +402,19 @@ void init_undo (void)
static void free_undo (int count) static void free_undo (int count)
{ {
undo_t *p;
if (count > undo_count) if (count > undo_count)
count = undo_count; count = undo_count;
while (count--) { while (count--) {
p = first_undo;
if (curr_undo == first_undo) if (curr_undo == first_undo)
curr_undo = curr_undo->next; curr_undo = curr_undo->next;
first_undo = first_undo->next; first_undo = first_undo->next;
undo_count--; undo_count--;
} }
if (first_undo) if (first_undo)
first_undo->prev = NULL; first_undo->prev = NULL;
else else
last_undo = NULL; last_undo = NULL;
}/* free_undo */ }/* free_undo */
/* /*
@ -429,7 +427,7 @@ static void free_undo (int count)
void reset_memory (void) void reset_memory (void)
{ {
if (story_fp != -1) if (story_fp != -1)
fclose (story_fp); fclose (story_fp);
story_fp = -1; story_fp = -1;
free_undo (undo_count); free_undo (undo_count);
@ -452,22 +450,22 @@ void storeb (zword addr, zbyte value)
{ {
if (addr >= h_dynamic_size) if (addr >= h_dynamic_size)
runtime_error (ERR_STORE_RANGE); runtime_error (ERR_STORE_RANGE);
if (addr == H_FLAGS + 1) { /* flags register is modified */ if (addr == H_FLAGS + 1) { /* flags register is modified */
h_flags &= ~(SCRIPTING_FLAG | FIXED_FONT_FLAG); h_flags &= ~(SCRIPTING_FLAG | FIXED_FONT_FLAG);
h_flags |= value & (SCRIPTING_FLAG | FIXED_FONT_FLAG); h_flags |= value & (SCRIPTING_FLAG | FIXED_FONT_FLAG);
if (value & SCRIPTING_FLAG) { if (value & SCRIPTING_FLAG) {
if (!ostream_script) if (!ostream_script)
script_open (); script_open ();
} else { } else {
if (ostream_script) if (ostream_script)
script_close (); script_close ();
} }
refresh_text_style (); refresh_text_style ();
} }
@ -493,7 +491,7 @@ void storew (zword addr, zword value)
/* /*
* z_restart, re-load dynamic area, clear the stack and set the PC. * z_restart, re-load dynamic area, clear the stack and set the PC.
* *
* no zargs used * no zargs used
* *
*/ */
@ -509,10 +507,10 @@ void z_restart (void)
if (!first_restart) { if (!first_restart) {
fseek (story_fp, 0, SEEK_SET); fseek (story_fp, 0, SEEK_SET);
if (fread (zmp, 1, h_dynamic_size, story_fp) != h_dynamic_size) if (fread (zmp, 1, h_dynamic_size, story_fp) != h_dynamic_size)
os_fatal ("Story file read error"); os_fatal ("Story file read error");
} else first_restart = FALSE; } else first_restart = FALSE;
@ -524,8 +522,8 @@ void z_restart (void)
if (h_version != V6) { if (h_version != V6) {
long pc = (long) h_start_pc; long pc = (long) h_start_pc;
SET_PC (pc) SET_PC (pc)
} else call (h_start_pc, 0, NULL, 0); } else call (h_start_pc, 0, NULL, 0);
@ -546,30 +544,30 @@ static void get_default_name (char *default_name, zword addr)
if (addr != 0) { if (addr != 0) {
zbyte len; zbyte len;
int i; int i;
LOW_BYTE (addr, len) LOW_BYTE (addr, len)
addr++; addr++;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
zbyte c; zbyte c;
LOW_BYTE (addr, c) LOW_BYTE (addr, c)
addr++; addr++;
if (c >= 'A' && c <= 'Z') if (c >= 'A' && c <= 'Z')
c += 'a' - 'A'; c += 'a' - 'A';
default_name[i] = c; default_name[i] = c;
} }
default_name[i] = 0; default_name[i] = 0;
if (strchr (default_name, '.') == NULL) if (strchr (default_name, '.') == NULL)
strcpy (default_name + i, ".AUX"); strcpy (default_name + i, ".AUX");
} else strcpy (default_name, auxilary_name); } else strcpy (default_name, auxilary_name);
@ -578,9 +576,9 @@ static void get_default_name (char *default_name, zword addr)
/* /*
* z_restore, restore [a part of] a Z-machine state from disk * z_restore, restore [a part of] a Z-machine state from disk
* *
* zargs[0] = address of area to restore (optional) * zargs[0] = address of area to restore (optional)
* zargs[1] = number of bytes to restore * zargs[1] = number of bytes to restore
* zargs[2] = address of suggested file name * zargs[2] = address of suggested file name
* *
*/ */
@ -594,84 +592,84 @@ void z_restore (void)
if (zargc != 0) { if (zargc != 0) {
/* Get the file name */ /* Get the file name */
get_default_name (default_name, (zargc >= 3) ? zargs[2] : 0); get_default_name (default_name, (zargc >= 3) ? zargs[2] : 0);
if (os_read_file_name (new_name, default_name, FILE_LOAD_AUX) == 0) if (os_read_file_name (new_name, default_name, FILE_LOAD_AUX) == 0)
goto finished; goto finished;
strcpy (auxilary_name, default_name); strcpy (auxilary_name, default_name);
/* Open auxilary file */ /* Open auxilary file */
if ((gfp = rb->open (new_name, O_RDONLY)) < 0) if ((gfp = rb->open (new_name, O_RDONLY)) < 0)
goto finished; goto finished;
/* Load auxilary file */ /* Load auxilary file */
success = fread (zmp + zargs[0], 1, zargs[1], gfp); success = fread (zmp + zargs[0], 1, zargs[1], gfp);
/* Close auxilary file */ /* Close auxilary file */
fclose (gfp); fclose (gfp);
} else { } else {
/* Get the file name */ /* Get the file name */
if (os_read_file_name (new_name, save_name, FILE_RESTORE) == 0) if (os_read_file_name (new_name, save_name, FILE_RESTORE) == 0)
goto finished; goto finished;
strcpy (save_name, new_name); strcpy (save_name, new_name);
/* Open game file */ /* Open game file */
if ((gfp = rb->open (new_name, O_RDONLY)) < 0) if ((gfp = rb->open (new_name, O_RDONLY)) < 0)
goto finished; goto finished;
success = restore_quetzal (gfp, story_fp); success = restore_quetzal (gfp, story_fp);
/* Close game file */ /* Close game file */
fclose (gfp); fclose (gfp);
if ((short) success >= 0) { if ((short) success >= 0) {
if ((short) success > 0) { if ((short) success > 0) {
zbyte old_screen_rows; zbyte old_screen_rows;
zbyte old_screen_cols; zbyte old_screen_cols;
/* In V3, reset the upper window. */ /* In V3, reset the upper window. */
if (h_version == V3) if (h_version == V3)
split_window (0); split_window (0);
LOW_BYTE (H_SCREEN_ROWS, old_screen_rows); LOW_BYTE (H_SCREEN_ROWS, old_screen_rows);
LOW_BYTE (H_SCREEN_COLS, old_screen_cols); LOW_BYTE (H_SCREEN_COLS, old_screen_cols);
/* Reload cached header fields. */ /* Reload cached header fields. */
restart_header (); restart_header ();
/* /*
* Since QUETZAL files may be saved on many different machines, * Since QUETZAL files may be saved on many different machines,
* the screen sizes may vary a lot. Erasing the status window * the screen sizes may vary a lot. Erasing the status window
* seems to cover up most of the resulting badness. * seems to cover up most of the resulting badness.
*/ */
if (h_version > V3 && h_version != V6 if (h_version > V3 && h_version != V6
&& (h_screen_rows != old_screen_rows && (h_screen_rows != old_screen_rows
|| h_screen_cols != old_screen_cols)) || h_screen_cols != old_screen_cols))
erase_window (1); erase_window (1);
} }
} else } else
os_fatal ("Error reading save file"); os_fatal ("Error reading save file");
} }
finished: finished:
if (h_version <= V3) if (h_version <= V3)
branch (success); branch (success);
else else
store (success); store (success);
}/* z_restore */ }/* z_restore */
@ -694,28 +692,28 @@ static long mem_diff (zbyte *a, zbyte *b, zword mem_size, zbyte *diff)
zbyte c = 0; zbyte c = 0;
for (;;) { for (;;) {
for (j = 0; size > 0 && (c = *a++ ^ *b++) == 0; j++) for (j = 0; size > 0 && (c = *a++ ^ *b++) == 0; j++)
size--; size--;
if (size == 0) break; if (size == 0) break;
size--; size--;
if (j > 0x8000) { if (j > 0x8000) {
*p++ = 0; *p++ = 0;
*p++ = 0xff; *p++ = 0xff;
*p++ = 0xff; *p++ = 0xff;
j -= 0x8000; j -= 0x8000;
} }
if (j > 0) { if (j > 0) {
*p++ = 0; *p++ = 0;
j--; j--;
if (j <= 0x7f) { if (j <= 0x7f) {
*p++ = j; *p++ = j;
} else { } else {
*p++ = (j & 0x7f) | 0x80; *p++ = (j & 0x7f) | 0x80;
*p++ = (j & 0x7f80) >> 7; *p++ = (j & 0x7f80) >> 7;
} }
} }
*p++ = c; *p++ = c;
*(b - 1) ^= c; *(b - 1) ^= c;
} }
return p - diff; return p - diff;
}/* mem_diff */ }/* mem_diff */
@ -732,27 +730,27 @@ static void mem_undiff (zbyte *diff, long diff_length, zbyte *dest)
zbyte c; zbyte c;
while (diff_length) { while (diff_length) {
c = *diff++; c = *diff++;
diff_length--; diff_length--;
if (c == 0) { if (c == 0) {
unsigned runlen; unsigned runlen;
if (!diff_length) if (!diff_length)
return; /* Incomplete run */ return; /* Incomplete run */
runlen = *diff++; runlen = *diff++;
diff_length--; diff_length--;
if (runlen & 0x80) { if (runlen & 0x80) {
if (!diff_length) if (!diff_length)
return; /* Incomplete extended run */ return; /* Incomplete extended run */
c = *diff++; c = *diff++;
diff_length--; diff_length--;
runlen = (runlen & 0x7f) | (((unsigned) c) << 7); runlen = (runlen & 0x7f) | (((unsigned) c) << 7);
} }
dest += runlen + 1; dest += runlen + 1;
} else { } else {
*dest++ ^= c; *dest++ ^= c;
} }
} }
}/* mem_undiff */ }/* mem_undiff */
@ -766,13 +764,13 @@ static void mem_undiff (zbyte *diff, long diff_length, zbyte *dest)
int restore_undo (void) int restore_undo (void)
{ {
if (f_setup.undo_slots == 0) /* undo feature unavailable */ if (f_setup.undo_slots == 0) /* undo feature unavailable */
return -1; return -1;
if (curr_undo == NULL) /* no saved game state */ if (curr_undo == NULL) /* no saved game state */
return 0; return 0;
/* undo possible */ /* undo possible */
@ -783,7 +781,7 @@ int restore_undo (void)
frame_count = curr_undo->frame_count; frame_count = curr_undo->frame_count;
mem_undiff ((zbyte *) (curr_undo + 1), curr_undo->diff_size, prev_zmp); mem_undiff ((zbyte *) (curr_undo + 1), curr_undo->diff_size, prev_zmp);
memcpy (sp, (zbyte *)(curr_undo + 1) + curr_undo->diff_size, memcpy (sp, (zbyte *)(curr_undo + 1) + curr_undo->diff_size,
curr_undo->stack_size * sizeof (*sp)); curr_undo->stack_size * sizeof (*sp));
curr_undo = curr_undo->prev; curr_undo = curr_undo->prev;
@ -796,7 +794,7 @@ int restore_undo (void)
/* /*
* z_restore_undo, restore a Z-machine state from memory. * z_restore_undo, restore a Z-machine state from memory.
* *
* no zargs used * no zargs used
* *
*/ */
@ -810,9 +808,9 @@ void z_restore_undo (void)
/* /*
* z_save, save [a part of] the Z-machine state to disk. * z_save, save [a part of] the Z-machine state to disk.
* *
* zargs[0] = address of memory area to save (optional) * zargs[0] = address of memory area to save (optional)
* zargs[1] = number of bytes to save * zargs[1] = number of bytes to save
* zargs[2] = address of suggested file name * zargs[2] = address of suggested file name
* *
*/ */
@ -826,63 +824,63 @@ void z_save (void)
if (zargc != 0) { if (zargc != 0) {
/* Get the file name */ /* Get the file name */
get_default_name (default_name, (zargc >= 3) ? zargs[2] : 0); get_default_name (default_name, (zargc >= 3) ? zargs[2] : 0);
if (os_read_file_name (new_name, default_name, FILE_SAVE_AUX) == 0) if (os_read_file_name (new_name, default_name, FILE_SAVE_AUX) == 0)
goto finished; goto finished;
strcpy (auxilary_name, default_name); strcpy (auxilary_name, default_name);
/* Open auxilary file */ /* Open auxilary file */
if ((gfp = rb->open (new_name, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0) if ((gfp = rb->open (new_name, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
goto finished; goto finished;
/* Write auxilary file */ /* Write auxilary file */
success = fwrite (zmp + zargs[0], zargs[1], 1, gfp); success = fwrite (zmp + zargs[0], zargs[1], 1, gfp);
/* Close auxilary file */ /* Close auxilary file */
fclose (gfp); fclose (gfp);
} else { } else {
/* Get the file name */ /* Get the file name */
if (os_read_file_name (new_name, save_name, FILE_SAVE) == 0) if (os_read_file_name (new_name, save_name, FILE_SAVE) == 0)
goto finished; goto finished;
strcpy (save_name, new_name); strcpy (save_name, new_name);
/* Open game file */ /* Open game file */
if ((gfp = rb->open (new_name, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0) if ((gfp = rb->open (new_name, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
goto finished; goto finished;
success = save_quetzal (gfp, story_fp); success = save_quetzal (gfp, story_fp);
/* Close game file and check for errors */ /* Close game file and check for errors */
if (fclose (gfp) != 0 || ferror (story_fp)) { if (fclose (gfp) != 0 || ferror (story_fp)) {
print_string ("Error writing save file\n"); print_string ("Error writing save file\n");
goto finished; goto finished;
} }
/* Success */ /* Success */
success = 1; success = 1;
} }
finished: finished:
if (h_version <= V3) if (h_version <= V3)
branch (success); branch (success);
else else
store (success); store (success);
}/* z_save */ }/* z_save */
@ -900,57 +898,57 @@ int save_undo (void)
int size; int size;
undo_t *p; undo_t *p;
if (f_setup.undo_slots == 0) /* undo feature unavailable */ if (f_setup.undo_slots == 0) /* undo feature unavailable */
return -1; return -1;
/* save undo possible */ /* save undo possible */
while (last_undo != curr_undo) { while (last_undo != curr_undo) {
p = last_undo; p = last_undo;
last_undo = last_undo->prev; last_undo = last_undo->prev;
arena_next = p; arena_next = p;
undo_count--; undo_count--;
} }
if (last_undo) if (last_undo)
last_undo->next = NULL; last_undo->next = NULL;
else else
first_undo = NULL; first_undo = NULL;
if (undo_count == f_setup.undo_slots) if (undo_count == f_setup.undo_slots)
free_undo (1); free_undo (1);
diff_size = mem_diff (zmp, prev_zmp, h_dynamic_size, undo_diff); diff_size = mem_diff (zmp, prev_zmp, h_dynamic_size, undo_diff);
stack_size = stack + STACK_SIZE - sp; stack_size = stack + STACK_SIZE - sp;
do { do {
size = sizeof (undo_t) + diff_size + stack_size * sizeof (*sp); size = sizeof (undo_t) + diff_size + stack_size * sizeof (*sp);
if (arena_next > (void*)first_undo) { if (arena_next > (void*)first_undo) {
/* Free space is all at the end */ /* Free space is all at the end */
if ((arena_end - arena_next) >= size) { if ((arena_end - arena_next) >= size) {
/* Trivial: enough room at the end */ /* Trivial: enough room at the end */
p = arena_next; p = arena_next;
arena_next = (void*)((intptr_t)(arena_next + size + 3) & ~3); arena_next = (void*)((intptr_t)(arena_next + size + 3) & ~3);
} else { } else {
/* Need to wrap */ /* Need to wrap */
arena_next = arena_start; arena_next = arena_start;
p = NULL; p = NULL;
} }
} else { } else {
/* Free space is somewhere else */ /* Free space is somewhere else */
if (((void*)first_undo - arena_next) >= size) { if (((void*)first_undo - arena_next) >= size) {
/* There is room before the "first" undo */ /* There is room before the "first" undo */
p = arena_next; p = arena_next;
arena_next = (void*)((intptr_t)(arena_next + size + 3) & ~3); arena_next = (void*)((intptr_t)(arena_next + size + 3) & ~3);
} else { } else {
/* Not enough room, just need to free some */ /* Not enough room, just need to free some */
p = NULL; p = NULL;
} }
} }
if (p == NULL) if (p == NULL)
free_undo (1); free_undo (1);
} while (!p && undo_count); } while (!p && undo_count);
if (p == NULL) if (p == NULL)
return -1; return -1;
GET_PC (p->pc) GET_PC (p->pc)
p->frame_count = frame_count; p->frame_count = frame_count;
p->diff_size = diff_size; p->diff_size = diff_size;
@ -960,11 +958,11 @@ int save_undo (void)
memcpy ((zbyte *)(p + 1) + diff_size, sp, stack_size * sizeof (*sp)); memcpy ((zbyte *)(p + 1) + diff_size, sp, stack_size * sizeof (*sp));
if (!first_undo) { if (!first_undo) {
p->prev = NULL; p->prev = NULL;
first_undo = p; first_undo = p;
} else { } else {
last_undo->next = p; last_undo->next = p;
p->prev = last_undo; p->prev = last_undo;
} }
p->next = NULL; p->next = NULL;
curr_undo = last_undo = p; curr_undo = last_undo = p;
@ -976,7 +974,7 @@ int save_undo (void)
/* /*
* z_save_undo, save the current Z-machine state for a future undo. * z_save_undo, save the current Z-machine state for a future undo.
* *
* no zargs used * no zargs used
* *
*/ */
@ -990,7 +988,7 @@ void z_save_undo (void)
/* /*
* z_verify, check the story file integrity. * z_verify, check the story file integrity.
* *
* no zargs used * no zargs used
* *
*/ */
@ -1004,7 +1002,7 @@ void z_verify (void)
fseek (story_fp, 64, SEEK_SET); fseek (story_fp, 64, SEEK_SET);
for (i = 64; i < story_size; i++) for (i = 64; i < story_size; i++)
checksum += fgetc (story_fp); checksum += fgetc (story_fp);
/* Branch if the checksums are equal */ /* Branch if the checksums are equal */

View File

@ -1675,7 +1675,6 @@ static void decodeGeneric(LodePNG_Decoder* decoder)
/* for unknown chunk order */ /* for unknown chunk order */
bool unknown = false; bool unknown = false;
uint8_t critical_pos = 1; /*1 = after IHDR, 2 = after PLTE, 3 = after IDAT*/
if (decoder->file_size == 0 || in == NULL) if (decoder->file_size == 0 || in == NULL)
{ {
@ -1739,7 +1738,6 @@ static void decodeGeneric(LodePNG_Decoder* decoder)
/* copy compressed data */ /* copy compressed data */
memcpy(idat+idat_size, data, chunkLength * sizeof(uint8_t)); memcpy(idat+idat_size, data, chunkLength * sizeof(uint8_t));
idat_size += chunkLength; idat_size += chunkLength;
critical_pos = 3;
} }
/*IEND chunk*/ /*IEND chunk*/
else if (LodePNG_chunk_type_equals(chunk, PNG_CHUNK_IEND)) else if (LodePNG_chunk_type_equals(chunk, PNG_CHUNK_IEND))
@ -1765,7 +1763,6 @@ static void decodeGeneric(LodePNG_Decoder* decoder)
decoder->infoPng.color.palette[(i<<2) | 2] = data[pos++]; /*B*/ decoder->infoPng.color.palette[(i<<2) | 2] = data[pos++]; /*B*/
decoder->infoPng.color.palette[(i<<2) | 3] = 255; /*alpha*/ decoder->infoPng.color.palette[(i<<2) | 3] = 255; /*alpha*/
} }
critical_pos = 2;
} }
/*palette transparency chunk (tRNS)*/ /*palette transparency chunk (tRNS)*/
else if (LodePNG_chunk_type_equals(chunk, PNG_CHUNK_tRNS)) else if (LodePNG_chunk_type_equals(chunk, PNG_CHUNK_tRNS))

View File

@ -465,7 +465,6 @@ static int parse_buffer(void)
static void write_output(int fd) static void write_output(int fd)
{ {
size_t bytes_written;
int i; int i;
size_t len, size; size_t len, size;
char *p = &buffer[HEADER_LEN]; /* reserve space for salt + hash */ char *p = &buffer[HEADER_LEN]; /* reserve space for salt + hash */
@ -498,7 +497,7 @@ static void write_output(int fd)
encrypt_buffer(&buffer[8], size, &key.words[0]); encrypt_buffer(&buffer[8], size, &key.words[0]);
rb->memcpy(&buffer[0], &salt, sizeof(salt)); rb->memcpy(&buffer[0], &salt, sizeof(salt));
bytes_written = rb->write(fd, &buffer, size); rb->write(fd, &buffer, size);
} }
static int enter_pw(char *pw_buf, size_t buflen, bool new_pw) static int enter_pw(char *pw_buf, size_t buflen, bool new_pw)

View File

@ -1193,7 +1193,6 @@ static void parse_id3v2(int fd)
int bytesread = 0; int bytesread = 0;
unsigned char global_flags; unsigned char global_flags;
int flags; int flags;
int skip;
bool global_unsynch = false; bool global_unsynch = false;
bool global_ff_found = false; bool global_ff_found = false;
bool unsynch = false; bool unsynch = false;
@ -1235,7 +1234,6 @@ static void parse_id3v2(int fd)
/* Skip the extended header if it is present */ /* Skip the extended header if it is present */
if(global_flags & 0x40) { if(global_flags & 0x40) {
skip = 0;
if(version == ID3_VER_2_3) { if(version == ID3_VER_2_3) {
if(10 != rb->read(fd, header, 10)) if(10 != rb->read(fd, header, 10))

View File

@ -871,8 +871,10 @@ int Read32BitsLowHigh(int fd)
int wave_open(void) int wave_open(void)
{ {
unsigned short wFormatTag; unsigned short wFormatTag;
/* rockbox: comment 'set but unused" variable
unsigned long dAvgBytesPerSec; unsigned long dAvgBytesPerSec;
unsigned short wBlockAlign; unsigned short wBlockAlign;
*/
unsigned short bits_per_samp; unsigned short bits_per_samp;
long header_size; long header_size;
@ -889,8 +891,8 @@ int wave_open(void)
cfg.channels = Read16BitsLowHigh(wavfile); cfg.channels = Read16BitsLowHigh(wavfile);
cfg.samplerate = Read32BitsLowHigh(wavfile); cfg.samplerate = Read32BitsLowHigh(wavfile);
dAvgBytesPerSec = Read32BitsLowHigh(wavfile); /*dAvgBytesPerSec*/ Read32BitsLowHigh(wavfile);
wBlockAlign = Read16BitsLowHigh(wavfile); /*wBlockAlign */ Read16BitsLowHigh(wavfile);
bits_per_samp = Read16BitsLowHigh(wavfile); bits_per_samp = Read16BitsLowHigh(wavfile);
if(wFormatTag != 0x0001) return -5; /* linear PCM required */ if(wFormatTag != 0x0001) return -5; /* linear PCM required */

View File

@ -982,7 +982,9 @@ static void record_data(void)
static void record_and_get_pitch(void) static void record_and_get_pitch(void)
{ {
int quit=0, button; int quit=0, button;
#ifndef SIMULATOR
bool redraw = true; bool redraw = true;
#endif
/* For tracking the latency */ /* For tracking the latency */
/* /*
long timer; long timer;
@ -1016,7 +1018,9 @@ static void record_and_get_pitch(void)
quit = main_menu(); quit = main_menu();
if(!quit) if(!quit)
{ {
#ifndef SIMULATOR
redraw = true; redraw = true;
#endif
record_data(); record_data();
} }
break; break;

View File

@ -153,10 +153,11 @@ void cleanup(void)
int main(void) int main(void)
{ {
plasma_frequency = 1; plasma_frequency = 1;
int action, delay, x, y; int action, x, y;
unsigned char p1,p2,p3,p4,t1,t2,t3,t4, z,z0; unsigned char p1,p2,p3,p4,t1,t2,t3,t4, z,z0;
long last_tick = *rb->current_tick; long last_tick = *rb->current_tick;
#ifdef HAVE_ADJUSTABLE_CPU_FREQ #ifdef HAVE_ADJUSTABLE_CPU_FREQ
int delay;
int cumulated_lag = 0; int cumulated_lag = 0;
#endif #endif
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
@ -243,8 +244,8 @@ int main(void)
grey_ub_gray_bitmap(greybuffer, 0, 0, LCD_WIDTH, LCD_HEIGHT); grey_ub_gray_bitmap(greybuffer, 0, 0, LCD_WIDTH, LCD_HEIGHT);
#endif #endif
delay = last_tick - *rb->current_tick + HZ/33;
#ifdef HAVE_ADJUSTABLE_CPU_FREQ #ifdef HAVE_ADJUSTABLE_CPU_FREQ
delay = last_tick - *rb->current_tick + HZ/33;
if (!boosted && delay < 0) if (!boosted && delay < 0)
{ {
cumulated_lag -= delay; /* proportional increase */ cumulated_lag -= delay; /* proportional increase */

View File

@ -1528,16 +1528,12 @@ static bool sokoban_loop(void)
{ {
bool moved; bool moved;
int i = 0, button = 0, lastbutton = 0; int i = 0, button = 0, lastbutton = 0;
short r = 0, c = 0;
int w, h; int w, h;
char *loc; char *loc;
while (true) { while (true) {
moved = false; moved = false;
r = current_info.player.row;
c = current_info.player.col;
button = rb->button_get(true); button = rb->button_get(true);
switch(button) switch(button)

View File

@ -947,10 +947,6 @@ static int star_run_game(int current_level)
int key; int key;
int lastkey = BUTTON_NONE; int lastkey = BUTTON_NONE;
int label_offset_y;
label_offset_y = LCD_HEIGHT - char_height;
if (!star_load_level(current_level)) if (!star_load_level(current_level))
return 0; return 0;

View File

@ -1,5 +1,7 @@
#include "zxconfig.h" #include "zxconfig.h"
//#define ZX_WRITE_OUT_TEXT
#ifndef O_BINARY #ifndef O_BINARY
#define O_BINARY 0 #define O_BINARY 0
#endif #endif
@ -274,8 +276,9 @@ int zx_kbd_input(char* text/*, int buflen*/)
bool done = false; bool done = false;
int i, j, k, w, l; int i, j, k, w, l;
int text_w = 0; int text_w = 0;
int len_utf8/*, c = 0*/; #ifdef ZX_WRITE_OUT_TEXT
int editpos; int editpos, len_utf8;
#endif
/* int statusbar_size = global_settings.statusbar ? STATUSBAR_HEIGHT : 0;*/ /* int statusbar_size = global_settings.statusbar ? STATUSBAR_HEIGHT : 0;*/
unsigned short ch/*, tmp, hlead = 0, hvowel = 0, htail = 0*/; unsigned short ch/*, tmp, hlead = 0, hvowel = 0, htail = 0*/;
/*bool hangul = false;*/ /*bool hangul = false;*/
@ -298,7 +301,7 @@ int zx_kbd_input(char* text/*, int buflen*/)
} }
char outline[256]; char outline[256];
int button, lastbutton = 0; int button;
FOR_NB_SCREENS(l) FOR_NB_SCREENS(l)
{ {
/* Copy default keyboard to buffer */ /* Copy default keyboard to buffer */
@ -419,13 +422,15 @@ int zx_kbd_input(char* text/*, int buflen*/)
param[l].keyboard_margin -= param[l].keyboard_margin/2; param[l].keyboard_margin -= param[l].keyboard_margin/2;
} }
#ifdef ZX_WRITE_OUT_TEXT
editpos = rb->utf8length(text); editpos = rb->utf8length(text);
#endif
while(!done) while(!done)
{ {
#ifdef ZX_WRITE_OUT_TEXT
len_utf8 = rb->utf8length(text); len_utf8 = rb->utf8length(text);
#endif
FOR_NB_SCREENS(l) FOR_NB_SCREENS(l)
rb->screens[l]->clear_display(); rb->screens[l]->clear_display();
@ -456,8 +461,8 @@ int zx_kbd_input(char* text/*, int buflen*/)
param[l].main_y - param[l].keyboard_margin); param[l].main_y - param[l].keyboard_margin);
/* write out the text */ /* write out the text */
#if 0 #ifdef ZX_WRITE_OUT_TEXT
rb->screens[l]->setfont(param[l].curfont); rb->screens[l]->setfont(param[l].curfont);
i=j=0; i=j=0;
param[l].curpos = MIN(editpos, param[l].max_chars_text param[l].curpos = MIN(editpos, param[l].max_chars_text
@ -493,7 +498,7 @@ int zx_kbd_input(char* text/*, int buflen*/)
rb->screens[l]->hline(param[l].curpos*text_w, (param[l].curpos+1)*text_w, rb->screens[l]->hline(param[l].curpos*text_w, (param[l].curpos+1)*text_w,
param[l].main_y+param[l].font_h-1); param[l].main_y+param[l].font_h-1);
#endif #endif
} }
cur_blink = !cur_blink; cur_blink = !cur_blink;
@ -626,7 +631,6 @@ int zx_kbd_input(char* text/*, int buflen*/)
} }
if (button != BUTTON_NONE) if (button != BUTTON_NONE)
{ {
lastbutton = button;
cur_blink = true; cur_blink = true;
} }
} }

View File

@ -474,7 +474,6 @@ static int skin_parse_tag(struct skin_element* element, const char** document)
int num_args = 1; int num_args = 1;
int i; int i;
int star = 0; /* Flag for the all-or-none option */ int star = 0; /* Flag for the all-or-none option */
int req_args; /* To mark when we enter optional arguments */
int optional = 0; int optional = 0;
tag_recursion_level++; tag_recursion_level++;
@ -597,7 +596,6 @@ static int skin_parse_tag(struct skin_element* element, const char** document)
if(*tag_args == '|') if(*tag_args == '|')
{ {
optional = 1; optional = 1;
req_args = i;
tag_args++; tag_args++;
} }
@ -775,7 +773,6 @@ static int skin_parse_tag(struct skin_element* element, const char** document)
if(*tag_args == '|') if(*tag_args == '|')
{ {
optional = 1; optional = 1;
req_args = i + 1;
tag_args++; tag_args++;
} }
} }