1
0
Fork 0
forked from len0rd/rockbox

Make local functions static in clock and chessbox plugin

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31505 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2011-12-31 20:29:08 +00:00
parent c003d6c332
commit ba03cb4aea
9 changed files with 54 additions and 53 deletions

View file

@ -94,7 +94,7 @@ const char *level_string[] = { "Level 1: 60 moves / 5 min" ,
int wt_command = COMMAND_NOP;
/* ---- Get the board column and row (e2 f.e.) for a physical x y ---- */
void xy2cr ( short x, short y, short *c, short *r ) {
static void xy2cr ( short x, short y, short *c, short *r ) {
if (computer == black ) {
*c = x ;
*r = y ;
@ -105,7 +105,7 @@ void xy2cr ( short x, short y, short *c, short *r ) {
}
/* ---- get physical x y for a board column and row (e2 f.e.) ---- */
void cr2xy ( short c, short r, short *x, short *y ) {
static void cr2xy ( short c, short r, short *x, short *y ) {
if ( computer == black ) {
*x = c ;
*y = r ;
@ -174,7 +174,7 @@ static void cb_drawboard (void) {
}
/* ---- Switch mark on board ---- */
void cb_switch ( short x , short y ) {
static void cb_switch ( short x , short y ) {
rb->lcd_set_drawmode ( DRMODE_COMPLEMENT );
rb->lcd_drawrect ( XOFS + x*TILE_WIDTH + 1 ,
YOFS + ( 7 - y )*TILE_HEIGHT +1 ,
@ -184,7 +184,7 @@ void cb_switch ( short x , short y ) {
}
/* ---- callback for capturing interaction while thinking ---- */
void cb_wt_callback ( void ) {
static void cb_wt_callback ( void ) {
int button = BUTTON_NONE;
wt_command = COMMAND_NOP;
@ -208,7 +208,7 @@ void cb_wt_callback ( void ) {
}
/* ---- set playing parameters depending on level ---- */
void cb_setlevel ( int lev ) {
static void cb_setlevel ( int lev ) {
Level = (lev > 7) ? 7 : ( (lev < 1) ? 1 : lev ) ;
switch (Level) {
case 1 :
@ -257,7 +257,7 @@ void cb_setlevel ( int lev ) {
}
/* ---- increase playing level ---- */
void cb_levelup ( void ) {
static void cb_levelup ( void ) {
if ( Level == 7 )
cb_setlevel ( 1 );
else
@ -266,7 +266,7 @@ void cb_levelup ( void ) {
};
/* ---- Save current position ---- */
void cb_saveposition ( void ) {
static void cb_saveposition ( void ) {
int fd;
short sq,i,c;
unsigned short temp;
@ -319,7 +319,7 @@ void cb_saveposition ( void ) {
}
/* ---- Restore saved position ---- */
void cb_restoreposition ( void ) {
static void cb_restoreposition ( void ) {
int fd;
short sq;
unsigned short m;
@ -419,7 +419,7 @@ static int cb_menu_viewer(void)
}
/* ---- get a command in game mode ---- */
struct cb_command cb_get_viewer_command (void) {
static struct cb_command cb_get_viewer_command (void) {
int button;
struct cb_command result = { 0, {0,0,0,0,0}, 0 };
@ -447,7 +447,7 @@ struct cb_command cb_get_viewer_command (void) {
}
/* ---- viewer main loop ---- */
void cb_start_viewer(char* filename){
static void cb_start_viewer(char* filename){
struct pgn_game_node *first_game, *selected_game;
struct pgn_ply_node *curr_ply;
bool exit_game = false;
@ -638,7 +638,7 @@ static int cb_menu(void)
}
/* ---- get a command in game mode ---- */
struct cb_command cb_getcommand (void) {
static struct cb_command cb_getcommand (void) {
static short x = 4 , y = 3 ;
short c , r , l;
int button;
@ -773,7 +773,7 @@ struct cb_command cb_getcommand (void) {
}
/* ---- game main loop ---- */
void cb_play_game(void) {
static void cb_play_game(void) {
struct cb_command command;
struct pgn_game_node *game;
char move_buffer[20];

View file

@ -37,7 +37,7 @@ size_t bufleft;
/* simple function to "allocate" memory in pluginbuffer.
* (borrowed from dict.c)
*/
void *pl_malloc(size_t size)
static void *pl_malloc(size_t size)
{
void *ptr;
ptr = bufptr;
@ -55,12 +55,12 @@ void *pl_malloc(size_t size)
}
/* init function for pl_malloc() */
void pl_malloc_init(void)
static void pl_malloc_init(void)
{
bufptr = rb->plugin_get_buffer(&bufleft);
}
void process_tag(struct pgn_game_node* game, char* buffer){
static void process_tag(struct pgn_game_node* game, char* buffer){
char tag_type[20];
char tag_value[255];
short pos=0, pos2=0;
@ -95,7 +95,7 @@ void process_tag(struct pgn_game_node* game, char* buffer){
}
}
unsigned short get_next_token(const char* line_buffer, unsigned short initial_pos,
static unsigned short get_next_token(const char* line_buffer, unsigned short initial_pos,
char* token_buffer){
unsigned short pos, token_pos=0;
for (pos = initial_pos;line_buffer[pos] == ' ' || line_buffer[pos] == '.';pos++);
@ -112,7 +112,7 @@ unsigned short get_next_token(const char* line_buffer, unsigned short initial_po
return pos;
}
unsigned short piece_from_pgn(char pgn_piece){
static unsigned short piece_from_pgn(char pgn_piece){
switch (pgn_piece){
case 'R':
return rook;
@ -128,7 +128,7 @@ unsigned short piece_from_pgn(char pgn_piece){
return no_piece;
}
char pgn_from_piece(unsigned short piece, unsigned short color){
static char pgn_from_piece(unsigned short piece, unsigned short color){
char pgn_piece = ' ';
switch (piece){
case pawn:
@ -159,7 +159,7 @@ char pgn_from_piece(unsigned short piece, unsigned short color){
return pgn_piece;
}
void pgn_to_coords(struct pgn_ply_node* ply){
static void pgn_to_coords(struct pgn_ply_node* ply){
unsigned short str_length = rb->strlen(ply->pgn_text);
char str[10];
rb->strcpy(str,ply->pgn_text);
@ -354,7 +354,7 @@ void pgn_to_coords(struct pgn_ply_node* ply){
color[locn[ply->row_from][ply->column_from]] = neutral;
}
void coords_to_pgn(struct pgn_ply_node* ply){
static void coords_to_pgn(struct pgn_ply_node* ply){
int pos = 0,i,j;
unsigned short moving_piece = board[locn[ply->row_from][ply->column_from]];
char unambiguous_position;
@ -545,7 +545,7 @@ static const char* get_game_text(int selected_item, void *data,
return buffer;
}
void write_pgn_token(int fhandler, char *buffer, size_t *line_length){
static void write_pgn_token(int fhandler, char *buffer, size_t *line_length){
if (*line_length + rb->strlen(buffer) + 1 > 80){
rb->fdprintf(fhandler,"\n");
*line_length = 0;