diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/sudoku/generator.c | 5 | ||||
-rw-r--r-- | apps/plugins/sudoku/sudoku.c | 26 |
2 files changed, 17 insertions, 14 deletions
diff --git a/apps/plugins/sudoku/generator.c b/apps/plugins/sudoku/generator.c index ba74fa5b08..0388d34431 100644 --- a/apps/plugins/sudoku/generator.c +++ b/apps/plugins/sudoku/generator.c | |||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | #include "sudoku.h" | 35 | #include "sudoku.h" |
36 | #include "templates.h" | 36 | #include "templates.h" |
37 | #include "generator.h" | ||
37 | 38 | ||
38 | #define assert(x) | 39 | #define assert(x) |
39 | 40 | ||
@@ -618,6 +619,7 @@ allmoves( void ) | |||
618 | } | 619 | } |
619 | 620 | ||
620 | /* Helper: sort based on index */ | 621 | /* Helper: sort based on index */ |
622 | #if 0 /* unused function */ | ||
621 | static | 623 | static |
622 | int | 624 | int |
623 | cmpindex( const void * a, const void * b ) | 625 | cmpindex( const void * a, const void * b ) |
@@ -629,7 +631,7 @@ cmpindex( const void * a, const void * b ) | |||
629 | * 'easy' moves first, and if none are possible, then try for more | 631 | * 'easy' moves first, and if none are possible, then try for more |
630 | * cryptic moves. | 632 | * cryptic moves. |
631 | */ | 633 | */ |
632 | int | 634 | static int |
633 | findhints( void ) | 635 | findhints( void ) |
634 | { | 636 | { |
635 | int i, n, mutated = 0; | 637 | int i, n, mutated = 0; |
@@ -695,6 +697,7 @@ findhints( void ) | |||
695 | 697 | ||
696 | return n; | 698 | return n; |
697 | } | 699 | } |
700 | #endif /* unused function */ | ||
698 | 701 | ||
699 | /* Deterministic solver; return 0 on success, else -1 on error. | 702 | /* Deterministic solver; return 0 on success, else -1 on error. |
700 | */ | 703 | */ |
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c index 73c18708d2..d19b556352 100644 --- a/apps/plugins/sudoku/sudoku.c +++ b/apps/plugins/sudoku/sudoku.c | |||
@@ -284,7 +284,7 @@ static unsigned int cellypos[9]={ | |||
284 | #define BLOCK 3 | 284 | #define BLOCK 3 |
285 | #define SIZE (BLOCK*BLOCK) | 285 | #define SIZE (BLOCK*BLOCK) |
286 | 286 | ||
287 | void sudoku_solve(struct sudoku_state_t* state) | 287 | static void sudoku_solve(struct sudoku_state_t* state) |
288 | { | 288 | { |
289 | bool ret = sudoku_solve_board(state); | 289 | bool ret = sudoku_solve_board(state); |
290 | 290 | ||
@@ -317,7 +317,7 @@ static void restore_state(struct sudoku_state_t *state) | |||
317 | #endif | 317 | #endif |
318 | } | 318 | } |
319 | 319 | ||
320 | void default_state(struct sudoku_state_t* state) | 320 | static void default_state(struct sudoku_state_t* state) |
321 | { | 321 | { |
322 | int r,c; | 322 | int r,c; |
323 | 323 | ||
@@ -340,7 +340,7 @@ void default_state(struct sudoku_state_t* state) | |||
340 | state->editmode=0; | 340 | state->editmode=0; |
341 | } | 341 | } |
342 | 342 | ||
343 | void clear_state(struct sudoku_state_t* state) | 343 | static void clear_state(struct sudoku_state_t* state) |
344 | { | 344 | { |
345 | int r,c; | 345 | int r,c; |
346 | 346 | ||
@@ -361,7 +361,7 @@ void clear_state(struct sudoku_state_t* state) | |||
361 | } | 361 | } |
362 | 362 | ||
363 | /* Check the status of the board, assuming a change at the cursor location */ | 363 | /* Check the status of the board, assuming a change at the cursor location */ |
364 | bool check_status(struct sudoku_state_t* state) | 364 | static bool check_status(struct sudoku_state_t* state) |
365 | { | 365 | { |
366 | int check[9]; | 366 | int check[9]; |
367 | int r,c; | 367 | int r,c; |
@@ -422,7 +422,7 @@ bool check_status(struct sudoku_state_t* state) | |||
422 | /* Load game - only ".ss" is officially supported, but any sensible | 422 | /* Load game - only ".ss" is officially supported, but any sensible |
423 | text representation (one line per row) may load. | 423 | text representation (one line per row) may load. |
424 | */ | 424 | */ |
425 | bool load_sudoku(struct sudoku_state_t* state, char* filename) | 425 | static bool load_sudoku(struct sudoku_state_t* state, char* filename) |
426 | { | 426 | { |
427 | int fd; | 427 | int fd; |
428 | size_t n; | 428 | size_t n; |
@@ -520,7 +520,7 @@ bool load_sudoku(struct sudoku_state_t* state, char* filename) | |||
520 | return(true); | 520 | return(true); |
521 | } | 521 | } |
522 | 522 | ||
523 | bool save_sudoku(struct sudoku_state_t* state) | 523 | static bool save_sudoku(struct sudoku_state_t* state) |
524 | { | 524 | { |
525 | int fd; | 525 | int fd; |
526 | int r,c; | 526 | int r,c; |
@@ -583,7 +583,7 @@ bool save_sudoku(struct sudoku_state_t* state) | |||
583 | } | 583 | } |
584 | } | 584 | } |
585 | 585 | ||
586 | void clear_board(struct sudoku_state_t* state) | 586 | static void clear_board(struct sudoku_state_t* state) |
587 | { | 587 | { |
588 | int r,c; | 588 | int r,c; |
589 | 589 | ||
@@ -596,7 +596,7 @@ void clear_board(struct sudoku_state_t* state) | |||
596 | state->y=0; | 596 | state->y=0; |
597 | } | 597 | } |
598 | 598 | ||
599 | void update_cell(struct sudoku_state_t* state, int r, int c) | 599 | static void update_cell(struct sudoku_state_t* state, int r, int c) |
600 | { | 600 | { |
601 | /* We have four types of cell: | 601 | /* We have four types of cell: |
602 | 1) User-entered number | 602 | 1) User-entered number |
@@ -630,7 +630,7 @@ void update_cell(struct sudoku_state_t* state, int r, int c) | |||
630 | } | 630 | } |
631 | 631 | ||
632 | 632 | ||
633 | void display_board(struct sudoku_state_t* state) | 633 | static void display_board(struct sudoku_state_t* state) |
634 | { | 634 | { |
635 | int r,c; | 635 | int r,c; |
636 | #ifdef SUDOKU_BUTTON_POSSIBLE | 636 | #ifdef SUDOKU_BUTTON_POSSIBLE |
@@ -823,7 +823,7 @@ void display_board(struct sudoku_state_t* state) | |||
823 | rb->lcd_update(); | 823 | rb->lcd_update(); |
824 | } | 824 | } |
825 | 825 | ||
826 | bool sudoku_generate(struct sudoku_state_t* state) | 826 | static bool sudoku_generate(struct sudoku_state_t* state) |
827 | { | 827 | { |
828 | char* difficulty; | 828 | char* difficulty; |
829 | char str[80]; | 829 | char str[80]; |
@@ -902,7 +902,7 @@ enum { | |||
902 | SM_QUIT, | 902 | SM_QUIT, |
903 | }; | 903 | }; |
904 | 904 | ||
905 | int sudoku_menu(struct sudoku_state_t* state) | 905 | static int sudoku_menu(struct sudoku_state_t* state) |
906 | { | 906 | { |
907 | int result; | 907 | int result; |
908 | 908 | ||
@@ -972,7 +972,7 @@ int sudoku_menu(struct sudoku_state_t* state) | |||
972 | } | 972 | } |
973 | 973 | ||
974 | /* Menu used when user is in edit mode - i.e. creating a new game manually */ | 974 | /* Menu used when user is in edit mode - i.e. creating a new game manually */ |
975 | int sudoku_edit_menu(struct sudoku_state_t* state) | 975 | static int sudoku_edit_menu(struct sudoku_state_t* state) |
976 | { | 976 | { |
977 | int result; | 977 | int result; |
978 | 978 | ||
@@ -1001,7 +1001,7 @@ int sudoku_edit_menu(struct sudoku_state_t* state) | |||
1001 | return result; | 1001 | return result; |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | void move_cursor(struct sudoku_state_t* state, int newx, int newy) | 1004 | static void move_cursor(struct sudoku_state_t* state, int newx, int newy) |
1005 | { | 1005 | { |
1006 | int oldx, oldy; | 1006 | int oldx, oldy; |
1007 | 1007 | ||