summaryrefslogtreecommitdiff
path: root/apps/plugins/chessbox
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-12-31 20:29:08 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-12-31 20:29:08 +0000
commitba03cb4aea212553f47a9da672fdd897e9f2e620 (patch)
tree27a03c72fa0a4416ad32c338947234f46aa7d296 /apps/plugins/chessbox
parentc003d6c3328a59d071c2497b72b3e926be086530 (diff)
downloadrockbox-ba03cb4aea212553f47a9da672fdd897e9f2e620.zip
rockbox-ba03cb4aea212553f47a9da672fdd897e9f2e620.tar.gz
rockbox-ba03cb4aea212553f47a9da672fdd897e9f2e620.tar.bz2
rockbox-ba03cb4aea212553f47a9da672fdd897e9f2e620.tar.xz
Make local functions static in clock and chessbox plugin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31505 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/chessbox')
-rw-r--r--apps/plugins/chessbox/chessbox.c24
-rw-r--r--apps/plugins/chessbox/chessbox_pgn.c18
2 files changed, 21 insertions, 21 deletions
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index 6437c8d..3bd9593 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -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];
diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c
index 846ea41..8b2cb1b 100644
--- a/apps/plugins/chessbox/chessbox_pgn.c
+++ b/apps/plugins/chessbox/chessbox_pgn.c
@@ -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;