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.tar.gz
rockbox-ba03cb4aea212553f47a9da672fdd897e9f2e620.zip
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 6437c8d4fd..3bd9593e3a 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" ,
94int wt_command = COMMAND_NOP; 94int wt_command = COMMAND_NOP;
95 95
96/* ---- Get the board column and row (e2 f.e.) for a physical x y ---- */ 96/* ---- Get the board column and row (e2 f.e.) for a physical x y ---- */
97void xy2cr ( short x, short y, short *c, short *r ) { 97static void xy2cr ( short x, short y, short *c, short *r ) {
98 if (computer == black ) { 98 if (computer == black ) {
99 *c = x ; 99 *c = x ;
100 *r = y ; 100 *r = y ;
@@ -105,7 +105,7 @@ void xy2cr ( short x, short y, short *c, short *r ) {
105} 105}
106 106
107/* ---- get physical x y for a board column and row (e2 f.e.) ---- */ 107/* ---- get physical x y for a board column and row (e2 f.e.) ---- */
108void cr2xy ( short c, short r, short *x, short *y ) { 108static void cr2xy ( short c, short r, short *x, short *y ) {
109 if ( computer == black ) { 109 if ( computer == black ) {
110 *x = c ; 110 *x = c ;
111 *y = r ; 111 *y = r ;
@@ -174,7 +174,7 @@ static void cb_drawboard (void) {
174} 174}
175 175
176/* ---- Switch mark on board ---- */ 176/* ---- Switch mark on board ---- */
177void cb_switch ( short x , short y ) { 177static void cb_switch ( short x , short y ) {
178 rb->lcd_set_drawmode ( DRMODE_COMPLEMENT ); 178 rb->lcd_set_drawmode ( DRMODE_COMPLEMENT );
179 rb->lcd_drawrect ( XOFS + x*TILE_WIDTH + 1 , 179 rb->lcd_drawrect ( XOFS + x*TILE_WIDTH + 1 ,
180 YOFS + ( 7 - y )*TILE_HEIGHT +1 , 180 YOFS + ( 7 - y )*TILE_HEIGHT +1 ,
@@ -184,7 +184,7 @@ void cb_switch ( short x , short y ) {
184} 184}
185 185
186/* ---- callback for capturing interaction while thinking ---- */ 186/* ---- callback for capturing interaction while thinking ---- */
187void cb_wt_callback ( void ) { 187static void cb_wt_callback ( void ) {
188 int button = BUTTON_NONE; 188 int button = BUTTON_NONE;
189 189
190 wt_command = COMMAND_NOP; 190 wt_command = COMMAND_NOP;
@@ -208,7 +208,7 @@ void cb_wt_callback ( void ) {
208} 208}
209 209
210/* ---- set playing parameters depending on level ---- */ 210/* ---- set playing parameters depending on level ---- */
211void cb_setlevel ( int lev ) { 211static void cb_setlevel ( int lev ) {
212 Level = (lev > 7) ? 7 : ( (lev < 1) ? 1 : lev ) ; 212 Level = (lev > 7) ? 7 : ( (lev < 1) ? 1 : lev ) ;
213 switch (Level) { 213 switch (Level) {
214 case 1 : 214 case 1 :
@@ -257,7 +257,7 @@ void cb_setlevel ( int lev ) {
257} 257}
258 258
259/* ---- increase playing level ---- */ 259/* ---- increase playing level ---- */
260void cb_levelup ( void ) { 260static void cb_levelup ( void ) {
261 if ( Level == 7 ) 261 if ( Level == 7 )
262 cb_setlevel ( 1 ); 262 cb_setlevel ( 1 );
263 else 263 else
@@ -266,7 +266,7 @@ void cb_levelup ( void ) {
266}; 266};
267 267
268/* ---- Save current position ---- */ 268/* ---- Save current position ---- */
269void cb_saveposition ( void ) { 269static void cb_saveposition ( void ) {
270 int fd; 270 int fd;
271 short sq,i,c; 271 short sq,i,c;
272 unsigned short temp; 272 unsigned short temp;
@@ -319,7 +319,7 @@ void cb_saveposition ( void ) {
319} 319}
320 320
321/* ---- Restore saved position ---- */ 321/* ---- Restore saved position ---- */
322void cb_restoreposition ( void ) { 322static void cb_restoreposition ( void ) {
323 int fd; 323 int fd;
324 short sq; 324 short sq;
325 unsigned short m; 325 unsigned short m;
@@ -419,7 +419,7 @@ static int cb_menu_viewer(void)
419} 419}
420 420
421/* ---- get a command in game mode ---- */ 421/* ---- get a command in game mode ---- */
422struct cb_command cb_get_viewer_command (void) { 422static struct cb_command cb_get_viewer_command (void) {
423 int button; 423 int button;
424 struct cb_command result = { 0, {0,0,0,0,0}, 0 }; 424 struct cb_command result = { 0, {0,0,0,0,0}, 0 };
425 425
@@ -447,7 +447,7 @@ struct cb_command cb_get_viewer_command (void) {
447} 447}
448 448
449/* ---- viewer main loop ---- */ 449/* ---- viewer main loop ---- */
450void cb_start_viewer(char* filename){ 450static void cb_start_viewer(char* filename){
451 struct pgn_game_node *first_game, *selected_game; 451 struct pgn_game_node *first_game, *selected_game;
452 struct pgn_ply_node *curr_ply; 452 struct pgn_ply_node *curr_ply;
453 bool exit_game = false; 453 bool exit_game = false;
@@ -638,7 +638,7 @@ static int cb_menu(void)
638} 638}
639 639
640/* ---- get a command in game mode ---- */ 640/* ---- get a command in game mode ---- */
641struct cb_command cb_getcommand (void) { 641static struct cb_command cb_getcommand (void) {
642 static short x = 4 , y = 3 ; 642 static short x = 4 , y = 3 ;
643 short c , r , l; 643 short c , r , l;
644 int button; 644 int button;
@@ -773,7 +773,7 @@ struct cb_command cb_getcommand (void) {
773} 773}
774 774
775/* ---- game main loop ---- */ 775/* ---- game main loop ---- */
776void cb_play_game(void) { 776static void cb_play_game(void) {
777 struct cb_command command; 777 struct cb_command command;
778 struct pgn_game_node *game; 778 struct pgn_game_node *game;
779 char move_buffer[20]; 779 char move_buffer[20];
diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c
index 846ea41847..8b2cb1b2f2 100644
--- a/apps/plugins/chessbox/chessbox_pgn.c
+++ b/apps/plugins/chessbox/chessbox_pgn.c
@@ -37,7 +37,7 @@ size_t bufleft;
37/* simple function to "allocate" memory in pluginbuffer. 37/* simple function to "allocate" memory in pluginbuffer.
38 * (borrowed from dict.c) 38 * (borrowed from dict.c)
39 */ 39 */
40void *pl_malloc(size_t size) 40static void *pl_malloc(size_t size)
41{ 41{
42 void *ptr; 42 void *ptr;
43 ptr = bufptr; 43 ptr = bufptr;
@@ -55,12 +55,12 @@ void *pl_malloc(size_t size)
55} 55}
56 56
57/* init function for pl_malloc() */ 57/* init function for pl_malloc() */
58void pl_malloc_init(void) 58static void pl_malloc_init(void)
59{ 59{
60 bufptr = rb->plugin_get_buffer(&bufleft); 60 bufptr = rb->plugin_get_buffer(&bufleft);
61} 61}
62 62
63void process_tag(struct pgn_game_node* game, char* buffer){ 63static void process_tag(struct pgn_game_node* game, char* buffer){
64 char tag_type[20]; 64 char tag_type[20];
65 char tag_value[255]; 65 char tag_value[255];
66 short pos=0, pos2=0; 66 short pos=0, pos2=0;
@@ -95,7 +95,7 @@ void process_tag(struct pgn_game_node* game, char* buffer){
95 } 95 }
96} 96}
97 97
98unsigned short get_next_token(const char* line_buffer, unsigned short initial_pos, 98static unsigned short get_next_token(const char* line_buffer, unsigned short initial_pos,
99 char* token_buffer){ 99 char* token_buffer){
100 unsigned short pos, token_pos=0; 100 unsigned short pos, token_pos=0;
101 for (pos = initial_pos;line_buffer[pos] == ' ' || line_buffer[pos] == '.';pos++); 101 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
112 return pos; 112 return pos;
113} 113}
114 114
115unsigned short piece_from_pgn(char pgn_piece){ 115static unsigned short piece_from_pgn(char pgn_piece){
116 switch (pgn_piece){ 116 switch (pgn_piece){
117 case 'R': 117 case 'R':
118 return rook; 118 return rook;
@@ -128,7 +128,7 @@ unsigned short piece_from_pgn(char pgn_piece){
128 return no_piece; 128 return no_piece;
129} 129}
130 130
131char pgn_from_piece(unsigned short piece, unsigned short color){ 131static char pgn_from_piece(unsigned short piece, unsigned short color){
132 char pgn_piece = ' '; 132 char pgn_piece = ' ';
133 switch (piece){ 133 switch (piece){
134 case pawn: 134 case pawn:
@@ -159,7 +159,7 @@ char pgn_from_piece(unsigned short piece, unsigned short color){
159 return pgn_piece; 159 return pgn_piece;
160} 160}
161 161
162void pgn_to_coords(struct pgn_ply_node* ply){ 162static void pgn_to_coords(struct pgn_ply_node* ply){
163 unsigned short str_length = rb->strlen(ply->pgn_text); 163 unsigned short str_length = rb->strlen(ply->pgn_text);
164 char str[10]; 164 char str[10];
165 rb->strcpy(str,ply->pgn_text); 165 rb->strcpy(str,ply->pgn_text);
@@ -354,7 +354,7 @@ void pgn_to_coords(struct pgn_ply_node* ply){
354 color[locn[ply->row_from][ply->column_from]] = neutral; 354 color[locn[ply->row_from][ply->column_from]] = neutral;
355} 355}
356 356
357void coords_to_pgn(struct pgn_ply_node* ply){ 357static void coords_to_pgn(struct pgn_ply_node* ply){
358 int pos = 0,i,j; 358 int pos = 0,i,j;
359 unsigned short moving_piece = board[locn[ply->row_from][ply->column_from]]; 359 unsigned short moving_piece = board[locn[ply->row_from][ply->column_from]];
360 char unambiguous_position; 360 char unambiguous_position;
@@ -545,7 +545,7 @@ static const char* get_game_text(int selected_item, void *data,
545 return buffer; 545 return buffer;
546} 546}
547 547
548void write_pgn_token(int fhandler, char *buffer, size_t *line_length){ 548static void write_pgn_token(int fhandler, char *buffer, size_t *line_length){
549 if (*line_length + rb->strlen(buffer) + 1 > 80){ 549 if (*line_length + rb->strlen(buffer) + 1 > 80){
550 rb->fdprintf(fhandler,"\n"); 550 rb->fdprintf(fhandler,"\n");
551 *line_length = 0; 551 *line_length = 0;