forked from len0rd/rockbox
numerous gcc4 (un)signed warnings killed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8121 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1e4d1f8de7
commit
72f423570f
8 changed files with 47 additions and 45 deletions
|
|
@ -325,7 +325,7 @@ static int scrollit(void)
|
|||
#if LCD_DEPTH > 1
|
||||
rb->lcd_set_foreground(face_colors[ letter % 3] );
|
||||
#endif
|
||||
rb->lcd_mono_bitmap((char *)char_gen_12x16[letter-0x20],
|
||||
rb->lcd_mono_bitmap(char_gen_12x16[letter-0x20],
|
||||
xx, table[yy&(TABLE_SIZE-1)], 11, 16);
|
||||
yy += YADD;
|
||||
xx+= DRAW_WIDTH/LETTERS_ON_SCREEN;
|
||||
|
|
@ -407,13 +407,13 @@ static int loopit(void)
|
|||
}
|
||||
rb->snprintf(buffer, 30, "%s: %d",
|
||||
values[show].what, values[show].num);
|
||||
rb->lcd_putsxy(0, LCD_HEIGHT - 8, buffer);
|
||||
rb->lcd_putsxy(0, LCD_HEIGHT - 8, (unsigned char *)buffer);
|
||||
timeout--;
|
||||
}
|
||||
for(i=0, yy=y, xx=x;
|
||||
i<rocklen;
|
||||
i++, yy+=values[NUM_YDIST].num, xx+=values[NUM_XDIST].num)
|
||||
rb->lcd_mono_bitmap((char *)char_gen_12x16[rock[i]-0x20],
|
||||
rb->lcd_mono_bitmap(char_gen_12x16[rock[i]-0x20],
|
||||
xtable[xx&(TABLE_SIZE-1)],
|
||||
table[yy&(TABLE_SIZE-1)], 11, 16);
|
||||
rb->lcd_update();
|
||||
|
|
@ -436,7 +436,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
|
||||
len = rb->strlen(SS_TITLE);
|
||||
rb->lcd_setfont(FONT_SYSFIXED);
|
||||
rb->lcd_getstringsize(SS_TITLE,&w, &h);
|
||||
rb->lcd_getstringsize((unsigned char *)SS_TITLE, &w, &h);
|
||||
|
||||
/* Get horizontel centering for text */
|
||||
len *= w;
|
||||
|
|
@ -451,10 +451,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
h /= 2;
|
||||
|
||||
rb->lcd_clear_display();
|
||||
rb->lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SS_TITLE);
|
||||
rb->lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, (unsigned char *)SS_TITLE);
|
||||
|
||||
len = 1;
|
||||
rb->lcd_getstringsize(off, &w, &h);
|
||||
rb->lcd_getstringsize((unsigned char *)off, &w, &h);
|
||||
|
||||
/* Get horizontel centering for text */
|
||||
len *= w;
|
||||
|
|
@ -468,7 +468,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
else
|
||||
h /= 2;
|
||||
|
||||
rb->lcd_putsxy(LCD_WIDTH/2-len, LCD_HEIGHT-(2*h), off);
|
||||
rb->lcd_putsxy(LCD_WIDTH/2-len, LCD_HEIGHT-(2*h), (unsigned char *)off);
|
||||
rb->lcd_update();
|
||||
rb->sleep(HZ);
|
||||
rb->lcd_set_drawmode(DRMODE_FG);
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ static int chessclock_set_int(char* string,
|
|||
#define FLAGS_SET_INT_SECONDS 1
|
||||
|
||||
static char * show_time(int secs);
|
||||
static int simple_menu(int nr, char **strarr);
|
||||
static int simple_menu(int nr, unsigned char **strarr);
|
||||
|
||||
static bool pause;
|
||||
|
||||
|
|
@ -215,7 +215,7 @@ static void show_pause_mode(bool enabled)
|
|||
static const char pause_icon[] = {0x00,0x7f,0x7f,0x00,0x7f,0x7f,0x00};
|
||||
|
||||
if (enabled)
|
||||
rb->lcd_mono_bitmap(pause_icon, 52, 0, 7, 8);
|
||||
rb->lcd_mono_bitmap((unsigned char *)pause_icon, 52, 0, 7, 8);
|
||||
else
|
||||
{
|
||||
rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
|
||||
|
|
@ -253,7 +253,7 @@ static int run_timer(int nr)
|
|||
round_time=true;
|
||||
}
|
||||
rb->snprintf(player_info, sizeof(player_info), "Player %d", nr+1);
|
||||
rb->lcd_puts(0, FIRST_LINE, player_info);
|
||||
rb->lcd_puts(0, FIRST_LINE, (unsigned char *)player_info);
|
||||
last_tick=*rb->current_tick;
|
||||
|
||||
while (!done) {
|
||||
|
|
@ -261,9 +261,9 @@ static int run_timer(int nr)
|
|||
long now;
|
||||
if (ticks>max_ticks) {
|
||||
if (round_time)
|
||||
rb->lcd_puts(0, FIRST_LINE+1, "ROUND UP!");
|
||||
rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)"ROUND UP!");
|
||||
else
|
||||
rb->lcd_puts(0, FIRST_LINE+1, "TIME OUT!");
|
||||
rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)"TIME OUT!");
|
||||
rb->backlight_on();
|
||||
} else {
|
||||
/*
|
||||
|
|
@ -273,7 +273,7 @@ static int run_timer(int nr)
|
|||
rb->lcd_puts(0, FIRST_LINE, player_info);
|
||||
}
|
||||
*/
|
||||
rb->lcd_puts(0, FIRST_LINE, player_info);
|
||||
rb->lcd_puts(0, FIRST_LINE, (unsigned char *)player_info);
|
||||
now=*rb->current_tick;
|
||||
if (!pause) {
|
||||
ticks+=now-last_tick;
|
||||
|
|
@ -291,9 +291,10 @@ static int run_timer(int nr)
|
|||
show_time((timer_holder[nr].total_time*HZ-
|
||||
timer_holder[nr].used_time-
|
||||
ticks+HZ-1)/HZ));
|
||||
rb->lcd_puts(0, FIRST_LINE+1, buf);
|
||||
rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)buf);
|
||||
} else {
|
||||
rb->lcd_puts(0, FIRST_LINE+1, show_time((max_ticks-ticks+HZ-1)/HZ));
|
||||
rb->lcd_puts(0, FIRST_LINE+1,
|
||||
(unsigned char *)show_time((max_ticks-ticks+HZ-1)/HZ));
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
|
@ -326,7 +327,7 @@ static int run_timer(int nr)
|
|||
int ret;
|
||||
char *menu[]={"Delete player", "Restart round",
|
||||
"Set round time", "Set total time"};
|
||||
ret=simple_menu(4, menu);
|
||||
ret=simple_menu(4, (unsigned char **)menu);
|
||||
if (ret==-1) {
|
||||
retval = 3;
|
||||
done=true;
|
||||
|
|
@ -401,17 +402,17 @@ static int run_timer(int nr)
|
|||
}
|
||||
|
||||
static int chessclock_set_int(char* string,
|
||||
int* variable,
|
||||
int step,
|
||||
int min,
|
||||
int max,
|
||||
int flags)
|
||||
int* variable,
|
||||
int step,
|
||||
int min,
|
||||
int max,
|
||||
int flags)
|
||||
{
|
||||
bool done = false;
|
||||
int button;
|
||||
|
||||
rb->lcd_clear_display();
|
||||
rb->lcd_puts_scroll(0, FIRST_LINE, string);
|
||||
rb->lcd_puts_scroll(0, FIRST_LINE, (unsigned char *)string);
|
||||
|
||||
while (!done) {
|
||||
char str[32];
|
||||
|
|
@ -419,7 +420,7 @@ static int chessclock_set_int(char* string,
|
|||
rb->snprintf(str, sizeof str,"%s (m:s)", show_time(*variable));
|
||||
else
|
||||
rb->snprintf(str, sizeof str,"%d", *variable);
|
||||
rb->lcd_puts(0, FIRST_LINE+1, str);
|
||||
rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)str);
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
rb->lcd_update();
|
||||
#endif
|
||||
|
|
@ -477,7 +478,7 @@ static char * show_time(int seconds)
|
|||
/* -1 = USB
|
||||
-2 = cancel
|
||||
*/
|
||||
static int simple_menu(int nr, char **strarr)
|
||||
static int simple_menu(int nr, unsigned char **strarr)
|
||||
{
|
||||
int show=0;
|
||||
int button;
|
||||
|
|
|
|||
|
|
@ -132,18 +132,19 @@ void roll_credits(void)
|
|||
|
||||
rb->lcd_setfont(FONT_UI);
|
||||
|
||||
rb->lcd_getstringsize("A", &width, &height);
|
||||
rb->lcd_getstringsize((unsigned char *)"A", &width, &height);
|
||||
|
||||
while(1) {
|
||||
rb->lcd_clear_display();
|
||||
for ( i=0; i <= (LCD_HEIGHT-y)/height; i++ )
|
||||
rb->lcd_putsxy(0, i*height+y, line+i<numnames?credits[line+i]:"");
|
||||
rb->lcd_putsxy(0, i*height+y,
|
||||
(unsigned char *)(line+i<numnames?credits[line+i]:""));
|
||||
rb->snprintf(buffer, sizeof(buffer), " [Credits] %2d/%2d ",
|
||||
line+1, numnames);
|
||||
rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
|
||||
rb->lcd_fillrect(0, 0, LCD_WIDTH, height);
|
||||
rb->lcd_set_drawmode(DRMODE_SOLID);
|
||||
rb->lcd_putsxy(0, 0, buffer);
|
||||
rb->lcd_putsxy(0, 0, (unsigned char *)buffer);
|
||||
rb->lcd_update();
|
||||
|
||||
if (rb->button_get_w_tmo(HZ/20) & BUTTON_REL)
|
||||
|
|
|
|||
|
|
@ -301,8 +301,8 @@ void showscore(struct pong *p)
|
|||
int w;
|
||||
|
||||
rb->snprintf(buffer, sizeof(buffer), "%d - %d", p->score[0], p->score[1]);
|
||||
w = rb->lcd_getstringsize(buffer, NULL, NULL);
|
||||
rb->lcd_putsxy( (LCD_WIDTH / 2) - (w / 2), 0, buffer);
|
||||
w = rb->lcd_getstringsize((unsigned char *)buffer, NULL, NULL);
|
||||
rb->lcd_putsxy( (LCD_WIDTH / 2) - (w / 2), 0, (unsigned char *)buffer);
|
||||
}
|
||||
|
||||
/* this is the plugin entry point */
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ void doevents()
|
|||
|
||||
/* convenience macro for printing loading state */
|
||||
#define PUTS(str) do { \
|
||||
rb->lcd_putsxy(1, y, str); \
|
||||
rb->lcd_getstringsize(str, &w, &h); \
|
||||
rb->lcd_putsxy(1, y, (unsigned char *)str); \
|
||||
rb->lcd_getstringsize((unsigned char *)str, &w, &h); \
|
||||
y += h + 1; \
|
||||
} while (0)
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
}
|
||||
|
||||
audio_bufferbase = audio_bufferpointer
|
||||
= rb->plugin_get_audio_buffer(&audio_buffer_free);
|
||||
= rb->plugin_get_audio_buffer((int *)&audio_buffer_free);
|
||||
#if MEM <= 8 && !defined(SIMULATOR)
|
||||
/* loaded as an overlay, protect from overwriting ourselves */
|
||||
if ((unsigned)(ovl_start_addr - (unsigned char *)audio_bufferbase)
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ static void draw_spot(int p, int x, int y)
|
|||
rb->lcd_fillrect(x+1, y+1, 14, 14);
|
||||
rb->lcd_set_drawmode(DRMODE_SOLID);
|
||||
rb->snprintf(s, sizeof(s), "%d", p);
|
||||
rb->lcd_putsxy(x+2, y+4, s);
|
||||
rb->lcd_putsxy(x+2, y+4, (unsigned char *)s);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -178,7 +178,7 @@ static void move_spot(int x, int y)
|
|||
hole -= (x+5*y);
|
||||
moves++;
|
||||
rb->snprintf(s, sizeof(s), "%d", moves);
|
||||
rb->lcd_putsxy(85, 20, s);
|
||||
rb->lcd_putsxy(85, 20, (unsigned char *)s);
|
||||
|
||||
for (i=4; i<=16; i+=4) {
|
||||
draw_spot(20, (hole%5)*16, (hole/5)*16);
|
||||
|
|
@ -195,9 +195,9 @@ static void puzzle_init(void)
|
|||
moves = 0;
|
||||
rb->lcd_clear_display();
|
||||
rb->lcd_drawrect(80, 0, 32, 64);
|
||||
rb->lcd_putsxy(81, 10, "Moves");
|
||||
rb->lcd_putsxy(81, 10, (unsigned char *)"Moves");
|
||||
rb->snprintf(s, sizeof(s), "%d", moves);
|
||||
rb->lcd_putsxy(85, 20, s);
|
||||
rb->lcd_putsxy(85, 20, (unsigned char *)s);
|
||||
|
||||
/* shuffle spots */
|
||||
for (i=19; i>=0; i--) {
|
||||
|
|
@ -324,11 +324,11 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
rb = api;
|
||||
|
||||
/* print title */
|
||||
rb->lcd_getstringsize("Sliding Puzzle", &w, &h);
|
||||
rb->lcd_getstringsize((unsigned char *)"Sliding Puzzle", &w, &h);
|
||||
w = (w+1)/2;
|
||||
h = (h+1)/2;
|
||||
rb->lcd_clear_display();
|
||||
rb->lcd_putsxy(LCD_WIDTH/2-w, (LCD_HEIGHT/2)-h, "Sliding Puzzle");
|
||||
rb->lcd_putsxy(LCD_WIDTH/2-w, (LCD_HEIGHT/2)-h, (unsigned char *)"Sliding Puzzle");
|
||||
rb->lcd_update();
|
||||
rb->sleep(HZ);
|
||||
|
||||
|
|
@ -349,7 +349,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
|
||||
rb->lcd_clear_display();
|
||||
rb->lcd_drawrect(80, 0, 32, 64);
|
||||
rb->lcd_putsxy(81, 10, "Moves");
|
||||
rb->lcd_putsxy(81, 10, (unsigned char *)"Moves");
|
||||
for (i=0; i<20; i++) {
|
||||
spots[i]=(i+1);
|
||||
draw_spot(spots[i], (i%5)*16, (i/5)*16);
|
||||
|
|
|
|||
|
|
@ -76,16 +76,16 @@ static void wvupdate (long start_tick,
|
|||
(bytes_read/2)) / bytes_read);
|
||||
|
||||
rb->snprintf(buf, 32, "elapsed time: %d secs", (elapsed_ticks + (HZ/2)) / HZ);
|
||||
rb->lcd_puts(0, 2, buf);
|
||||
rb->lcd_puts(0, 2, (unsigned char *)buf);
|
||||
|
||||
rb->snprintf(buf, 32, "progress: %d%%", progress);
|
||||
rb->lcd_puts(0, 4, buf);
|
||||
rb->lcd_puts(0, 4, (unsigned char *)buf);
|
||||
|
||||
rb->snprintf(buf, 32, "realtime: %d%% ", realtime);
|
||||
rb->lcd_puts(0, 6, buf);
|
||||
rb->lcd_puts(0, 6, (unsigned char *)buf);
|
||||
|
||||
rb->snprintf(buf, 32, "compression: %d%% ", compression);
|
||||
rb->lcd_puts(0, 8, buf);
|
||||
rb->lcd_puts(0, 8, (unsigned char *)buf);
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
rb->lcd_update();
|
||||
|
|
@ -102,14 +102,14 @@ static int wav2wv (char *filename)
|
|||
unsigned long total_bytes_read = 0, total_bytes_written = 0;
|
||||
unsigned long total_samples, samples_remaining;
|
||||
long *input_buffer = (long *) audiobuf;
|
||||
unsigned char *output_buffer = audiobuf + 0x100000;
|
||||
unsigned char *output_buffer = (unsigned char *)(audiobuf + 0x100000);
|
||||
char *extension, save_a;
|
||||
WavpackConfig config;
|
||||
WavpackContext *wpc;
|
||||
long start_tick;
|
||||
|
||||
rb->lcd_clear_display();
|
||||
rb->lcd_puts_scroll(0, 0, filename);
|
||||
rb->lcd_puts_scroll(0, 0, (unsigned char *)filename);
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
rb->lcd_update();
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue