diff options
-rw-r--r-- | apps/plugins/calculator.c | 91 | ||||
-rw-r--r-- | apps/plugins/chopper.c | 13 | ||||
-rw-r--r-- | apps/plugins/demystify.c | 31 | ||||
-rw-r--r-- | apps/plugins/fire.c | 10 | ||||
-rw-r--r-- | apps/plugins/fireworks.c | 8 | ||||
-rw-r--r-- | apps/plugins/invadrox.c | 24 | ||||
-rw-r--r-- | apps/plugins/minesweeper.c | 44 | ||||
-rw-r--r-- | apps/plugins/oscilloscope.c | 6 | ||||
-rw-r--r-- | apps/plugins/plasma.c | 6 | ||||
-rw-r--r-- | apps/plugins/pong.c | 24 | ||||
-rw-r--r-- | apps/plugins/rocklife.c | 2 | ||||
-rw-r--r-- | apps/plugins/shortcuts/shortcuts_append.c | 2 | ||||
-rw-r--r-- | apps/plugins/sliding_puzzle.c | 6 | ||||
-rw-r--r-- | apps/plugins/splitedit.c | 20 | ||||
-rw-r--r-- | apps/plugins/starfield.c | 2 | ||||
-rw-r--r-- | apps/plugins/video.c | 32 | ||||
-rw-r--r-- | apps/plugins/vu_meter.c | 18 |
17 files changed, 171 insertions, 168 deletions
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c index 607f563b5a..994b066e7b 100644 --- a/apps/plugins/calculator.c +++ b/apps/plugins/calculator.c @@ -546,7 +546,7 @@ enum {cal_normal, /* 0, normal status, display result */ } calStatus; /* constant table for CORDIC algorithm */ -double cordicTable[51][2]= { +static const double cordicTable[51][2]= { /* pow(2,0) - pow(2,-50) atan(pow(2,0) - atan(pow(2,-50) */ {1e+00, 7.853981633974483e-01}, {5e-01, 4.636476090008061e-01}, @@ -601,21 +601,21 @@ double cordicTable[51][2]= { {8.8817841970012523233890533447265625e-16, 8.881784197001252e-16} }; -void doMultiple(double* operandOne, int* powerOne, - double operandTwo, int powerTwo); -void doAdd (double* operandOne, int* powerOne, - double operandTwo, int powerTwo); -void printResult(void); -void formatResult(void); -void oneOperand(void); +static void doMultiple(double* operandOne, int* powerOne, + double operandTwo, int powerTwo); +static void doAdd (double* operandOne, int* powerOne, + double operandTwo, int powerTwo); +static void printResult(void); +static void formatResult(void); +static void oneOperand(void); -void drawLines(void); -void drawButtons(int group); +static void drawLines(void); +static void drawButtons(int group); /* ----------------------------------------------------------------------- -Handy funtions +Handy functions ----------------------------------------------------------------------- */ -void cleartypingbuf(void) +static void cleartypingbuf(void) { int k; for( k=1; k<=(DIGITLEN+1); k++) @@ -623,21 +623,21 @@ void cleartypingbuf(void) typingbuf[0] = ' '; typingbufPointer = typingbuf+1; } -void clearbuf(void) +static void clearbuf(void) { int k; for(k=0;k<18;k++) buf[k]=' '; buf[18] = 0; } -void clearResult(void) +static void clearResult(void) { result = 0; power = 0; modifier = 0.1; } -void clearInput(void) +static void clearInput(void) { calStatus = cal_normal; clearResult(); @@ -647,25 +647,25 @@ void clearInput(void) drawLines(); } -void clearOperand(void) +static void clearOperand(void) { operand = 0; operandPower = 0; } -void clearMemTemp(void) +static void clearMemTemp(void) { memTemp = 0; memTempPower = 0; } -void clearOper(void) +static void clearOper(void) { oper = ' '; operInputted = false; } -void clearMem(void) +static void clearMem(void) { clearInput(); clearMemTemp(); @@ -674,7 +674,7 @@ void clearMem(void) btn = BUTTON_NONE; } -void switchOperands(void) +static void switchOperands(void) { double tempr = operand; int tempp = operandPower; @@ -684,7 +684,7 @@ void switchOperands(void) power = tempp; } -void drawLines(void) +static void drawLines(void) { int i; rb->lcd_hline(0, LCD_WIDTH, Y_1_POS-1); @@ -694,7 +694,7 @@ void drawLines(void) rb->lcd_vline(X_1_POS+i*REC_WIDTH, Y_1_POS, LCD_HEIGHT); } -void drawButtons(int group) +static void drawButtons(int group) { int i, j, w, h; for (i = 0; i <= 4; i++){ @@ -722,7 +722,7 @@ void drawButtons(int group) /* ----------------------------------------------------------------------- Initiate calculator ----------------------------------------------------------------------- */ -void cal_initial (void) +static void cal_initial (void) { int w,h; @@ -761,7 +761,7 @@ void cal_initial (void) in it's private case for sqrt. Thanks BlueChip for his intro text and Dave Straayer for the actual name. ----------------------------------------------------------------------- */ -double mySqrt(double square) +static double mySqrt(double square) { int k = 0; double temp = 0; @@ -781,7 +781,7 @@ double mySqrt(double square) transcendFunc can do sin,cos,log,exp input parameter is angle ----------------------------------------------------------------------- */ -void transcendFunc(char* func, double* tt, int* ttPower) +static void transcendFunc(char* func, double* tt, int* ttPower) { double t = (*tt)*M_PI/180; int tPower = *ttPower; int sign = 1; @@ -861,8 +861,8 @@ void transcendFunc(char* func, double* tt, int* ttPower) /* ----------------------------------------------------------------------- add in scientific number format ----------------------------------------------------------------------- */ -void doAdd (double* operandOne, int* powerOne, - double operandTwo, int powerTwo) +static void doAdd (double* operandOne, int* powerOne, + double operandTwo, int powerTwo) { if ( *powerOne >= powerTwo ){ if (*powerOne - powerTwo <= DIGITLEN+1){ @@ -891,8 +891,8 @@ void doAdd (double* operandOne, int* powerOne, /* ----------------------------------------------------------------------- multiple in scientific number format ----------------------------------------------------------------------- */ -void doMultiple(double* operandOne, int* powerOne, - double operandTwo, int powerTwo) +static void doMultiple(double* operandOne, int* powerOne, + double operandTwo, int powerTwo) { (*operandOne) *= operandTwo; (*powerOne) += powerTwo; @@ -901,7 +901,7 @@ void doMultiple(double* operandOne, int* powerOne, /* ----------------------------------------------------------------------- Handles all one operand calculations ----------------------------------------------------------------------- */ -void oneOperand(void) +static void oneOperand(void) { int k = 0; if (buttonGroup == basicButtons){ @@ -988,7 +988,7 @@ void oneOperand(void) /* ----------------------------------------------------------------------- Handles all two operands calculations ----------------------------------------------------------------------- */ -void twoOperands(void) +static void twoOperands(void) { switch(oper){ case '-': @@ -1048,7 +1048,7 @@ static void move_with_wrap_and_shift( Print buttons when switching 1st and 2nd int group = {basicButtons, sciButtons} ----------------------------------------------------------------------- */ -void printButtonGroups(int group) +static void printButtonGroups(int group) { drawButtons(group); drawLines(); @@ -1057,7 +1057,7 @@ void printButtonGroups(int group) /* ----------------------------------------------------------------------- flash the currently marked button ----------------------------------------------------------------------- */ -void flashButton(void) +static void flashButton(void) { int k, w, h; for (k=2;k>0;k--) @@ -1083,7 +1083,8 @@ void flashButton(void) /* ----------------------------------------------------------------------- pos is the position that needs animation. pos = [1~18] ----------------------------------------------------------------------- */ -void deleteAnimation(int pos) +#if defined(CALCULATOR_CLEAR) || defined(CALCULATOR_OPERATORS) +static void deleteAnimation(int pos) { int k, w, h, x; if (pos<1 || pos >18) @@ -1102,6 +1103,7 @@ void deleteAnimation(int pos) rb->sleep(HZ/32); } } +#endif /* ----------------------------------------------------------------------- result may be one of these formats: @@ -1114,7 +1116,7 @@ formatResult() change result to standard format: 0.xxxx if result is close to 0, let it be 0; if result is close to 1, let it be 0.1 and power++; ----------------------------------------------------------------------- */ -void formatResult(void) +static void formatResult(void) { int resultsign = SIGN(result); result = ABS(result); @@ -1160,7 +1162,7 @@ case SCIENTIFIC_FORMAT, let temppower = 1; case temppower > 0: print '.' in the middle case temppower <= 0: print '.' in the begining ----------------------------------------------------------------------- */ -void result2typingbuf(void) +static void result2typingbuf(void) { bool haveDot = false; char tempchar = 0; @@ -1244,7 +1246,7 @@ void result2typingbuf(void) /* ----------------------------------------------------------------------- printResult() generates LCD display. ----------------------------------------------------------------------- */ -void printResult(void) +static void printResult(void) { int k, w, h; @@ -1321,7 +1323,7 @@ void printResult(void) Process typing buttons: 1-9, '.', sign main operand "result" and typingbuf are processed seperately here. ----------------------------------------------------------------------- */ -void typingProcess(void){ +static void typingProcess(void){ switch( CAL_BUTTON ){ case btn_sign: if (calStatus == cal_typing || @@ -1395,7 +1397,8 @@ void typingProcess(void){ Handle delete operation main operand "result" and typingbuf are processed seperately here. ----------------------------------------------------------------------- */ -void doDelete(void){ +#ifdef CALCULATOR_CLEAR +static void doDelete(void){ deleteAnimation(18); switch(calStatus){ case cal_dotted: @@ -1434,10 +1437,11 @@ void doDelete(void){ break; } } +#endif /* ----------------------------------------------------------------------- Handle buttons on basic screen ----------------------------------------------------------------------- */ -void basicButtonsProcess(void){ +static void basicButtonsProcess(void){ switch (btn) { case CALCULATOR_INPUT: if (calStatus == cal_error && (CAL_BUTTON != btn_C) ) break; @@ -1538,7 +1542,7 @@ void basicButtonsProcess(void){ /* ----------------------------------------------------------------------- Handle buttons on scientific screen ----------------------------------------------------------------------- */ -void sciButtonsProcess(void){ +static void sciButtonsProcess(void){ switch (btn) { case CALCULATOR_INPUT: if (calStatus == cal_error && (CAL_BUTTON != sci_sci) ) break; @@ -1613,7 +1617,7 @@ void sciButtonsProcess(void){ move button index Invert display new button, invert back previous button ----------------------------------------------------------------------- */ -int handleButton(int button){ +static int handleButton(int button){ switch(button) { case CALCULATOR_INPUT: @@ -1721,9 +1725,6 @@ int handleButton(int button){ } return 0; - - prev_btn_row = btn_row; - prev_btn_col = btn_col; } /* ----------------------------------------------------------------------- diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index 3d3b2d08ef..ef1f8aacf3 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c @@ -290,8 +290,7 @@ struct CTerrain mRoof; static void chopDrawParticle(struct CParticle *mParticle); static void chopDrawBlock(struct CBlock *mBlock); static void chopRenderTerrain(struct CTerrain *ter, bool isground); -void chopper_load(bool newgame); -void cleanup_chopper(void); +static void chopper_load(bool newgame); static void chopDrawPlayer(int x,int y) /* These are SCREEN coords, not world!*/ { @@ -335,7 +334,7 @@ static void chopClearTerrain(struct CTerrain *ter) } -int iR(int low,int high) +static int iR(int low,int high) { return low+rb->rand()%(high-low+1); } @@ -394,7 +393,7 @@ static void chopTerrainNodeDeleteAndShift(struct CTerrain *ter,int nodeIndex) } -int chopUpdateTerrainRecycling(struct CTerrain *ter) +static int chopUpdateTerrainRecycling(struct CTerrain *ter) { int i=1; int iNewNodePos,g,v; @@ -425,7 +424,7 @@ int chopUpdateTerrainRecycling(struct CTerrain *ter) return 1; } -int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX) +static int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX) { int iNodeIndexOne=0,iNodeIndexTwo=0, h, terY1, terY2, terX2, a, b; @@ -462,7 +461,7 @@ int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX) } -int chopPointInTerrain(struct CTerrain *ter, int pX, int pY, int iTestType) +static int chopPointInTerrain(struct CTerrain *ter, int pX, int pY, int iTestType) { int h = chopTerrainHeightAtPoint(ter, pX); @@ -990,7 +989,7 @@ static void chopRenderTerrain(struct CTerrain *ter, bool isground) } } -void chopper_load(bool newgame) +static void chopper_load(bool newgame) { int i; diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c index 81ac53cc6c..a389018c4e 100644 --- a/apps/plugins/demystify.c +++ b/apps/plugins/demystify.c @@ -78,7 +78,7 @@ struct line_color * Compute a new random step to make the point bounce the borders of the screen */ -int get_new_step(int step) +static int get_new_step(int step) { if(step>0) return -(MIN_STEP_RANGE + rb->rand() % (MAX_STEP_RANGE-MIN_STEP_RANGE)); @@ -108,7 +108,7 @@ struct polygon /* * Generates a random polygon (which fits the screen size though) */ -void polygon_init(struct polygon * polygon, struct screen * display) +static void polygon_init(struct polygon * polygon, struct screen * display) { int i; for(i=0;i<NB_POINTS;++i) @@ -122,7 +122,7 @@ void polygon_init(struct polygon * polygon, struct screen * display) * Draw the given polygon onto the screen */ -void polygon_draw(struct polygon * polygon, struct screen * display) +static void polygon_draw(struct polygon * polygon, struct screen * display) { int i; for(i=0;i<NB_POINTS-1;++i) @@ -144,7 +144,7 @@ struct polygon_move struct point move_steps[NB_POINTS]; }; -void polygon_move_init(struct polygon_move * polygon_move) +static void polygon_move_init(struct polygon_move * polygon_move) { int i; for(i=0;i<NB_POINTS;++i) @@ -159,7 +159,8 @@ void polygon_move_init(struct polygon_move * polygon_move) * Update the given polygon's position according to the given informations in * polygon_move (polygon_move may be updated) */ -void polygon_update(struct polygon *polygon, struct screen * display, struct polygon_move *polygon_move) +static void polygon_update(struct polygon *polygon, struct screen * display, + struct polygon_move *polygon_move) { int i, x, y, step; for(i=0;i<NB_POINTS;++i) @@ -208,14 +209,14 @@ struct polygon_fifo struct polygon tab[MAX_POLYGONS]; }; -void fifo_init(struct polygon_fifo * fifo) +static void fifo_init(struct polygon_fifo * fifo) { fifo->fifo_tail=0; fifo->fifo_head=0; fifo->nb_items=0; } -void fifo_push(struct polygon_fifo * fifo, struct polygon * polygon) +static void fifo_push(struct polygon_fifo * fifo, struct polygon * polygon) { if(fifo->nb_items>=MAX_POLYGONS) return; @@ -231,7 +232,7 @@ void fifo_push(struct polygon_fifo * fifo, struct polygon * polygon) fifo->fifo_head=0; } -struct polygon * fifo_pop(struct polygon_fifo * fifo) +static struct polygon * fifo_pop(struct polygon_fifo * fifo) { int index; if(fifo->nb_items==0) @@ -248,7 +249,7 @@ struct polygon * fifo_pop(struct polygon_fifo * fifo) * Drawing stuffs */ -void polygons_draw(struct polygon_fifo * polygons, struct screen * display) +static void polygons_draw(struct polygon_fifo * polygons, struct screen * display) { int i, j; for(i=0, j=polygons->fifo_tail;i<polygons->nb_items;++i, ++j) @@ -259,7 +260,7 @@ void polygons_draw(struct polygon_fifo * polygons, struct screen * display) } } -void cleanup(void) +static void cleanup(void) { backlight_use_settings(); #ifdef HAVE_REMOTE_LCD @@ -268,14 +269,14 @@ void cleanup(void) } #ifdef HAVE_LCD_COLOR -void color_randomize(struct line_color * color) +static void color_randomize(struct line_color * color) { color->r = rb->rand()%255; color->g = rb->rand()%255; color->b = rb->rand()%255; } -void color_init(struct line_color * color) +static void color_init(struct line_color * color) { color_randomize(color); color->current_r=color->r; @@ -283,7 +284,7 @@ void color_init(struct line_color * color) color->current_b=color->b; } -void color_change(struct line_color * color) +static void color_change(struct line_color * color) { if(color->current_r<color->r) ++color->current_r; @@ -307,7 +308,7 @@ void color_change(struct line_color * color) #define COLOR_RGBPACK(color) \ LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) -void color_apply(struct line_color * color, struct screen * display) +static void color_apply(struct line_color * color, struct screen * display) { if (display->is_color){ unsigned foreground= @@ -321,7 +322,7 @@ void color_apply(struct line_color * color, struct screen * display) * Main function */ -int plugin_main(void) +static int plugin_main(void) { int action; int sleep_time=DEFAULT_WAIT_TIME; diff --git a/apps/plugins/fire.c b/apps/plugins/fire.c index 797f4f120b..1cee37cf1d 100644 --- a/apps/plugins/fire.c +++ b/apps/plugins/fire.c @@ -76,7 +76,7 @@ const struct button_mapping* plugin_contexts[]= { #ifndef HAVE_LCD_COLOR static unsigned char palette[256]; -void color_palette_init(unsigned char* palette) +static void color_palette_init(unsigned char* palette) { int i; for(i=0;i<=160;i++)//palette[i]=(3/2)*i @@ -95,7 +95,7 @@ static fb_data palette[256]; * the "The Demo Effects Collection" GPL project * Copyright (C) 2002 W.P. van Paassen */ -void color_palette_init(fb_data* palette) +static void color_palette_init(fb_data* palette) { int i; for (i = 0; i < 32; i++){ @@ -268,7 +268,7 @@ static inline void fire_draw(struct fire* fire) #endif } -void cleanup(void *parameter) +static void cleanup(void *parameter) { (void)parameter; #ifdef HAVE_ADJUSTABLE_CPU_FREQ @@ -283,7 +283,7 @@ void cleanup(void *parameter) #ifndef HAVE_LCD_COLOR -int init_grey(void) +static int init_grey(void) { unsigned char *gbuf; size_t gbuf_size = 0; @@ -303,7 +303,7 @@ int init_grey(void) } #endif -int main(void) +static int main(void) { int action; diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c index 75db1b3c0a..69c7be0bc4 100644 --- a/apps/plugins/fireworks.c +++ b/apps/plugins/fireworks.c @@ -320,7 +320,7 @@ MENUITEM_STRINGLIST(menu, "Fireworks Menu", NULL, "FPS (Speed)", "Playback Control", "Quit"); /* called on startup. initializes all variables, etc */ -void init_all(void) +static void init_all(void) { int j; @@ -333,7 +333,7 @@ void init_all(void) /* called when a rocket hits its destination height. * prepares all associated fireworks to be expelled. */ -void init_explode(int x, int y, int firework, int points) +static void init_explode(int x, int y, int firework, int points) { int i; @@ -357,7 +357,7 @@ void init_explode(int x, int y, int firework, int points) /* called when a rocket is launched. * prepares said rocket to start moving towards its destination. */ -void init_rocket(int rocket) +static void init_rocket(int rocket) { rb->srand(*rb->current_tick); @@ -374,7 +374,7 @@ void init_rocket(int rocket) } /* startup/configuration menu. */ -void fireworks_menu(void) +static void fireworks_menu(void) { int selected = 0, result; bool menu_quit = false; diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c index 39fba9eb76..94d079f2b4 100644 --- a/apps/plugins/invadrox.c +++ b/apps/plugins/invadrox.c @@ -740,7 +740,7 @@ static inline fb_data get_pixel(int x, int y) /* Draw "digits" least significant digits of num at (x,y) */ -void draw_number(int x, int y, int num, int digits) +static void draw_number(int x, int y, int num, int digits) { int i; int d; @@ -770,13 +770,13 @@ static inline void draw_score(void) } -void draw_level(void) +static void draw_level(void) { draw_number(LEVEL_X + 2 * NUM_SPACING, PLAYFIELD_Y + 2, level, 2); } -void draw_lives(void) +static void draw_lives(void) { int i; /* Lives num */ @@ -872,7 +872,7 @@ static inline bool next_alien(void) * Set curr_alien to first alive. * Return false if no-one is left alive. */ -bool first_alien(void) +static bool first_alien(void) { int i, y; @@ -892,7 +892,7 @@ bool first_alien(void) } -bool move_aliens(void) +static bool move_aliens(void) { int x, y, old_x, old_y; @@ -1023,7 +1023,7 @@ static inline void fire_alpha(int xc, int yc, fb_data color) } -void move_fire(void) +static void move_fire(void) { bool hit_green = false; bool hit_white = false; @@ -1244,7 +1244,7 @@ static inline void draw_bomb(int i) } -void move_bombs(void) +static void move_bombs(void) { int i, j, bomber; bool abort; @@ -1410,7 +1410,7 @@ static inline void move_ship(void) /* Unidentified Flying Object */ -void move_ufo(void) +static void move_ufo(void) { static int ufo_speed; static int counter; @@ -1483,7 +1483,7 @@ void move_ufo(void) } -void draw_background(void) +static void draw_background(void) { rb->lcd_bitmap(invadrox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); @@ -1491,7 +1491,7 @@ void draw_background(void) } -void new_level(void) +static void new_level(void) { int i; @@ -1604,7 +1604,7 @@ void new_level(void) } -void init_invadrox(void) +static void init_invadrox(void) { int i; @@ -1756,7 +1756,7 @@ check_usb: } -void game_loop(void) +static void game_loop(void) { int i, end; diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index c63acf547c..b3effdf328 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -381,28 +381,28 @@ typedef struct tile /* the height and width of the field */ #define MAX_HEIGHT (LCD_HEIGHT/TileSize) #define MAX_WIDTH (LCD_WIDTH/TileSize) -int height = MAX_HEIGHT; -int width = MAX_WIDTH; -int top; -int left; +static int height = MAX_HEIGHT; +static int width = MAX_WIDTH; +static int top; +static int left; /* The Minefield. Caution it is defined as Y, X! Not the opposite. */ -tile minefield[MAX_HEIGHT][MAX_WIDTH]; +static tile minefield[MAX_HEIGHT][MAX_WIDTH]; /* total number of mines on the game */ -int mine_num = 0; +static int mine_num = 0; /* percentage of mines on minefield used during generation */ -int percent = 16; +static int percent = 16; /* number of tiles left on the game */ -int tiles_left; +static int tiles_left; /* Because mines are set after the first move... */ -bool no_mines = true; +static bool no_mines = true; /* We need a stack (created on discover()) for the cascade algorithm. */ -int stack_pos = 0; +static int stack_pos = 0; #ifdef HAVE_TOUCHSCREEN @@ -411,7 +411,7 @@ static struct ts_raster mine_raster = { 0, 0, MAX_WIDTH, MAX_HEIGHT, TileSize, T #endif -void push( int *stack, int y, int x ) +static void push( int *stack, int y, int x ) { if( stack_pos <= height*width ) { @@ -421,7 +421,7 @@ void push( int *stack, int y, int x ) } /* Unveil tiles and push them to stack if they are empty. */ -void unveil( int *stack, int y, int x ) +static void unveil( int *stack, int y, int x ) { if( x < 0 || y < 0 || x > width - 1 || y > height - 1 || minefield[y][x].known @@ -433,14 +433,14 @@ void unveil( int *stack, int y, int x ) push( stack, y, x ); } -int is_flagged( int y, int x ) +static int is_flagged( int y, int x ) { if( x >= 0 && y >= 0 && x < width && y < height && minefield[y][x].flag ) return 1; return 0; } -int neighbors_flagged( int y, int x ) +static int neighbors_flagged( int y, int x ) { return is_flagged( y-1, x-1 ) + is_flagged( y-1, x ) + @@ -453,7 +453,7 @@ int neighbors_flagged( int y, int x ) is_flagged( y+1, x+1 ); } -bool discover( int y, int x, bool explore_neighbors ) +static bool discover( int y, int x, bool explore_neighbors ) { /* Selected tile. */ if( x < 0 || y < 0 || x > width - 1 || y > height - 1) @@ -513,7 +513,7 @@ bool discover( int y, int x, bool explore_neighbors ) } /* Reset the whole board for a new game. */ -void minesweeper_init( void ) +static void minesweeper_init( void ) { rb->memset(minefield, 0, sizeof(minefield)); no_mines = true; @@ -524,7 +524,7 @@ void minesweeper_init( void ) /* put mines on the mine field */ /* there is p% chance that a tile is a mine */ /* if the tile has coordinates (x,y), then it can't be a mine */ -void minesweeper_putmines( int p, int x, int y ) +static void minesweeper_putmines( int p, int x, int y ) { int i,j; @@ -585,7 +585,7 @@ void minesweeper_putmines( int p, int x, int y ) /* A function that will uncover all the board, when the user wins or loses. can easily be expanded, (just a call assigned to a button) as a solver. */ -void mine_show( void ) +static void mine_show( void ) { int i, j, button; @@ -622,7 +622,7 @@ void mine_show( void ) #endif } -int count_tiles_left( void ) +static int count_tiles_left( void ) { int tiles = 0; int i, j; @@ -633,7 +633,7 @@ int count_tiles_left( void ) return tiles; } -int count_flags( void ) +static int count_flags( void ) { int flags = 0; int i, j; @@ -645,7 +645,7 @@ int count_flags( void ) } /* welcome screen where player can chose mine percentage */ -enum minesweeper_status menu( void ) +static enum minesweeper_status menu( void ) { int selection = 0, result = MINESWEEPER_QUIT; bool menu_quit = false; @@ -698,7 +698,7 @@ enum minesweeper_status menu( void ) } /* the big and ugly game function */ -enum minesweeper_status minesweeper( void ) +static enum minesweeper_status minesweeper( void ) { int i, j; int button; diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index 5c709012e7..52cef65d64 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -431,7 +431,7 @@ int font_height = 8; /* implementation */ -void anim_horizontal(int cur_left, int cur_right) +static void anim_horizontal(int cur_left, int cur_right) { int cur_x, x; int left, right, dl, dr; @@ -609,7 +609,7 @@ void anim_horizontal(int cur_left, int cur_right) last_pos = cur_x; } -void anim_vertical(int cur_left, int cur_right) +static void anim_vertical(int cur_left, int cur_right) { int cur_y, y; int left, right, dl, dr; @@ -784,7 +784,7 @@ void anim_vertical(int cur_left, int cur_right) last_pos = cur_y; } -void cleanup(void) +static void cleanup(void) { #if LCD_DEPTH > 1 rb->lcd_set_foreground(LCD_DEFAULT_FG); diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c index e824593850..950423c241 100644 --- a/apps/plugins/plasma.c +++ b/apps/plugins/plasma.c @@ -83,7 +83,7 @@ static void wave_table_generate(void) #ifdef HAVE_LCD_COLOR /* Make a smooth colour cycle. */ -void shades_generate(int time) +static void shades_generate(int time) { int i; unsigned red, green, blue; @@ -129,7 +129,7 @@ static void shades_generate(void) } #endif -void cleanup(void) +static void cleanup(void) { #ifdef HAVE_ADJUSTABLE_CPU_FREQ if (boosted) @@ -150,7 +150,7 @@ void cleanup(void) * algorithm. */ -int main(void) +static int main(void) { plasma_frequency = 1; int action, x, y; diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 5e6f308663..37d71155ee 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c @@ -288,7 +288,7 @@ struct pong { struct player player[2]; }; -void singlepad(int x, int y, int set) +static void singlepad(int x, int y, int set) { if(set) { rb->lcd_fillrect(x, y, PAD_WIDTH, PAD_HEIGHT); @@ -300,7 +300,7 @@ void singlepad(int x, int y, int set) } } -void pad(struct pong *p, int pad) +static void pad(struct pong *p, int pad) { struct player *player = &p->player[pad]; /* clear existing pad */ @@ -313,7 +313,7 @@ void pad(struct pong *p, int pad) player->e_pad = player->w_pad; } -bool wallcollide(struct pong *p, int pad) +static bool wallcollide(struct pong *p, int pad) { /* we have already checked for pad-collision, just check if this hits the wall */ @@ -332,7 +332,7 @@ bool wallcollide(struct pong *p, int pad) /* returns true if the ball has hit a pad, and then the info variable will have extra angle info */ -bool padcollide(struct pong *p, int pad, int *info) +static bool padcollide(struct pong *p, int pad, int *info) { struct player *player = &p->player[pad]; int x = p->ball.x/RES; @@ -366,7 +366,7 @@ bool padcollide(struct pong *p, int pad, int *info) return false; /* nah */ } -void bounce(struct pong *p, int pad, int info) +static void bounce(struct pong *p, int pad, int info) { p->ball.speedx = -p->ball.speedx; @@ -410,7 +410,7 @@ void bounce(struct pong *p, int pad, int info) #endif } -void score(struct pong *p, int pad) +static void score(struct pong *p, int pad) { if(pad) rb->splash(HZ/4, "right scores!"); @@ -436,7 +436,7 @@ void score(struct pong *p, int pad) p->player[1].e_pad = -1; } -void ball(struct pong *p) +static void ball(struct pong *p) { int oldx = p->ball.x/RES; int oldy = p->ball.y/RES; @@ -487,7 +487,7 @@ void ball(struct pong *p) rb->lcd_fillrect(newx, newy, BALL_WIDTH, BALL_HEIGHT); } -void padmove(int *pos, int dir) +static void padmove(int *pos, int dir) { *pos += dir; if(*pos > (LCD_HEIGHT-PAD_HEIGHT)) @@ -496,7 +496,7 @@ void padmove(int *pos, int dir) *pos = 0; } -void key_pad(struct pong *p, int pad, int up, int down) +static void key_pad(struct pong *p, int pad, int up, int down) { struct player *player = &p->player[pad]; if(player->iscpu) { @@ -526,7 +526,7 @@ void key_pad(struct pong *p, int pad, int up, int down) } } -int keys(struct pong *p) +static int keys(struct pong *p) { int key; #ifdef PONG_PAUSE @@ -609,7 +609,7 @@ int keys(struct pong *p) return 1; /* return 0 to exit game */ } -void showscore(struct pong *p) +static void showscore(struct pong *p) { static char buffer[20]; int w; @@ -620,7 +620,7 @@ void showscore(struct pong *p) rb->lcd_putsxy( (LCD_WIDTH / 2) - (w / 2), 0, (unsigned char *)buffer); } -void blink_demo(void) +static void blink_demo(void) { static char buffer[30]; int w; diff --git a/apps/plugins/rocklife.c b/apps/plugins/rocklife.c index 4b00d7e18a..1effeb2f00 100644 --- a/apps/plugins/rocklife.c +++ b/apps/plugins/rocklife.c @@ -120,7 +120,7 @@ static inline unsigned char get_cell(int x, int y, char *pgrid) { } /* clear grid */ -void init_grid(char *pgrid){ +static void init_grid(char *pgrid){ memset(pgrid, 0, GRID_W * GRID_H); } diff --git a/apps/plugins/shortcuts/shortcuts_append.c b/apps/plugins/shortcuts/shortcuts_append.c index 3eea87e46e..0c4534a6b9 100644 --- a/apps/plugins/shortcuts/shortcuts_append.c +++ b/apps/plugins/shortcuts/shortcuts_append.c @@ -25,7 +25,7 @@ -bool append_entry_to_file(sc_file_t *file, char *path, bool is_dir) +static bool append_entry_to_file(sc_file_t *file, char *path, bool is_dir) { sc_entry_t entry; diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c index d2e1eec977..1d857c0198 100644 --- a/apps/plugins/sliding_puzzle.c +++ b/apps/plugins/sliding_puzzle.c @@ -359,7 +359,7 @@ static const fb_data * puzzle_bmp_ptr; static const char * initial_bmp_path=NULL; #ifdef HAVE_ALBUMART -const char * get_albumart_bmp_path(void) +static const char * get_albumart_bmp_path(void) { struct mp3entry* track = rb->audio_current_track(); @@ -374,10 +374,12 @@ const char * get_albumart_bmp_path(void) } #endif -const char * get_random_bmp_path(void) +#if 0 /* unused */ +static const char * get_random_bmp_path(void) { return(initial_bmp_path); } +#endif static bool load_resize_bitmap(void) { diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c index c3562f0953..d44e2d1f51 100644 --- a/apps/plugins/splitedit.c +++ b/apps/plugins/splitedit.c @@ -245,7 +245,7 @@ static void update_timebar(struct mp3entry *mp3) * Marks the entire area of the osci buffer invalid. * It will be drawn with new values in the next loop. */ -void splitedit_invalidate_osci(void) +static void splitedit_invalidate_osci(void) { osci_valid = false; validation_start = ~(unsigned int)0; @@ -254,7 +254,7 @@ void splitedit_invalidate_osci(void) /** * Returns the loop mode. See the LOOP_MODE_XXX constants above. */ -int splitedit_get_loop_mode(void) +static int splitedit_get_loop_mode(void) { return loop_mode; } @@ -300,7 +300,7 @@ static void update_icons(void) /** * Sets the loop mode. See the LOOP_MODE_XXX constants above. */ -void splitedit_set_loop_mode(int mode) +static void splitedit_set_loop_mode(int mode) { int old_loop_mode = loop_mode; /* range restriction */ @@ -386,7 +386,7 @@ static void set_range_by_time( /** * Set the split point in screen coordinates */ -void splitedit_set_split_x(int newx) +static void splitedit_set_split_x(int newx) { int minx = split_x - 2 > 0 ? split_x - 2: 0; @@ -424,7 +424,7 @@ void splitedit_set_split_x(int newx) /** * returns the split point in screen coordinates */ -int splitedit_get_split_x(void) +static int splitedit_get_split_x(void) { return split_x; } @@ -502,7 +502,7 @@ static void scroll(struct mp3entry *mp3) /** * Zooms in by 3/4 */ -void splitedit_zoom_in(struct mp3entry *mp3) +static void splitedit_zoom_in(struct mp3entry *mp3) { rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); rb->lcd_fillrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); @@ -516,7 +516,7 @@ void splitedit_zoom_in(struct mp3entry *mp3) /** * Zooms out by 4/3 */ -void splitedit_zoom_out(struct mp3entry *mp3) +static void splitedit_zoom_out(struct mp3entry *mp3) { rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); rb->lcd_fillrect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); @@ -915,9 +915,9 @@ static void save_editor(struct mp3entry *mp3, int splittime) /** * The main loop of the editor */ -unsigned long splitedit_editor(struct mp3entry * mp3_to_split, - unsigned int split_time, - unsigned int range) +static unsigned long splitedit_editor(struct mp3entry * mp3_to_split, + unsigned int split_time, + unsigned int range) { int button = BUTTON_NONE; int lastbutton = BUTTON_NONE; diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c index ba3f24a4a2..6ead68fb3a 100644 --- a/apps/plugins/starfield.c +++ b/apps/plugins/starfield.c @@ -399,7 +399,7 @@ static inline void starfield_move_and_draw(struct starfield * starfield) static struct starfield starfield; -int plugin_main(void) +static int plugin_main(void) { int button, avg_peak, t_disp=0; int font_h, font_w; diff --git a/apps/plugins/video.c b/apps/plugins/video.c index c8f9673a25..8fd1071c1e 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c @@ -65,7 +65,7 @@ /****************** prototypes ******************/ -void timer4_isr(void); /* IMIA4 ISR */ +static void timer4_isr(void); /* IMIA4 ISR */ int check_button(void); /* determine next relative frame */ @@ -207,7 +207,7 @@ tFileHeader gFileHdr; /* file header */ /****************** implementation ******************/ /* tool function: return how much playable audio/video is left */ -int Available(unsigned char* pSnapshot) +static int Available(unsigned char* pSnapshot) { if (pSnapshot <= gBuf.pBufFill) return gBuf.pBufFill - pSnapshot; @@ -216,7 +216,7 @@ int Available(unsigned char* pSnapshot) } /* debug function to draw buffer indicators */ -void DrawBuf(void) +static void DrawBuf(void) { int ypos, fill, video, audio; @@ -247,7 +247,7 @@ void DrawBuf(void) /* helper function to draw a position indicator */ -void DrawPosition(int pos, int total) +static void DrawPosition(int pos, int total) { int w, h; int sec; /* estimated seconds */ @@ -283,7 +283,7 @@ void DrawPosition(int pos, int total) } /* Put text on OSD and activate it for 1 second */ -void osd_show_text(void) +static void osd_show_text(void) { int h, ypos; @@ -305,7 +305,7 @@ void osd_show_text(void) } /* helper function to change the volume by a certain amount, +/- */ -void ChangeVolume(int delta) +static void ChangeVolume(int delta) { int minvol = rb->sound_min(SOUND_VOLUME); int maxvol = rb->sound_max(SOUND_VOLUME); @@ -325,7 +325,7 @@ void ChangeVolume(int delta) /* helper function to change the LCD contrast by a certain amount, +/- */ -void ChangeContrast(int delta) +static void ChangeContrast(int delta) { static int mycontrast = -1; /* the "permanent" value while running */ int contrast; /* updated value */ @@ -348,7 +348,7 @@ void ChangeContrast(int delta) /* sync the video to the current audio */ -void SyncVideo(void) +static void SyncVideo(void) { tAudioFrameHeader* pAudioBuf; @@ -370,7 +370,7 @@ void SyncVideo(void) /* timer interrupt handler to display a frame */ -void timer4_isr(void) +static void timer4_isr(void) { int available; tAudioFrameHeader* pAudioBuf; @@ -446,7 +446,7 @@ void timer4_isr(void) /* ISR function to get more mp3 data */ -void GetMoreMp3(unsigned char** start, size_t* size) +static void GetMoreMp3(unsigned char** start, size_t* size) { int available; int advance; @@ -476,7 +476,7 @@ void GetMoreMp3(unsigned char** start, size_t* size) } -int WaitForButton(void) +static int WaitForButton(void) { int button; @@ -490,7 +490,7 @@ int WaitForButton(void) } -bool WantResume(int fd) +static bool WantResume(int fd) { int button; @@ -507,7 +507,7 @@ bool WantResume(int fd) } -int SeekTo(int fd, int nPos) +static int SeekTo(int fd, int nPos) { int read_now, got_now; @@ -574,7 +574,7 @@ int SeekTo(int fd, int nPos) } /* called from default_event_handler_ex() or at end of playback */ -void Cleanup(void *fd) +static void Cleanup(void *fd) { rb->close(*(int*)fd); /* close the file */ @@ -592,7 +592,7 @@ void Cleanup(void *fd) } /* returns >0 if continue, =0 to stop, <0 to abort (USB) */ -int PlayTick(int fd) +static int PlayTick(int fd) { int button; static int lastbutton = 0; @@ -867,7 +867,7 @@ int PlayTick(int fd) } -int main(char* filename) +static int main(char* filename) { int file_size; int fd; /* file descriptor handle */ diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index bd6a3e3904..27f9fe06df 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c @@ -433,7 +433,7 @@ struct saved_settings { int digital_decay; } vumeter_settings; -void reset_settings(void) { +static void reset_settings(void) { vumeter_settings.meter_type=ANALOG; vumeter_settings.analog_use_db_scale=true; vumeter_settings.digital_use_db_scale=true; @@ -443,7 +443,7 @@ void reset_settings(void) { vumeter_settings.digital_decay=0; } -void calc_scales(void) +static void calc_scales(void) { unsigned int fx_log_factor = E_POW_5/half_width; unsigned int y,z; @@ -477,7 +477,7 @@ void calc_scales(void) } } -void load_settings(void) { +static void load_settings(void) { int fp = rb->open(PLUGIN_DEMOS_DATA_DIR "/.vu_meter", O_RDONLY); if(fp>=0) { rb->read(fp, &vumeter_settings, sizeof(struct saved_settings)); @@ -489,7 +489,7 @@ void load_settings(void) { } } -void save_settings(void) { +static void save_settings(void) { int fp = rb->creat(PLUGIN_DEMOS_DATA_DIR "/.vu_meter", 0666); if(fp >= 0) { rb->write (fp, &vumeter_settings, sizeof(struct saved_settings)); @@ -497,7 +497,7 @@ void save_settings(void) { } } -void change_volume(int delta) { +static void change_volume(int delta) { int minvol = rb->sound_min(SOUND_VOLUME); int maxvol = rb->sound_max(SOUND_VOLUME); int vol = rb->global_settings->volume + delta; @@ -602,7 +602,7 @@ static bool vu_meter_menu(void) return exit; } -void draw_analog_minimeters(void) { +static void draw_analog_minimeters(void) { rb->lcd_mono_bitmap(sound_speaker, quarter_width-28, 12, 4, 8); rb->lcd_set_drawmode(DRMODE_FG); if(analog_mini_1<left_needle_top_x) @@ -628,7 +628,7 @@ void draw_analog_minimeters(void) { rb->lcd_set_drawmode(DRMODE_SOLID); } -void draw_digital_minimeters(void) { +static void draw_digital_minimeters(void) { #ifdef HAVE_LCD_COLOR rb->lcd_set_foreground(LCD_RGBPACK(255, 255 - 23 * num_left_leds, 0)); #endif @@ -664,7 +664,7 @@ void draw_digital_minimeters(void) { #endif } -void analog_meter(void) { +static void analog_meter(void) { #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) int left_peak = rb->mas_codec_readreg(0xC); @@ -723,7 +723,7 @@ void analog_meter(void) { } } -void digital_meter(void) { +static void digital_meter(void) { #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) int left_peak = rb->mas_codec_readreg(0xC); int right_peak = rb->mas_codec_readreg(0xD); |