forked from len0rd/rockbox
sudoku: make local functions static and add missing #include
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31631 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
92ef9b260a
commit
02a270ce2e
2 changed files with 17 additions and 14 deletions
|
@ -34,6 +34,7 @@
|
||||||
|
|
||||||
#include "sudoku.h"
|
#include "sudoku.h"
|
||||||
#include "templates.h"
|
#include "templates.h"
|
||||||
|
#include "generator.h"
|
||||||
|
|
||||||
#define assert(x)
|
#define assert(x)
|
||||||
|
|
||||||
|
@ -618,6 +619,7 @@ allmoves( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Helper: sort based on index */
|
/* Helper: sort based on index */
|
||||||
|
#if 0 /* unused function */
|
||||||
static
|
static
|
||||||
int
|
int
|
||||||
cmpindex( const void * a, const void * b )
|
cmpindex( const void * a, const void * b )
|
||||||
|
@ -629,7 +631,7 @@ cmpindex( const void * a, const void * b )
|
||||||
* 'easy' moves first, and if none are possible, then try for more
|
* 'easy' moves first, and if none are possible, then try for more
|
||||||
* cryptic moves.
|
* cryptic moves.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
findhints( void )
|
findhints( void )
|
||||||
{
|
{
|
||||||
int i, n, mutated = 0;
|
int i, n, mutated = 0;
|
||||||
|
@ -695,6 +697,7 @@ findhints( void )
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
#endif /* unused function */
|
||||||
|
|
||||||
/* Deterministic solver; return 0 on success, else -1 on error.
|
/* Deterministic solver; return 0 on success, else -1 on error.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -284,7 +284,7 @@ static unsigned int cellypos[9]={
|
||||||
#define BLOCK 3
|
#define BLOCK 3
|
||||||
#define SIZE (BLOCK*BLOCK)
|
#define SIZE (BLOCK*BLOCK)
|
||||||
|
|
||||||
void sudoku_solve(struct sudoku_state_t* state)
|
static void sudoku_solve(struct sudoku_state_t* state)
|
||||||
{
|
{
|
||||||
bool ret = sudoku_solve_board(state);
|
bool ret = sudoku_solve_board(state);
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ static void restore_state(struct sudoku_state_t *state)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void default_state(struct sudoku_state_t* state)
|
static void default_state(struct sudoku_state_t* state)
|
||||||
{
|
{
|
||||||
int r,c;
|
int r,c;
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ void default_state(struct sudoku_state_t* state)
|
||||||
state->editmode=0;
|
state->editmode=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_state(struct sudoku_state_t* state)
|
static void clear_state(struct sudoku_state_t* state)
|
||||||
{
|
{
|
||||||
int r,c;
|
int r,c;
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ void clear_state(struct sudoku_state_t* state)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check the status of the board, assuming a change at the cursor location */
|
/* Check the status of the board, assuming a change at the cursor location */
|
||||||
bool check_status(struct sudoku_state_t* state)
|
static bool check_status(struct sudoku_state_t* state)
|
||||||
{
|
{
|
||||||
int check[9];
|
int check[9];
|
||||||
int r,c;
|
int r,c;
|
||||||
|
@ -422,7 +422,7 @@ bool check_status(struct sudoku_state_t* state)
|
||||||
/* Load game - only ".ss" is officially supported, but any sensible
|
/* Load game - only ".ss" is officially supported, but any sensible
|
||||||
text representation (one line per row) may load.
|
text representation (one line per row) may load.
|
||||||
*/
|
*/
|
||||||
bool load_sudoku(struct sudoku_state_t* state, char* filename)
|
static bool load_sudoku(struct sudoku_state_t* state, char* filename)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
size_t n;
|
size_t n;
|
||||||
|
@ -520,7 +520,7 @@ bool load_sudoku(struct sudoku_state_t* state, char* filename)
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool save_sudoku(struct sudoku_state_t* state)
|
static bool save_sudoku(struct sudoku_state_t* state)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int r,c;
|
int r,c;
|
||||||
|
@ -583,7 +583,7 @@ bool save_sudoku(struct sudoku_state_t* state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_board(struct sudoku_state_t* state)
|
static void clear_board(struct sudoku_state_t* state)
|
||||||
{
|
{
|
||||||
int r,c;
|
int r,c;
|
||||||
|
|
||||||
|
@ -596,7 +596,7 @@ void clear_board(struct sudoku_state_t* state)
|
||||||
state->y=0;
|
state->y=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_cell(struct sudoku_state_t* state, int r, int c)
|
static void update_cell(struct sudoku_state_t* state, int r, int c)
|
||||||
{
|
{
|
||||||
/* We have four types of cell:
|
/* We have four types of cell:
|
||||||
1) User-entered number
|
1) User-entered number
|
||||||
|
@ -630,7 +630,7 @@ void update_cell(struct sudoku_state_t* state, int r, int c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void display_board(struct sudoku_state_t* state)
|
static void display_board(struct sudoku_state_t* state)
|
||||||
{
|
{
|
||||||
int r,c;
|
int r,c;
|
||||||
#ifdef SUDOKU_BUTTON_POSSIBLE
|
#ifdef SUDOKU_BUTTON_POSSIBLE
|
||||||
|
@ -823,7 +823,7 @@ void display_board(struct sudoku_state_t* state)
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sudoku_generate(struct sudoku_state_t* state)
|
static bool sudoku_generate(struct sudoku_state_t* state)
|
||||||
{
|
{
|
||||||
char* difficulty;
|
char* difficulty;
|
||||||
char str[80];
|
char str[80];
|
||||||
|
@ -902,7 +902,7 @@ enum {
|
||||||
SM_QUIT,
|
SM_QUIT,
|
||||||
};
|
};
|
||||||
|
|
||||||
int sudoku_menu(struct sudoku_state_t* state)
|
static int sudoku_menu(struct sudoku_state_t* state)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
@ -972,7 +972,7 @@ int sudoku_menu(struct sudoku_state_t* state)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Menu used when user is in edit mode - i.e. creating a new game manually */
|
/* Menu used when user is in edit mode - i.e. creating a new game manually */
|
||||||
int sudoku_edit_menu(struct sudoku_state_t* state)
|
static int sudoku_edit_menu(struct sudoku_state_t* state)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
@ -1001,7 +1001,7 @@ int sudoku_edit_menu(struct sudoku_state_t* state)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void move_cursor(struct sudoku_state_t* state, int newx, int newy)
|
static void move_cursor(struct sudoku_state_t* state, int newx, int newy)
|
||||||
{
|
{
|
||||||
int oldx, oldy;
|
int oldx, oldy;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue