plugins: another round of making local functions static

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30758 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2011-10-15 20:38:08 +00:00
parent 2176fb38b6
commit fe67a87885
17 changed files with 171 additions and 168 deletions

View file

@ -546,7 +546,7 @@ enum {cal_normal, /* 0, normal status, display result */
} calStatus; } calStatus;
/* constant table for CORDIC algorithm */ /* 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) */ /* pow(2,0) - pow(2,-50) atan(pow(2,0) - atan(pow(2,-50) */
{1e+00, 7.853981633974483e-01}, {1e+00, 7.853981633974483e-01},
{5e-01, 4.636476090008061e-01}, {5e-01, 4.636476090008061e-01},
@ -601,21 +601,21 @@ double cordicTable[51][2]= {
{8.8817841970012523233890533447265625e-16, 8.881784197001252e-16} {8.8817841970012523233890533447265625e-16, 8.881784197001252e-16}
}; };
void doMultiple(double* operandOne, int* powerOne, static void doMultiple(double* operandOne, int* powerOne,
double operandTwo, int powerTwo); double operandTwo, int powerTwo);
void doAdd (double* operandOne, int* powerOne, static void doAdd (double* operandOne, int* powerOne,
double operandTwo, int powerTwo); double operandTwo, int powerTwo);
void printResult(void); static void printResult(void);
void formatResult(void); static void formatResult(void);
void oneOperand(void); static void oneOperand(void);
void drawLines(void); static void drawLines(void);
void drawButtons(int group); static void drawButtons(int group);
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
Handy funtions Handy functions
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void cleartypingbuf(void) static void cleartypingbuf(void)
{ {
int k; int k;
for( k=1; k<=(DIGITLEN+1); k++) for( k=1; k<=(DIGITLEN+1); k++)
@ -623,21 +623,21 @@ void cleartypingbuf(void)
typingbuf[0] = ' '; typingbuf[0] = ' ';
typingbufPointer = typingbuf+1; typingbufPointer = typingbuf+1;
} }
void clearbuf(void) static void clearbuf(void)
{ {
int k; int k;
for(k=0;k<18;k++) for(k=0;k<18;k++)
buf[k]=' '; buf[k]=' ';
buf[18] = 0; buf[18] = 0;
} }
void clearResult(void) static void clearResult(void)
{ {
result = 0; result = 0;
power = 0; power = 0;
modifier = 0.1; modifier = 0.1;
} }
void clearInput(void) static void clearInput(void)
{ {
calStatus = cal_normal; calStatus = cal_normal;
clearResult(); clearResult();
@ -647,25 +647,25 @@ void clearInput(void)
drawLines(); drawLines();
} }
void clearOperand(void) static void clearOperand(void)
{ {
operand = 0; operand = 0;
operandPower = 0; operandPower = 0;
} }
void clearMemTemp(void) static void clearMemTemp(void)
{ {
memTemp = 0; memTemp = 0;
memTempPower = 0; memTempPower = 0;
} }
void clearOper(void) static void clearOper(void)
{ {
oper = ' '; oper = ' ';
operInputted = false; operInputted = false;
} }
void clearMem(void) static void clearMem(void)
{ {
clearInput(); clearInput();
clearMemTemp(); clearMemTemp();
@ -674,7 +674,7 @@ void clearMem(void)
btn = BUTTON_NONE; btn = BUTTON_NONE;
} }
void switchOperands(void) static void switchOperands(void)
{ {
double tempr = operand; double tempr = operand;
int tempp = operandPower; int tempp = operandPower;
@ -684,7 +684,7 @@ void switchOperands(void)
power = tempp; power = tempp;
} }
void drawLines(void) static void drawLines(void)
{ {
int i; int i;
rb->lcd_hline(0, LCD_WIDTH, Y_1_POS-1); 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); 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; int i, j, w, h;
for (i = 0; i <= 4; i++){ for (i = 0; i <= 4; i++){
@ -722,7 +722,7 @@ void drawButtons(int group)
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
Initiate calculator Initiate calculator
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void cal_initial (void) static void cal_initial (void)
{ {
int w,h; int w,h;
@ -761,7 +761,7 @@ void cal_initial (void)
in it's private case for sqrt. in it's private case for sqrt.
Thanks BlueChip for his intro text and Dave Straayer for the actual name. 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; int k = 0;
double temp = 0; double temp = 0;
@ -781,7 +781,7 @@ double mySqrt(double square)
transcendFunc can do sin,cos,log,exp transcendFunc can do sin,cos,log,exp
input parameter is angle 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; double t = (*tt)*M_PI/180; int tPower = *ttPower;
int sign = 1; int sign = 1;
@ -861,8 +861,8 @@ void transcendFunc(char* func, double* tt, int* ttPower)
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
add in scientific number format add in scientific number format
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void doAdd (double* operandOne, int* powerOne, static void doAdd (double* operandOne, int* powerOne,
double operandTwo, int powerTwo) double operandTwo, int powerTwo)
{ {
if ( *powerOne >= powerTwo ){ if ( *powerOne >= powerTwo ){
if (*powerOne - powerTwo <= DIGITLEN+1){ if (*powerOne - powerTwo <= DIGITLEN+1){
@ -891,8 +891,8 @@ void doAdd (double* operandOne, int* powerOne,
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
multiple in scientific number format multiple in scientific number format
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void doMultiple(double* operandOne, int* powerOne, static void doMultiple(double* operandOne, int* powerOne,
double operandTwo, int powerTwo) double operandTwo, int powerTwo)
{ {
(*operandOne) *= operandTwo; (*operandOne) *= operandTwo;
(*powerOne) += powerTwo; (*powerOne) += powerTwo;
@ -901,7 +901,7 @@ void doMultiple(double* operandOne, int* powerOne,
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
Handles all one operand calculations Handles all one operand calculations
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void oneOperand(void) static void oneOperand(void)
{ {
int k = 0; int k = 0;
if (buttonGroup == basicButtons){ if (buttonGroup == basicButtons){
@ -988,7 +988,7 @@ void oneOperand(void)
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
Handles all two operands calculations Handles all two operands calculations
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void twoOperands(void) static void twoOperands(void)
{ {
switch(oper){ switch(oper){
case '-': case '-':
@ -1048,7 +1048,7 @@ static void move_with_wrap_and_shift(
Print buttons when switching 1st and 2nd Print buttons when switching 1st and 2nd
int group = {basicButtons, sciButtons} int group = {basicButtons, sciButtons}
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void printButtonGroups(int group) static void printButtonGroups(int group)
{ {
drawButtons(group); drawButtons(group);
drawLines(); drawLines();
@ -1057,7 +1057,7 @@ void printButtonGroups(int group)
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
flash the currently marked button flash the currently marked button
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void flashButton(void) static void flashButton(void)
{ {
int k, w, h; int k, w, h;
for (k=2;k>0;k--) for (k=2;k>0;k--)
@ -1083,7 +1083,8 @@ void flashButton(void)
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
pos is the position that needs animation. pos = [1~18] 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; int k, w, h, x;
if (pos<1 || pos >18) if (pos<1 || pos >18)
@ -1102,6 +1103,7 @@ void deleteAnimation(int pos)
rb->sleep(HZ/32); rb->sleep(HZ/32);
} }
} }
#endif
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
result may be one of these formats: 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 0, let it be 0;
if result is close to 1, let it be 0.1 and power++; if result is close to 1, let it be 0.1 and power++;
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void formatResult(void) static void formatResult(void)
{ {
int resultsign = SIGN(result); int resultsign = SIGN(result);
result = ABS(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 middle
case temppower <= 0: print '.' in the begining case temppower <= 0: print '.' in the begining
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void result2typingbuf(void) static void result2typingbuf(void)
{ {
bool haveDot = false; bool haveDot = false;
char tempchar = 0; char tempchar = 0;
@ -1244,7 +1246,7 @@ void result2typingbuf(void)
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
printResult() generates LCD display. printResult() generates LCD display.
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void printResult(void) static void printResult(void)
{ {
int k, w, h; int k, w, h;
@ -1321,7 +1323,7 @@ void printResult(void)
Process typing buttons: 1-9, '.', sign Process typing buttons: 1-9, '.', sign
main operand "result" and typingbuf are processed seperately here. main operand "result" and typingbuf are processed seperately here.
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void typingProcess(void){ static void typingProcess(void){
switch( CAL_BUTTON ){ switch( CAL_BUTTON ){
case btn_sign: case btn_sign:
if (calStatus == cal_typing || if (calStatus == cal_typing ||
@ -1395,7 +1397,8 @@ void typingProcess(void){
Handle delete operation Handle delete operation
main operand "result" and typingbuf are processed seperately here. main operand "result" and typingbuf are processed seperately here.
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void doDelete(void){ #ifdef CALCULATOR_CLEAR
static void doDelete(void){
deleteAnimation(18); deleteAnimation(18);
switch(calStatus){ switch(calStatus){
case cal_dotted: case cal_dotted:
@ -1434,10 +1437,11 @@ void doDelete(void){
break; break;
} }
} }
#endif
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
Handle buttons on basic screen Handle buttons on basic screen
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void basicButtonsProcess(void){ static void basicButtonsProcess(void){
switch (btn) { switch (btn) {
case CALCULATOR_INPUT: case CALCULATOR_INPUT:
if (calStatus == cal_error && (CAL_BUTTON != btn_C) ) break; if (calStatus == cal_error && (CAL_BUTTON != btn_C) ) break;
@ -1538,7 +1542,7 @@ void basicButtonsProcess(void){
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
Handle buttons on scientific screen Handle buttons on scientific screen
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
void sciButtonsProcess(void){ static void sciButtonsProcess(void){
switch (btn) { switch (btn) {
case CALCULATOR_INPUT: case CALCULATOR_INPUT:
if (calStatus == cal_error && (CAL_BUTTON != sci_sci) ) break; if (calStatus == cal_error && (CAL_BUTTON != sci_sci) ) break;
@ -1613,7 +1617,7 @@ void sciButtonsProcess(void){
move button index move button index
Invert display new button, invert back previous button Invert display new button, invert back previous button
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
int handleButton(int button){ static int handleButton(int button){
switch(button) switch(button)
{ {
case CALCULATOR_INPUT: case CALCULATOR_INPUT:
@ -1721,9 +1725,6 @@ int handleButton(int button){
} }
return 0; return 0;
prev_btn_row = btn_row;
prev_btn_col = btn_col;
} }
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------

View file

@ -290,8 +290,7 @@ struct CTerrain mRoof;
static void chopDrawParticle(struct CParticle *mParticle); static void chopDrawParticle(struct CParticle *mParticle);
static void chopDrawBlock(struct CBlock *mBlock); static void chopDrawBlock(struct CBlock *mBlock);
static void chopRenderTerrain(struct CTerrain *ter, bool isground); static void chopRenderTerrain(struct CTerrain *ter, bool isground);
void chopper_load(bool newgame); static void chopper_load(bool newgame);
void cleanup_chopper(void);
static void chopDrawPlayer(int x,int y) /* These are SCREEN coords, not world!*/ 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); 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 i=1;
int iNewNodePos,g,v; int iNewNodePos,g,v;
@ -425,7 +424,7 @@ int chopUpdateTerrainRecycling(struct CTerrain *ter)
return 1; 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; 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); 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; int i;

View file

@ -78,7 +78,7 @@ struct line_color
* Compute a new random step to make the point bounce the borders of the screen * 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) if(step>0)
return -(MIN_STEP_RANGE + rb->rand() % (MAX_STEP_RANGE-MIN_STEP_RANGE)); 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) * 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; int i;
for(i=0;i<NB_POINTS;++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 * 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; int i;
for(i=0;i<NB_POINTS-1;++i) for(i=0;i<NB_POINTS-1;++i)
@ -144,7 +144,7 @@ struct polygon_move
struct point move_steps[NB_POINTS]; 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; int i;
for(i=0;i<NB_POINTS;++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 * Update the given polygon's position according to the given informations in
* polygon_move (polygon_move may be updated) * 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; int i, x, y, step;
for(i=0;i<NB_POINTS;++i) for(i=0;i<NB_POINTS;++i)
@ -208,14 +209,14 @@ struct polygon_fifo
struct polygon tab[MAX_POLYGONS]; 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_tail=0;
fifo->fifo_head=0; fifo->fifo_head=0;
fifo->nb_items=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) if(fifo->nb_items>=MAX_POLYGONS)
return; return;
@ -231,7 +232,7 @@ void fifo_push(struct polygon_fifo * fifo, struct polygon * polygon)
fifo->fifo_head=0; fifo->fifo_head=0;
} }
struct polygon * fifo_pop(struct polygon_fifo * fifo) static struct polygon * fifo_pop(struct polygon_fifo * fifo)
{ {
int index; int index;
if(fifo->nb_items==0) if(fifo->nb_items==0)
@ -248,7 +249,7 @@ struct polygon * fifo_pop(struct polygon_fifo * fifo)
* Drawing stuffs * 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; int i, j;
for(i=0, j=polygons->fifo_tail;i<polygons->nb_items;++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(); backlight_use_settings();
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
@ -268,14 +269,14 @@ void cleanup(void)
} }
#ifdef HAVE_LCD_COLOR #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->r = rb->rand()%255;
color->g = rb->rand()%255; color->g = rb->rand()%255;
color->b = 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_randomize(color);
color->current_r=color->r; color->current_r=color->r;
@ -283,7 +284,7 @@ void color_init(struct line_color * color)
color->current_b=color->b; 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) if(color->current_r<color->r)
++color->current_r; ++color->current_r;
@ -307,7 +308,7 @@ void color_change(struct line_color * color)
#define COLOR_RGBPACK(color) \ #define COLOR_RGBPACK(color) \
LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) 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){ if (display->is_color){
unsigned foreground= unsigned foreground=
@ -321,7 +322,7 @@ void color_apply(struct line_color * color, struct screen * display)
* Main function * Main function
*/ */
int plugin_main(void) static int plugin_main(void)
{ {
int action; int action;
int sleep_time=DEFAULT_WAIT_TIME; int sleep_time=DEFAULT_WAIT_TIME;

View file

@ -76,7 +76,7 @@ const struct button_mapping* plugin_contexts[]= {
#ifndef HAVE_LCD_COLOR #ifndef HAVE_LCD_COLOR
static unsigned char palette[256]; static unsigned char palette[256];
void color_palette_init(unsigned char* palette) static void color_palette_init(unsigned char* palette)
{ {
int i; int i;
for(i=0;i<=160;i++)//palette[i]=(3/2)*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 * the "The Demo Effects Collection" GPL project
* Copyright (C) 2002 W.P. van Paassen * Copyright (C) 2002 W.P. van Paassen
*/ */
void color_palette_init(fb_data* palette) static void color_palette_init(fb_data* palette)
{ {
int i; int i;
for (i = 0; i < 32; i++){ for (i = 0; i < 32; i++){
@ -268,7 +268,7 @@ static inline void fire_draw(struct fire* fire)
#endif #endif
} }
void cleanup(void *parameter) static void cleanup(void *parameter)
{ {
(void)parameter; (void)parameter;
#ifdef HAVE_ADJUSTABLE_CPU_FREQ #ifdef HAVE_ADJUSTABLE_CPU_FREQ
@ -283,7 +283,7 @@ void cleanup(void *parameter)
#ifndef HAVE_LCD_COLOR #ifndef HAVE_LCD_COLOR
int init_grey(void) static int init_grey(void)
{ {
unsigned char *gbuf; unsigned char *gbuf;
size_t gbuf_size = 0; size_t gbuf_size = 0;
@ -303,7 +303,7 @@ int init_grey(void)
} }
#endif #endif
int main(void) static int main(void)
{ {
int action; int action;

View file

@ -320,7 +320,7 @@ MENUITEM_STRINGLIST(menu, "Fireworks Menu", NULL,
"FPS (Speed)", "Playback Control", "Quit"); "FPS (Speed)", "Playback Control", "Quit");
/* called on startup. initializes all variables, etc */ /* called on startup. initializes all variables, etc */
void init_all(void) static void init_all(void)
{ {
int j; int j;
@ -333,7 +333,7 @@ void init_all(void)
/* called when a rocket hits its destination height. /* called when a rocket hits its destination height.
* prepares all associated fireworks to be expelled. */ * 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; int i;
@ -357,7 +357,7 @@ void init_explode(int x, int y, int firework, int points)
/* called when a rocket is launched. /* called when a rocket is launched.
* prepares said rocket to start moving towards its destination. */ * 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); rb->srand(*rb->current_tick);
@ -374,7 +374,7 @@ void init_rocket(int rocket)
} }
/* startup/configuration menu. */ /* startup/configuration menu. */
void fireworks_menu(void) static void fireworks_menu(void)
{ {
int selected = 0, result; int selected = 0, result;
bool menu_quit = false; bool menu_quit = false;

View file

@ -740,7 +740,7 @@ static inline fb_data get_pixel(int x, int y)
/* Draw "digits" least significant digits of num at (x,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 i;
int d; 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); draw_number(LEVEL_X + 2 * NUM_SPACING, PLAYFIELD_Y + 2, level, 2);
} }
void draw_lives(void) static void draw_lives(void)
{ {
int i; int i;
/* Lives num */ /* Lives num */
@ -872,7 +872,7 @@ static inline bool next_alien(void)
* Set curr_alien to first alive. * Set curr_alien to first alive.
* Return false if no-one is left alive. * Return false if no-one is left alive.
*/ */
bool first_alien(void) static bool first_alien(void)
{ {
int i, y; 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; 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_green = false;
bool hit_white = 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; int i, j, bomber;
bool abort; bool abort;
@ -1410,7 +1410,7 @@ static inline void move_ship(void)
/* Unidentified Flying Object */ /* Unidentified Flying Object */
void move_ufo(void) static void move_ufo(void)
{ {
static int ufo_speed; static int ufo_speed;
static int counter; 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); 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; int i;
@ -1604,7 +1604,7 @@ void new_level(void)
} }
void init_invadrox(void) static void init_invadrox(void)
{ {
int i; int i;
@ -1756,7 +1756,7 @@ check_usb:
} }
void game_loop(void) static void game_loop(void)
{ {
int i, end; int i, end;

View file

@ -381,28 +381,28 @@ typedef struct tile
/* the height and width of the field */ /* the height and width of the field */
#define MAX_HEIGHT (LCD_HEIGHT/TileSize) #define MAX_HEIGHT (LCD_HEIGHT/TileSize)
#define MAX_WIDTH (LCD_WIDTH/TileSize) #define MAX_WIDTH (LCD_WIDTH/TileSize)
int height = MAX_HEIGHT; static int height = MAX_HEIGHT;
int width = MAX_WIDTH; static int width = MAX_WIDTH;
int top; static int top;
int left; static int left;
/* The Minefield. Caution it is defined as Y, X! Not the opposite. */ /* 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 */ /* total number of mines on the game */
int mine_num = 0; static int mine_num = 0;
/* percentage of mines on minefield used during generation */ /* percentage of mines on minefield used during generation */
int percent = 16; static int percent = 16;
/* number of tiles left on the game */ /* number of tiles left on the game */
int tiles_left; static int tiles_left;
/* Because mines are set after the first move... */ /* 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. */ /* We need a stack (created on discover()) for the cascade algorithm. */
int stack_pos = 0; static int stack_pos = 0;
#ifdef HAVE_TOUCHSCREEN #ifdef HAVE_TOUCHSCREEN
@ -411,7 +411,7 @@ static struct ts_raster mine_raster = { 0, 0, MAX_WIDTH, MAX_HEIGHT, TileSize, T
#endif #endif
void push( int *stack, int y, int x ) static void push( int *stack, int y, int x )
{ {
if( stack_pos <= height*width ) 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. */ /* 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 if( x < 0 || y < 0 || x > width - 1 || y > height - 1
|| minefield[y][x].known || minefield[y][x].known
@ -433,14 +433,14 @@ void unveil( int *stack, int y, int x )
push( stack, y, 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 ) if( x >= 0 && y >= 0 && x < width && y < height && minefield[y][x].flag )
return 1; return 1;
return 0; return 0;
} }
int neighbors_flagged( int y, int x ) static int neighbors_flagged( int y, int x )
{ {
return is_flagged( y-1, x-1 ) + return is_flagged( y-1, x-1 ) +
is_flagged( y-1, x ) + is_flagged( y-1, x ) +
@ -453,7 +453,7 @@ int neighbors_flagged( int y, int x )
is_flagged( y+1, x+1 ); 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. */ /* Selected tile. */
if( x < 0 || y < 0 || x > width - 1 || y > height - 1) 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. */ /* Reset the whole board for a new game. */
void minesweeper_init( void ) static void minesweeper_init( void )
{ {
rb->memset(minefield, 0, sizeof(minefield)); rb->memset(minefield, 0, sizeof(minefield));
no_mines = true; no_mines = true;
@ -524,7 +524,7 @@ void minesweeper_init( void )
/* put mines on the mine field */ /* put mines on the mine field */
/* there is p% chance that a tile is a mine */ /* there is p% chance that a tile is a mine */
/* if the tile has coordinates (x,y), then it can't be 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; 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. /* 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. */ 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; int i, j, button;
@ -622,7 +622,7 @@ void mine_show( void )
#endif #endif
} }
int count_tiles_left( void ) static int count_tiles_left( void )
{ {
int tiles = 0; int tiles = 0;
int i, j; int i, j;
@ -633,7 +633,7 @@ int count_tiles_left( void )
return tiles; return tiles;
} }
int count_flags( void ) static int count_flags( void )
{ {
int flags = 0; int flags = 0;
int i, j; int i, j;
@ -645,7 +645,7 @@ int count_flags( void )
} }
/* welcome screen where player can chose mine percentage */ /* 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; int selection = 0, result = MINESWEEPER_QUIT;
bool menu_quit = false; bool menu_quit = false;
@ -698,7 +698,7 @@ enum minesweeper_status menu( void )
} }
/* the big and ugly game function */ /* the big and ugly game function */
enum minesweeper_status minesweeper( void ) static enum minesweeper_status minesweeper( void )
{ {
int i, j; int i, j;
int button; int button;

View file

@ -431,7 +431,7 @@ int font_height = 8;
/* implementation */ /* 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 cur_x, x;
int left, right, dl, dr; int left, right, dl, dr;
@ -609,7 +609,7 @@ void anim_horizontal(int cur_left, int cur_right)
last_pos = cur_x; 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 cur_y, y;
int left, right, dl, dr; int left, right, dl, dr;
@ -784,7 +784,7 @@ void anim_vertical(int cur_left, int cur_right)
last_pos = cur_y; last_pos = cur_y;
} }
void cleanup(void) static void cleanup(void)
{ {
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1
rb->lcd_set_foreground(LCD_DEFAULT_FG); rb->lcd_set_foreground(LCD_DEFAULT_FG);

View file

@ -83,7 +83,7 @@ static void wave_table_generate(void)
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
/* Make a smooth colour cycle. */ /* Make a smooth colour cycle. */
void shades_generate(int time) static void shades_generate(int time)
{ {
int i; int i;
unsigned red, green, blue; unsigned red, green, blue;
@ -129,7 +129,7 @@ static void shades_generate(void)
} }
#endif #endif
void cleanup(void) static void cleanup(void)
{ {
#ifdef HAVE_ADJUSTABLE_CPU_FREQ #ifdef HAVE_ADJUSTABLE_CPU_FREQ
if (boosted) if (boosted)
@ -150,7 +150,7 @@ void cleanup(void)
* algorithm. * algorithm.
*/ */
int main(void) static int main(void)
{ {
plasma_frequency = 1; plasma_frequency = 1;
int action, x, y; int action, x, y;

View file

@ -288,7 +288,7 @@ struct pong {
struct player player[2]; struct player player[2];
}; };
void singlepad(int x, int y, int set) static void singlepad(int x, int y, int set)
{ {
if(set) { if(set) {
rb->lcd_fillrect(x, y, PAD_WIDTH, PAD_HEIGHT); 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]; struct player *player = &p->player[pad];
/* clear existing pad */ /* clear existing pad */
@ -313,7 +313,7 @@ void pad(struct pong *p, int pad)
player->e_pad = player->w_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 /* we have already checked for pad-collision, just check if this hits
the wall */ 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 /* returns true if the ball has hit a pad, and then the info variable
will have extra angle info */ 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]; struct player *player = &p->player[pad];
int x = p->ball.x/RES; int x = p->ball.x/RES;
@ -366,7 +366,7 @@ bool padcollide(struct pong *p, int pad, int *info)
return false; /* nah */ 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; p->ball.speedx = -p->ball.speedx;
@ -410,7 +410,7 @@ void bounce(struct pong *p, int pad, int info)
#endif #endif
} }
void score(struct pong *p, int pad) static void score(struct pong *p, int pad)
{ {
if(pad) if(pad)
rb->splash(HZ/4, "right scores!"); rb->splash(HZ/4, "right scores!");
@ -436,7 +436,7 @@ void score(struct pong *p, int pad)
p->player[1].e_pad = -1; p->player[1].e_pad = -1;
} }
void ball(struct pong *p) static void ball(struct pong *p)
{ {
int oldx = p->ball.x/RES; int oldx = p->ball.x/RES;
int oldy = p->ball.y/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); rb->lcd_fillrect(newx, newy, BALL_WIDTH, BALL_HEIGHT);
} }
void padmove(int *pos, int dir) static void padmove(int *pos, int dir)
{ {
*pos += dir; *pos += dir;
if(*pos > (LCD_HEIGHT-PAD_HEIGHT)) if(*pos > (LCD_HEIGHT-PAD_HEIGHT))
@ -496,7 +496,7 @@ void padmove(int *pos, int dir)
*pos = 0; *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]; struct player *player = &p->player[pad];
if(player->iscpu) { 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; int key;
#ifdef PONG_PAUSE #ifdef PONG_PAUSE
@ -609,7 +609,7 @@ int keys(struct pong *p)
return 1; /* return 0 to exit game */ return 1; /* return 0 to exit game */
} }
void showscore(struct pong *p) static void showscore(struct pong *p)
{ {
static char buffer[20]; static char buffer[20];
int w; int w;
@ -620,7 +620,7 @@ void showscore(struct pong *p)
rb->lcd_putsxy( (LCD_WIDTH / 2) - (w / 2), 0, (unsigned char *)buffer); 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]; static char buffer[30];
int w; int w;

View file

@ -120,7 +120,7 @@ static inline unsigned char get_cell(int x, int y, char *pgrid) {
} }
/* clear grid */ /* clear grid */
void init_grid(char *pgrid){ static void init_grid(char *pgrid){
memset(pgrid, 0, GRID_W * GRID_H); memset(pgrid, 0, GRID_W * GRID_H);
} }

View file

@ -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; sc_entry_t entry;

View file

@ -359,7 +359,7 @@ static const fb_data * puzzle_bmp_ptr;
static const char * initial_bmp_path=NULL; static const char * initial_bmp_path=NULL;
#ifdef HAVE_ALBUMART #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(); struct mp3entry* track = rb->audio_current_track();
@ -374,10 +374,12 @@ const char * get_albumart_bmp_path(void)
} }
#endif #endif
const char * get_random_bmp_path(void) #if 0 /* unused */
static const char * get_random_bmp_path(void)
{ {
return(initial_bmp_path); return(initial_bmp_path);
} }
#endif
static bool load_resize_bitmap(void) static bool load_resize_bitmap(void)
{ {

View file

@ -245,7 +245,7 @@ static void update_timebar(struct mp3entry *mp3)
* Marks the entire area of the osci buffer invalid. * Marks the entire area of the osci buffer invalid.
* It will be drawn with new values in the next loop. * 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; osci_valid = false;
validation_start = ~(unsigned int)0; 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. * 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; return loop_mode;
} }
@ -300,7 +300,7 @@ static void update_icons(void)
/** /**
* Sets the loop mode. See the LOOP_MODE_XXX constants above. * 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; int old_loop_mode = loop_mode;
/* range restriction */ /* range restriction */
@ -386,7 +386,7 @@ static void set_range_by_time(
/** /**
* Set the split point in screen coordinates * 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; 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 * returns the split point in screen coordinates
*/ */
int splitedit_get_split_x(void) static int splitedit_get_split_x(void)
{ {
return split_x; return split_x;
} }
@ -502,7 +502,7 @@ static void scroll(struct mp3entry *mp3)
/** /**
* Zooms in by 3/4 * 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_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
rb->lcd_fillrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); 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 * 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_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
rb->lcd_fillrect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); 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 * The main loop of the editor
*/ */
unsigned long splitedit_editor(struct mp3entry * mp3_to_split, static unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
unsigned int split_time, unsigned int split_time,
unsigned int range) unsigned int range)
{ {
int button = BUTTON_NONE; int button = BUTTON_NONE;
int lastbutton = BUTTON_NONE; int lastbutton = BUTTON_NONE;

View file

@ -399,7 +399,7 @@ static inline void starfield_move_and_draw(struct starfield * starfield)
static struct starfield starfield; static struct starfield starfield;
int plugin_main(void) static int plugin_main(void)
{ {
int button, avg_peak, t_disp=0; int button, avg_peak, t_disp=0;
int font_h, font_w; int font_h, font_w;

View file

@ -65,7 +65,7 @@
/****************** prototypes ******************/ /****************** prototypes ******************/
void timer4_isr(void); /* IMIA4 ISR */ static void timer4_isr(void); /* IMIA4 ISR */
int check_button(void); /* determine next relative frame */ int check_button(void); /* determine next relative frame */
@ -207,7 +207,7 @@ tFileHeader gFileHdr; /* file header */
/****************** implementation ******************/ /****************** implementation ******************/
/* tool function: return how much playable audio/video is left */ /* 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) if (pSnapshot <= gBuf.pBufFill)
return gBuf.pBufFill - pSnapshot; return gBuf.pBufFill - pSnapshot;
@ -216,7 +216,7 @@ int Available(unsigned char* pSnapshot)
} }
/* debug function to draw buffer indicators */ /* debug function to draw buffer indicators */
void DrawBuf(void) static void DrawBuf(void)
{ {
int ypos, fill, video, audio; int ypos, fill, video, audio;
@ -247,7 +247,7 @@ void DrawBuf(void)
/* helper function to draw a position indicator */ /* helper function to draw a position indicator */
void DrawPosition(int pos, int total) static void DrawPosition(int pos, int total)
{ {
int w, h; int w, h;
int sec; /* estimated seconds */ int sec; /* estimated seconds */
@ -283,7 +283,7 @@ void DrawPosition(int pos, int total)
} }
/* Put text on OSD and activate it for 1 second */ /* Put text on OSD and activate it for 1 second */
void osd_show_text(void) static void osd_show_text(void)
{ {
int h, ypos; int h, ypos;
@ -305,7 +305,7 @@ void osd_show_text(void)
} }
/* helper function to change the volume by a certain amount, +/- */ /* 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 minvol = rb->sound_min(SOUND_VOLUME);
int maxvol = rb->sound_max(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, +/- */ /* 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 */ static int mycontrast = -1; /* the "permanent" value while running */
int contrast; /* updated value */ int contrast; /* updated value */
@ -348,7 +348,7 @@ void ChangeContrast(int delta)
/* sync the video to the current audio */ /* sync the video to the current audio */
void SyncVideo(void) static void SyncVideo(void)
{ {
tAudioFrameHeader* pAudioBuf; tAudioFrameHeader* pAudioBuf;
@ -370,7 +370,7 @@ void SyncVideo(void)
/* timer interrupt handler to display a frame */ /* timer interrupt handler to display a frame */
void timer4_isr(void) static void timer4_isr(void)
{ {
int available; int available;
tAudioFrameHeader* pAudioBuf; tAudioFrameHeader* pAudioBuf;
@ -446,7 +446,7 @@ void timer4_isr(void)
/* ISR function to get more mp3 data */ /* 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 available;
int advance; int advance;
@ -476,7 +476,7 @@ void GetMoreMp3(unsigned char** start, size_t* size)
} }
int WaitForButton(void) static int WaitForButton(void)
{ {
int button; int button;
@ -490,7 +490,7 @@ int WaitForButton(void)
} }
bool WantResume(int fd) static bool WantResume(int fd)
{ {
int button; 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; 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 */ /* 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 */ 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) */ /* returns >0 if continue, =0 to stop, <0 to abort (USB) */
int PlayTick(int fd) static int PlayTick(int fd)
{ {
int button; int button;
static int lastbutton = 0; 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 file_size;
int fd; /* file descriptor handle */ int fd; /* file descriptor handle */

View file

@ -433,7 +433,7 @@ struct saved_settings {
int digital_decay; int digital_decay;
} vumeter_settings; } vumeter_settings;
void reset_settings(void) { static void reset_settings(void) {
vumeter_settings.meter_type=ANALOG; vumeter_settings.meter_type=ANALOG;
vumeter_settings.analog_use_db_scale=true; vumeter_settings.analog_use_db_scale=true;
vumeter_settings.digital_use_db_scale=true; vumeter_settings.digital_use_db_scale=true;
@ -443,7 +443,7 @@ void reset_settings(void) {
vumeter_settings.digital_decay=0; 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 fx_log_factor = E_POW_5/half_width;
unsigned int y,z; 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); int fp = rb->open(PLUGIN_DEMOS_DATA_DIR "/.vu_meter", O_RDONLY);
if(fp>=0) { if(fp>=0) {
rb->read(fp, &vumeter_settings, sizeof(struct saved_settings)); 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); int fp = rb->creat(PLUGIN_DEMOS_DATA_DIR "/.vu_meter", 0666);
if(fp >= 0) { if(fp >= 0) {
rb->write (fp, &vumeter_settings, sizeof(struct saved_settings)); 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 minvol = rb->sound_min(SOUND_VOLUME);
int maxvol = rb->sound_max(SOUND_VOLUME); int maxvol = rb->sound_max(SOUND_VOLUME);
int vol = rb->global_settings->volume + delta; int vol = rb->global_settings->volume + delta;
@ -602,7 +602,7 @@ static bool vu_meter_menu(void)
return exit; 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_mono_bitmap(sound_speaker, quarter_width-28, 12, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_set_drawmode(DRMODE_FG);
if(analog_mini_1<left_needle_top_x) if(analog_mini_1<left_needle_top_x)
@ -628,7 +628,7 @@ void draw_analog_minimeters(void) {
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
} }
void draw_digital_minimeters(void) { static void draw_digital_minimeters(void) {
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
rb->lcd_set_foreground(LCD_RGBPACK(255, 255 - 23 * num_left_leds, 0)); rb->lcd_set_foreground(LCD_RGBPACK(255, 255 - 23 * num_left_leds, 0));
#endif #endif
@ -664,7 +664,7 @@ void draw_digital_minimeters(void) {
#endif #endif
} }
void analog_meter(void) { static void analog_meter(void) {
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
int left_peak = rb->mas_codec_readreg(0xC); 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) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
int left_peak = rb->mas_codec_readreg(0xC); int left_peak = rb->mas_codec_readreg(0xC);
int right_peak = rb->mas_codec_readreg(0xD); int right_peak = rb->mas_codec_readreg(0xD);