diff options
Diffstat (limited to 'apps/plugins')
-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 */ | |||
546 | } calStatus; | 546 | } calStatus; |
547 | 547 | ||
548 | /* constant table for CORDIC algorithm */ | 548 | /* constant table for CORDIC algorithm */ |
549 | double cordicTable[51][2]= { | 549 | static const double cordicTable[51][2]= { |
550 | /* pow(2,0) - pow(2,-50) atan(pow(2,0) - atan(pow(2,-50) */ | 550 | /* pow(2,0) - pow(2,-50) atan(pow(2,0) - atan(pow(2,-50) */ |
551 | {1e+00, 7.853981633974483e-01}, | 551 | {1e+00, 7.853981633974483e-01}, |
552 | {5e-01, 4.636476090008061e-01}, | 552 | {5e-01, 4.636476090008061e-01}, |
@@ -601,21 +601,21 @@ double cordicTable[51][2]= { | |||
601 | {8.8817841970012523233890533447265625e-16, 8.881784197001252e-16} | 601 | {8.8817841970012523233890533447265625e-16, 8.881784197001252e-16} |
602 | }; | 602 | }; |
603 | 603 | ||
604 | void doMultiple(double* operandOne, int* powerOne, | 604 | static void doMultiple(double* operandOne, int* powerOne, |
605 | double operandTwo, int powerTwo); | 605 | double operandTwo, int powerTwo); |
606 | void doAdd (double* operandOne, int* powerOne, | 606 | static void doAdd (double* operandOne, int* powerOne, |
607 | double operandTwo, int powerTwo); | 607 | double operandTwo, int powerTwo); |
608 | void printResult(void); | 608 | static void printResult(void); |
609 | void formatResult(void); | 609 | static void formatResult(void); |
610 | void oneOperand(void); | 610 | static void oneOperand(void); |
611 | 611 | ||
612 | void drawLines(void); | 612 | static void drawLines(void); |
613 | void drawButtons(int group); | 613 | static void drawButtons(int group); |
614 | 614 | ||
615 | /* ----------------------------------------------------------------------- | 615 | /* ----------------------------------------------------------------------- |
616 | Handy funtions | 616 | Handy functions |
617 | ----------------------------------------------------------------------- */ | 617 | ----------------------------------------------------------------------- */ |
618 | void cleartypingbuf(void) | 618 | static void cleartypingbuf(void) |
619 | { | 619 | { |
620 | int k; | 620 | int k; |
621 | for( k=1; k<=(DIGITLEN+1); k++) | 621 | for( k=1; k<=(DIGITLEN+1); k++) |
@@ -623,21 +623,21 @@ void cleartypingbuf(void) | |||
623 | typingbuf[0] = ' '; | 623 | typingbuf[0] = ' '; |
624 | typingbufPointer = typingbuf+1; | 624 | typingbufPointer = typingbuf+1; |
625 | } | 625 | } |
626 | void clearbuf(void) | 626 | static void clearbuf(void) |
627 | { | 627 | { |
628 | int k; | 628 | int k; |
629 | for(k=0;k<18;k++) | 629 | for(k=0;k<18;k++) |
630 | buf[k]=' '; | 630 | buf[k]=' '; |
631 | buf[18] = 0; | 631 | buf[18] = 0; |
632 | } | 632 | } |
633 | void clearResult(void) | 633 | static void clearResult(void) |
634 | { | 634 | { |
635 | result = 0; | 635 | result = 0; |
636 | power = 0; | 636 | power = 0; |
637 | modifier = 0.1; | 637 | modifier = 0.1; |
638 | } | 638 | } |
639 | 639 | ||
640 | void clearInput(void) | 640 | static void clearInput(void) |
641 | { | 641 | { |
642 | calStatus = cal_normal; | 642 | calStatus = cal_normal; |
643 | clearResult(); | 643 | clearResult(); |
@@ -647,25 +647,25 @@ void clearInput(void) | |||
647 | drawLines(); | 647 | drawLines(); |
648 | } | 648 | } |
649 | 649 | ||
650 | void clearOperand(void) | 650 | static void clearOperand(void) |
651 | { | 651 | { |
652 | operand = 0; | 652 | operand = 0; |
653 | operandPower = 0; | 653 | operandPower = 0; |
654 | } | 654 | } |
655 | 655 | ||
656 | void clearMemTemp(void) | 656 | static void clearMemTemp(void) |
657 | { | 657 | { |
658 | memTemp = 0; | 658 | memTemp = 0; |
659 | memTempPower = 0; | 659 | memTempPower = 0; |
660 | } | 660 | } |
661 | 661 | ||
662 | void clearOper(void) | 662 | static void clearOper(void) |
663 | { | 663 | { |
664 | oper = ' '; | 664 | oper = ' '; |
665 | operInputted = false; | 665 | operInputted = false; |
666 | } | 666 | } |
667 | 667 | ||
668 | void clearMem(void) | 668 | static void clearMem(void) |
669 | { | 669 | { |
670 | clearInput(); | 670 | clearInput(); |
671 | clearMemTemp(); | 671 | clearMemTemp(); |
@@ -674,7 +674,7 @@ void clearMem(void) | |||
674 | btn = BUTTON_NONE; | 674 | btn = BUTTON_NONE; |
675 | } | 675 | } |
676 | 676 | ||
677 | void switchOperands(void) | 677 | static void switchOperands(void) |
678 | { | 678 | { |
679 | double tempr = operand; | 679 | double tempr = operand; |
680 | int tempp = operandPower; | 680 | int tempp = operandPower; |
@@ -684,7 +684,7 @@ void switchOperands(void) | |||
684 | power = tempp; | 684 | power = tempp; |
685 | } | 685 | } |
686 | 686 | ||
687 | void drawLines(void) | 687 | static void drawLines(void) |
688 | { | 688 | { |
689 | int i; | 689 | int i; |
690 | rb->lcd_hline(0, LCD_WIDTH, Y_1_POS-1); | 690 | rb->lcd_hline(0, LCD_WIDTH, Y_1_POS-1); |
@@ -694,7 +694,7 @@ void drawLines(void) | |||
694 | rb->lcd_vline(X_1_POS+i*REC_WIDTH, Y_1_POS, LCD_HEIGHT); | 694 | rb->lcd_vline(X_1_POS+i*REC_WIDTH, Y_1_POS, LCD_HEIGHT); |
695 | } | 695 | } |
696 | 696 | ||
697 | void drawButtons(int group) | 697 | static void drawButtons(int group) |
698 | { | 698 | { |
699 | int i, j, w, h; | 699 | int i, j, w, h; |
700 | for (i = 0; i <= 4; i++){ | 700 | for (i = 0; i <= 4; i++){ |
@@ -722,7 +722,7 @@ void drawButtons(int group) | |||
722 | /* ----------------------------------------------------------------------- | 722 | /* ----------------------------------------------------------------------- |
723 | Initiate calculator | 723 | Initiate calculator |
724 | ----------------------------------------------------------------------- */ | 724 | ----------------------------------------------------------------------- */ |
725 | void cal_initial (void) | 725 | static void cal_initial (void) |
726 | { | 726 | { |
727 | int w,h; | 727 | int w,h; |
728 | 728 | ||
@@ -761,7 +761,7 @@ void cal_initial (void) | |||
761 | in it's private case for sqrt. | 761 | in it's private case for sqrt. |
762 | Thanks BlueChip for his intro text and Dave Straayer for the actual name. | 762 | Thanks BlueChip for his intro text and Dave Straayer for the actual name. |
763 | ----------------------------------------------------------------------- */ | 763 | ----------------------------------------------------------------------- */ |
764 | double mySqrt(double square) | 764 | static double mySqrt(double square) |
765 | { | 765 | { |
766 | int k = 0; | 766 | int k = 0; |
767 | double temp = 0; | 767 | double temp = 0; |
@@ -781,7 +781,7 @@ double mySqrt(double square) | |||
781 | transcendFunc can do sin,cos,log,exp | 781 | transcendFunc can do sin,cos,log,exp |
782 | input parameter is angle | 782 | input parameter is angle |
783 | ----------------------------------------------------------------------- */ | 783 | ----------------------------------------------------------------------- */ |
784 | void transcendFunc(char* func, double* tt, int* ttPower) | 784 | static void transcendFunc(char* func, double* tt, int* ttPower) |
785 | { | 785 | { |
786 | double t = (*tt)*M_PI/180; int tPower = *ttPower; | 786 | double t = (*tt)*M_PI/180; int tPower = *ttPower; |
787 | int sign = 1; | 787 | int sign = 1; |
@@ -861,8 +861,8 @@ void transcendFunc(char* func, double* tt, int* ttPower) | |||
861 | /* ----------------------------------------------------------------------- | 861 | /* ----------------------------------------------------------------------- |
862 | add in scientific number format | 862 | add in scientific number format |
863 | ----------------------------------------------------------------------- */ | 863 | ----------------------------------------------------------------------- */ |
864 | void doAdd (double* operandOne, int* powerOne, | 864 | static void doAdd (double* operandOne, int* powerOne, |
865 | double operandTwo, int powerTwo) | 865 | double operandTwo, int powerTwo) |
866 | { | 866 | { |
867 | if ( *powerOne >= powerTwo ){ | 867 | if ( *powerOne >= powerTwo ){ |
868 | if (*powerOne - powerTwo <= DIGITLEN+1){ | 868 | if (*powerOne - powerTwo <= DIGITLEN+1){ |
@@ -891,8 +891,8 @@ void doAdd (double* operandOne, int* powerOne, | |||
891 | /* ----------------------------------------------------------------------- | 891 | /* ----------------------------------------------------------------------- |
892 | multiple in scientific number format | 892 | multiple in scientific number format |
893 | ----------------------------------------------------------------------- */ | 893 | ----------------------------------------------------------------------- */ |
894 | void doMultiple(double* operandOne, int* powerOne, | 894 | static void doMultiple(double* operandOne, int* powerOne, |
895 | double operandTwo, int powerTwo) | 895 | double operandTwo, int powerTwo) |
896 | { | 896 | { |
897 | (*operandOne) *= operandTwo; | 897 | (*operandOne) *= operandTwo; |
898 | (*powerOne) += powerTwo; | 898 | (*powerOne) += powerTwo; |
@@ -901,7 +901,7 @@ void doMultiple(double* operandOne, int* powerOne, | |||
901 | /* ----------------------------------------------------------------------- | 901 | /* ----------------------------------------------------------------------- |
902 | Handles all one operand calculations | 902 | Handles all one operand calculations |
903 | ----------------------------------------------------------------------- */ | 903 | ----------------------------------------------------------------------- */ |
904 | void oneOperand(void) | 904 | static void oneOperand(void) |
905 | { | 905 | { |
906 | int k = 0; | 906 | int k = 0; |
907 | if (buttonGroup == basicButtons){ | 907 | if (buttonGroup == basicButtons){ |
@@ -988,7 +988,7 @@ void oneOperand(void) | |||
988 | /* ----------------------------------------------------------------------- | 988 | /* ----------------------------------------------------------------------- |
989 | Handles all two operands calculations | 989 | Handles all two operands calculations |
990 | ----------------------------------------------------------------------- */ | 990 | ----------------------------------------------------------------------- */ |
991 | void twoOperands(void) | 991 | static void twoOperands(void) |
992 | { | 992 | { |
993 | switch(oper){ | 993 | switch(oper){ |
994 | case '-': | 994 | case '-': |
@@ -1048,7 +1048,7 @@ static void move_with_wrap_and_shift( | |||
1048 | Print buttons when switching 1st and 2nd | 1048 | Print buttons when switching 1st and 2nd |
1049 | int group = {basicButtons, sciButtons} | 1049 | int group = {basicButtons, sciButtons} |
1050 | ----------------------------------------------------------------------- */ | 1050 | ----------------------------------------------------------------------- */ |
1051 | void printButtonGroups(int group) | 1051 | static void printButtonGroups(int group) |
1052 | { | 1052 | { |
1053 | drawButtons(group); | 1053 | drawButtons(group); |
1054 | drawLines(); | 1054 | drawLines(); |
@@ -1057,7 +1057,7 @@ void printButtonGroups(int group) | |||
1057 | /* ----------------------------------------------------------------------- | 1057 | /* ----------------------------------------------------------------------- |
1058 | flash the currently marked button | 1058 | flash the currently marked button |
1059 | ----------------------------------------------------------------------- */ | 1059 | ----------------------------------------------------------------------- */ |
1060 | void flashButton(void) | 1060 | static void flashButton(void) |
1061 | { | 1061 | { |
1062 | int k, w, h; | 1062 | int k, w, h; |
1063 | for (k=2;k>0;k--) | 1063 | for (k=2;k>0;k--) |
@@ -1083,7 +1083,8 @@ void flashButton(void) | |||
1083 | /* ----------------------------------------------------------------------- | 1083 | /* ----------------------------------------------------------------------- |
1084 | pos is the position that needs animation. pos = [1~18] | 1084 | pos is the position that needs animation. pos = [1~18] |
1085 | ----------------------------------------------------------------------- */ | 1085 | ----------------------------------------------------------------------- */ |
1086 | void deleteAnimation(int pos) | 1086 | #if defined(CALCULATOR_CLEAR) || defined(CALCULATOR_OPERATORS) |
1087 | static void deleteAnimation(int pos) | ||
1087 | { | 1088 | { |
1088 | int k, w, h, x; | 1089 | int k, w, h, x; |
1089 | if (pos<1 || pos >18) | 1090 | if (pos<1 || pos >18) |
@@ -1102,6 +1103,7 @@ void deleteAnimation(int pos) | |||
1102 | rb->sleep(HZ/32); | 1103 | rb->sleep(HZ/32); |
1103 | } | 1104 | } |
1104 | } | 1105 | } |
1106 | #endif | ||
1105 | 1107 | ||
1106 | /* ----------------------------------------------------------------------- | 1108 | /* ----------------------------------------------------------------------- |
1107 | result may be one of these formats: | 1109 | result may be one of these formats: |
@@ -1114,7 +1116,7 @@ formatResult() change result to standard format: 0.xxxx | |||
1114 | if result is close to 0, let it be 0; | 1116 | if result is close to 0, let it be 0; |
1115 | if result is close to 1, let it be 0.1 and power++; | 1117 | if result is close to 1, let it be 0.1 and power++; |
1116 | ----------------------------------------------------------------------- */ | 1118 | ----------------------------------------------------------------------- */ |
1117 | void formatResult(void) | 1119 | static void formatResult(void) |
1118 | { | 1120 | { |
1119 | int resultsign = SIGN(result); | 1121 | int resultsign = SIGN(result); |
1120 | result = ABS(result); | 1122 | result = ABS(result); |
@@ -1160,7 +1162,7 @@ case SCIENTIFIC_FORMAT, let temppower = 1; | |||
1160 | case temppower > 0: print '.' in the middle | 1162 | case temppower > 0: print '.' in the middle |
1161 | case temppower <= 0: print '.' in the begining | 1163 | case temppower <= 0: print '.' in the begining |
1162 | ----------------------------------------------------------------------- */ | 1164 | ----------------------------------------------------------------------- */ |
1163 | void result2typingbuf(void) | 1165 | static void result2typingbuf(void) |
1164 | { | 1166 | { |
1165 | bool haveDot = false; | 1167 | bool haveDot = false; |
1166 | char tempchar = 0; | 1168 | char tempchar = 0; |
@@ -1244,7 +1246,7 @@ void result2typingbuf(void) | |||
1244 | /* ----------------------------------------------------------------------- | 1246 | /* ----------------------------------------------------------------------- |
1245 | printResult() generates LCD display. | 1247 | printResult() generates LCD display. |
1246 | ----------------------------------------------------------------------- */ | 1248 | ----------------------------------------------------------------------- */ |
1247 | void printResult(void) | 1249 | static void printResult(void) |
1248 | { | 1250 | { |
1249 | int k, w, h; | 1251 | int k, w, h; |
1250 | 1252 | ||
@@ -1321,7 +1323,7 @@ void printResult(void) | |||
1321 | Process typing buttons: 1-9, '.', sign | 1323 | Process typing buttons: 1-9, '.', sign |
1322 | main operand "result" and typingbuf are processed seperately here. | 1324 | main operand "result" and typingbuf are processed seperately here. |
1323 | ----------------------------------------------------------------------- */ | 1325 | ----------------------------------------------------------------------- */ |
1324 | void typingProcess(void){ | 1326 | static void typingProcess(void){ |
1325 | switch( CAL_BUTTON ){ | 1327 | switch( CAL_BUTTON ){ |
1326 | case btn_sign: | 1328 | case btn_sign: |
1327 | if (calStatus == cal_typing || | 1329 | if (calStatus == cal_typing || |
@@ -1395,7 +1397,8 @@ void typingProcess(void){ | |||
1395 | Handle delete operation | 1397 | Handle delete operation |
1396 | main operand "result" and typingbuf are processed seperately here. | 1398 | main operand "result" and typingbuf are processed seperately here. |
1397 | ----------------------------------------------------------------------- */ | 1399 | ----------------------------------------------------------------------- */ |
1398 | void doDelete(void){ | 1400 | #ifdef CALCULATOR_CLEAR |
1401 | static void doDelete(void){ | ||
1399 | deleteAnimation(18); | 1402 | deleteAnimation(18); |
1400 | switch(calStatus){ | 1403 | switch(calStatus){ |
1401 | case cal_dotted: | 1404 | case cal_dotted: |
@@ -1434,10 +1437,11 @@ void doDelete(void){ | |||
1434 | break; | 1437 | break; |
1435 | } | 1438 | } |
1436 | } | 1439 | } |
1440 | #endif | ||
1437 | /* ----------------------------------------------------------------------- | 1441 | /* ----------------------------------------------------------------------- |
1438 | Handle buttons on basic screen | 1442 | Handle buttons on basic screen |
1439 | ----------------------------------------------------------------------- */ | 1443 | ----------------------------------------------------------------------- */ |
1440 | void basicButtonsProcess(void){ | 1444 | static void basicButtonsProcess(void){ |
1441 | switch (btn) { | 1445 | switch (btn) { |
1442 | case CALCULATOR_INPUT: | 1446 | case CALCULATOR_INPUT: |
1443 | if (calStatus == cal_error && (CAL_BUTTON != btn_C) ) break; | 1447 | if (calStatus == cal_error && (CAL_BUTTON != btn_C) ) break; |
@@ -1538,7 +1542,7 @@ void basicButtonsProcess(void){ | |||
1538 | /* ----------------------------------------------------------------------- | 1542 | /* ----------------------------------------------------------------------- |
1539 | Handle buttons on scientific screen | 1543 | Handle buttons on scientific screen |
1540 | ----------------------------------------------------------------------- */ | 1544 | ----------------------------------------------------------------------- */ |
1541 | void sciButtonsProcess(void){ | 1545 | static void sciButtonsProcess(void){ |
1542 | switch (btn) { | 1546 | switch (btn) { |
1543 | case CALCULATOR_INPUT: | 1547 | case CALCULATOR_INPUT: |
1544 | if (calStatus == cal_error && (CAL_BUTTON != sci_sci) ) break; | 1548 | if (calStatus == cal_error && (CAL_BUTTON != sci_sci) ) break; |
@@ -1613,7 +1617,7 @@ void sciButtonsProcess(void){ | |||
1613 | move button index | 1617 | move button index |
1614 | Invert display new button, invert back previous button | 1618 | Invert display new button, invert back previous button |
1615 | ----------------------------------------------------------------------- */ | 1619 | ----------------------------------------------------------------------- */ |
1616 | int handleButton(int button){ | 1620 | static int handleButton(int button){ |
1617 | switch(button) | 1621 | switch(button) |
1618 | { | 1622 | { |
1619 | case CALCULATOR_INPUT: | 1623 | case CALCULATOR_INPUT: |
@@ -1721,9 +1725,6 @@ int handleButton(int button){ | |||
1721 | } | 1725 | } |
1722 | 1726 | ||
1723 | return 0; | 1727 | return 0; |
1724 | |||
1725 | prev_btn_row = btn_row; | ||
1726 | prev_btn_col = btn_col; | ||
1727 | } | 1728 | } |
1728 | 1729 | ||
1729 | /* ----------------------------------------------------------------------- | 1730 | /* ----------------------------------------------------------------------- |
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; | |||
290 | static void chopDrawParticle(struct CParticle *mParticle); | 290 | static void chopDrawParticle(struct CParticle *mParticle); |
291 | static void chopDrawBlock(struct CBlock *mBlock); | 291 | static void chopDrawBlock(struct CBlock *mBlock); |
292 | static void chopRenderTerrain(struct CTerrain *ter, bool isground); | 292 | static void chopRenderTerrain(struct CTerrain *ter, bool isground); |
293 | void chopper_load(bool newgame); | 293 | static void chopper_load(bool newgame); |
294 | void cleanup_chopper(void); | ||
295 | 294 | ||
296 | static void chopDrawPlayer(int x,int y) /* These are SCREEN coords, not world!*/ | 295 | static void chopDrawPlayer(int x,int y) /* These are SCREEN coords, not world!*/ |
297 | { | 296 | { |
@@ -335,7 +334,7 @@ static void chopClearTerrain(struct CTerrain *ter) | |||
335 | } | 334 | } |
336 | 335 | ||
337 | 336 | ||
338 | int iR(int low,int high) | 337 | static int iR(int low,int high) |
339 | { | 338 | { |
340 | return low+rb->rand()%(high-low+1); | 339 | return low+rb->rand()%(high-low+1); |
341 | } | 340 | } |
@@ -394,7 +393,7 @@ static void chopTerrainNodeDeleteAndShift(struct CTerrain *ter,int nodeIndex) | |||
394 | 393 | ||
395 | } | 394 | } |
396 | 395 | ||
397 | int chopUpdateTerrainRecycling(struct CTerrain *ter) | 396 | static int chopUpdateTerrainRecycling(struct CTerrain *ter) |
398 | { | 397 | { |
399 | int i=1; | 398 | int i=1; |
400 | int iNewNodePos,g,v; | 399 | int iNewNodePos,g,v; |
@@ -425,7 +424,7 @@ int chopUpdateTerrainRecycling(struct CTerrain *ter) | |||
425 | return 1; | 424 | return 1; |
426 | } | 425 | } |
427 | 426 | ||
428 | int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX) | 427 | static int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX) |
429 | { | 428 | { |
430 | 429 | ||
431 | int iNodeIndexOne=0,iNodeIndexTwo=0, h, terY1, terY2, terX2, a, b; | 430 | int iNodeIndexOne=0,iNodeIndexTwo=0, h, terY1, terY2, terX2, a, b; |
@@ -462,7 +461,7 @@ int chopTerrainHeightAtPoint(struct CTerrain *ter, int pX) | |||
462 | 461 | ||
463 | } | 462 | } |
464 | 463 | ||
465 | int chopPointInTerrain(struct CTerrain *ter, int pX, int pY, int iTestType) | 464 | static int chopPointInTerrain(struct CTerrain *ter, int pX, int pY, int iTestType) |
466 | { | 465 | { |
467 | int h = chopTerrainHeightAtPoint(ter, pX); | 466 | int h = chopTerrainHeightAtPoint(ter, pX); |
468 | 467 | ||
@@ -990,7 +989,7 @@ static void chopRenderTerrain(struct CTerrain *ter, bool isground) | |||
990 | } | 989 | } |
991 | } | 990 | } |
992 | 991 | ||
993 | void chopper_load(bool newgame) | 992 | static void chopper_load(bool newgame) |
994 | { | 993 | { |
995 | 994 | ||
996 | int i; | 995 | 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 | |||
78 | * Compute a new random step to make the point bounce the borders of the screen | 78 | * Compute a new random step to make the point bounce the borders of the screen |
79 | */ | 79 | */ |
80 | 80 | ||
81 | int get_new_step(int step) | 81 | static int get_new_step(int step) |
82 | { | 82 | { |
83 | if(step>0) | 83 | if(step>0) |
84 | return -(MIN_STEP_RANGE + rb->rand() % (MAX_STEP_RANGE-MIN_STEP_RANGE)); | 84 | return -(MIN_STEP_RANGE + rb->rand() % (MAX_STEP_RANGE-MIN_STEP_RANGE)); |
@@ -108,7 +108,7 @@ struct polygon | |||
108 | /* | 108 | /* |
109 | * Generates a random polygon (which fits the screen size though) | 109 | * Generates a random polygon (which fits the screen size though) |
110 | */ | 110 | */ |
111 | void polygon_init(struct polygon * polygon, struct screen * display) | 111 | static void polygon_init(struct polygon * polygon, struct screen * display) |
112 | { | 112 | { |
113 | int i; | 113 | int i; |
114 | for(i=0;i<NB_POINTS;++i) | 114 | for(i=0;i<NB_POINTS;++i) |
@@ -122,7 +122,7 @@ void polygon_init(struct polygon * polygon, struct screen * display) | |||
122 | * Draw the given polygon onto the screen | 122 | * Draw the given polygon onto the screen |
123 | */ | 123 | */ |
124 | 124 | ||
125 | void polygon_draw(struct polygon * polygon, struct screen * display) | 125 | static void polygon_draw(struct polygon * polygon, struct screen * display) |
126 | { | 126 | { |
127 | int i; | 127 | int i; |
128 | for(i=0;i<NB_POINTS-1;++i) | 128 | for(i=0;i<NB_POINTS-1;++i) |
@@ -144,7 +144,7 @@ struct polygon_move | |||
144 | struct point move_steps[NB_POINTS]; | 144 | struct point move_steps[NB_POINTS]; |
145 | }; | 145 | }; |
146 | 146 | ||
147 | void polygon_move_init(struct polygon_move * polygon_move) | 147 | static void polygon_move_init(struct polygon_move * polygon_move) |
148 | { | 148 | { |
149 | int i; | 149 | int i; |
150 | for(i=0;i<NB_POINTS;++i) | 150 | for(i=0;i<NB_POINTS;++i) |
@@ -159,7 +159,8 @@ void polygon_move_init(struct polygon_move * polygon_move) | |||
159 | * Update the given polygon's position according to the given informations in | 159 | * Update the given polygon's position according to the given informations in |
160 | * polygon_move (polygon_move may be updated) | 160 | * polygon_move (polygon_move may be updated) |
161 | */ | 161 | */ |
162 | void polygon_update(struct polygon *polygon, struct screen * display, struct polygon_move *polygon_move) | 162 | static void polygon_update(struct polygon *polygon, struct screen * display, |
163 | struct polygon_move *polygon_move) | ||
163 | { | 164 | { |
164 | int i, x, y, step; | 165 | int i, x, y, step; |
165 | for(i=0;i<NB_POINTS;++i) | 166 | for(i=0;i<NB_POINTS;++i) |
@@ -208,14 +209,14 @@ struct polygon_fifo | |||
208 | struct polygon tab[MAX_POLYGONS]; | 209 | struct polygon tab[MAX_POLYGONS]; |
209 | }; | 210 | }; |
210 | 211 | ||
211 | void fifo_init(struct polygon_fifo * fifo) | 212 | static void fifo_init(struct polygon_fifo * fifo) |
212 | { | 213 | { |
213 | fifo->fifo_tail=0; | 214 | fifo->fifo_tail=0; |
214 | fifo->fifo_head=0; | 215 | fifo->fifo_head=0; |
215 | fifo->nb_items=0; | 216 | fifo->nb_items=0; |
216 | } | 217 | } |
217 | 218 | ||
218 | void fifo_push(struct polygon_fifo * fifo, struct polygon * polygon) | 219 | static void fifo_push(struct polygon_fifo * fifo, struct polygon * polygon) |
219 | { | 220 | { |
220 | if(fifo->nb_items>=MAX_POLYGONS) | 221 | if(fifo->nb_items>=MAX_POLYGONS) |
221 | return; | 222 | return; |
@@ -231,7 +232,7 @@ void fifo_push(struct polygon_fifo * fifo, struct polygon * polygon) | |||
231 | fifo->fifo_head=0; | 232 | fifo->fifo_head=0; |
232 | } | 233 | } |
233 | 234 | ||
234 | struct polygon * fifo_pop(struct polygon_fifo * fifo) | 235 | static struct polygon * fifo_pop(struct polygon_fifo * fifo) |
235 | { | 236 | { |
236 | int index; | 237 | int index; |
237 | if(fifo->nb_items==0) | 238 | if(fifo->nb_items==0) |
@@ -248,7 +249,7 @@ struct polygon * fifo_pop(struct polygon_fifo * fifo) | |||
248 | * Drawing stuffs | 249 | * Drawing stuffs |
249 | */ | 250 | */ |
250 | 251 | ||
251 | void polygons_draw(struct polygon_fifo * polygons, struct screen * display) | 252 | static void polygons_draw(struct polygon_fifo * polygons, struct screen * display) |
252 | { | 253 | { |
253 | int i, j; | 254 | int i, j; |
254 | for(i=0, j=polygons->fifo_tail;i<polygons->nb_items;++i, ++j) | 255 | 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) | |||
259 | } | 260 | } |
260 | } | 261 | } |
261 | 262 | ||
262 | void cleanup(void) | 263 | static void cleanup(void) |
263 | { | 264 | { |
264 | backlight_use_settings(); | 265 | backlight_use_settings(); |
265 | #ifdef HAVE_REMOTE_LCD | 266 | #ifdef HAVE_REMOTE_LCD |
@@ -268,14 +269,14 @@ void cleanup(void) | |||
268 | } | 269 | } |
269 | 270 | ||
270 | #ifdef HAVE_LCD_COLOR | 271 | #ifdef HAVE_LCD_COLOR |
271 | void color_randomize(struct line_color * color) | 272 | static void color_randomize(struct line_color * color) |
272 | { | 273 | { |
273 | color->r = rb->rand()%255; | 274 | color->r = rb->rand()%255; |
274 | color->g = rb->rand()%255; | 275 | color->g = rb->rand()%255; |
275 | color->b = rb->rand()%255; | 276 | color->b = rb->rand()%255; |
276 | } | 277 | } |
277 | 278 | ||
278 | void color_init(struct line_color * color) | 279 | static void color_init(struct line_color * color) |
279 | { | 280 | { |
280 | color_randomize(color); | 281 | color_randomize(color); |
281 | color->current_r=color->r; | 282 | color->current_r=color->r; |
@@ -283,7 +284,7 @@ void color_init(struct line_color * color) | |||
283 | color->current_b=color->b; | 284 | color->current_b=color->b; |
284 | } | 285 | } |
285 | 286 | ||
286 | void color_change(struct line_color * color) | 287 | static void color_change(struct line_color * color) |
287 | { | 288 | { |
288 | if(color->current_r<color->r) | 289 | if(color->current_r<color->r) |
289 | ++color->current_r; | 290 | ++color->current_r; |
@@ -307,7 +308,7 @@ void color_change(struct line_color * color) | |||
307 | #define COLOR_RGBPACK(color) \ | 308 | #define COLOR_RGBPACK(color) \ |
308 | LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) | 309 | LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) |
309 | 310 | ||
310 | void color_apply(struct line_color * color, struct screen * display) | 311 | static void color_apply(struct line_color * color, struct screen * display) |
311 | { | 312 | { |
312 | if (display->is_color){ | 313 | if (display->is_color){ |
313 | unsigned foreground= | 314 | unsigned foreground= |
@@ -321,7 +322,7 @@ void color_apply(struct line_color * color, struct screen * display) | |||
321 | * Main function | 322 | * Main function |
322 | */ | 323 | */ |
323 | 324 | ||
324 | int plugin_main(void) | 325 | static int plugin_main(void) |
325 | { | 326 | { |
326 | int action; | 327 | int action; |
327 | int sleep_time=DEFAULT_WAIT_TIME; | 328 | 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[]= { | |||
76 | #ifndef HAVE_LCD_COLOR | 76 | #ifndef HAVE_LCD_COLOR |
77 | static unsigned char palette[256]; | 77 | static unsigned char palette[256]; |
78 | 78 | ||
79 | void color_palette_init(unsigned char* palette) | 79 | static void color_palette_init(unsigned char* palette) |
80 | { | 80 | { |
81 | int i; | 81 | int i; |
82 | for(i=0;i<=160;i++)//palette[i]=(3/2)*i | 82 | for(i=0;i<=160;i++)//palette[i]=(3/2)*i |
@@ -95,7 +95,7 @@ static fb_data palette[256]; | |||
95 | * the "The Demo Effects Collection" GPL project | 95 | * the "The Demo Effects Collection" GPL project |
96 | * Copyright (C) 2002 W.P. van Paassen | 96 | * Copyright (C) 2002 W.P. van Paassen |
97 | */ | 97 | */ |
98 | void color_palette_init(fb_data* palette) | 98 | static void color_palette_init(fb_data* palette) |
99 | { | 99 | { |
100 | int i; | 100 | int i; |
101 | for (i = 0; i < 32; i++){ | 101 | for (i = 0; i < 32; i++){ |
@@ -268,7 +268,7 @@ static inline void fire_draw(struct fire* fire) | |||
268 | #endif | 268 | #endif |
269 | } | 269 | } |
270 | 270 | ||
271 | void cleanup(void *parameter) | 271 | static void cleanup(void *parameter) |
272 | { | 272 | { |
273 | (void)parameter; | 273 | (void)parameter; |
274 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 274 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
@@ -283,7 +283,7 @@ void cleanup(void *parameter) | |||
283 | 283 | ||
284 | 284 | ||
285 | #ifndef HAVE_LCD_COLOR | 285 | #ifndef HAVE_LCD_COLOR |
286 | int init_grey(void) | 286 | static int init_grey(void) |
287 | { | 287 | { |
288 | unsigned char *gbuf; | 288 | unsigned char *gbuf; |
289 | size_t gbuf_size = 0; | 289 | size_t gbuf_size = 0; |
@@ -303,7 +303,7 @@ int init_grey(void) | |||
303 | } | 303 | } |
304 | #endif | 304 | #endif |
305 | 305 | ||
306 | int main(void) | 306 | static int main(void) |
307 | { | 307 | { |
308 | int action; | 308 | int action; |
309 | 309 | ||
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, | |||
320 | "FPS (Speed)", "Playback Control", "Quit"); | 320 | "FPS (Speed)", "Playback Control", "Quit"); |
321 | 321 | ||
322 | /* called on startup. initializes all variables, etc */ | 322 | /* called on startup. initializes all variables, etc */ |
323 | void init_all(void) | 323 | static void init_all(void) |
324 | { | 324 | { |
325 | int j; | 325 | int j; |
326 | 326 | ||
@@ -333,7 +333,7 @@ void init_all(void) | |||
333 | 333 | ||
334 | /* called when a rocket hits its destination height. | 334 | /* called when a rocket hits its destination height. |
335 | * prepares all associated fireworks to be expelled. */ | 335 | * prepares all associated fireworks to be expelled. */ |
336 | void init_explode(int x, int y, int firework, int points) | 336 | static void init_explode(int x, int y, int firework, int points) |
337 | { | 337 | { |
338 | int i; | 338 | int i; |
339 | 339 | ||
@@ -357,7 +357,7 @@ void init_explode(int x, int y, int firework, int points) | |||
357 | 357 | ||
358 | /* called when a rocket is launched. | 358 | /* called when a rocket is launched. |
359 | * prepares said rocket to start moving towards its destination. */ | 359 | * prepares said rocket to start moving towards its destination. */ |
360 | void init_rocket(int rocket) | 360 | static void init_rocket(int rocket) |
361 | { | 361 | { |
362 | rb->srand(*rb->current_tick); | 362 | rb->srand(*rb->current_tick); |
363 | 363 | ||
@@ -374,7 +374,7 @@ void init_rocket(int rocket) | |||
374 | } | 374 | } |
375 | 375 | ||
376 | /* startup/configuration menu. */ | 376 | /* startup/configuration menu. */ |
377 | void fireworks_menu(void) | 377 | static void fireworks_menu(void) |
378 | { | 378 | { |
379 | int selected = 0, result; | 379 | int selected = 0, result; |
380 | bool menu_quit = false; | 380 | 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) | |||
740 | 740 | ||
741 | 741 | ||
742 | /* Draw "digits" least significant digits of num at (x,y) */ | 742 | /* Draw "digits" least significant digits of num at (x,y) */ |
743 | void draw_number(int x, int y, int num, int digits) | 743 | static void draw_number(int x, int y, int num, int digits) |
744 | { | 744 | { |
745 | int i; | 745 | int i; |
746 | int d; | 746 | int d; |
@@ -770,13 +770,13 @@ static inline void draw_score(void) | |||
770 | } | 770 | } |
771 | 771 | ||
772 | 772 | ||
773 | void draw_level(void) | 773 | static void draw_level(void) |
774 | { | 774 | { |
775 | draw_number(LEVEL_X + 2 * NUM_SPACING, PLAYFIELD_Y + 2, level, 2); | 775 | draw_number(LEVEL_X + 2 * NUM_SPACING, PLAYFIELD_Y + 2, level, 2); |
776 | } | 776 | } |
777 | 777 | ||
778 | 778 | ||
779 | void draw_lives(void) | 779 | static void draw_lives(void) |
780 | { | 780 | { |
781 | int i; | 781 | int i; |
782 | /* Lives num */ | 782 | /* Lives num */ |
@@ -872,7 +872,7 @@ static inline bool next_alien(void) | |||
872 | * Set curr_alien to first alive. | 872 | * Set curr_alien to first alive. |
873 | * Return false if no-one is left alive. | 873 | * Return false if no-one is left alive. |
874 | */ | 874 | */ |
875 | bool first_alien(void) | 875 | static bool first_alien(void) |
876 | { | 876 | { |
877 | int i, y; | 877 | int i, y; |
878 | 878 | ||
@@ -892,7 +892,7 @@ bool first_alien(void) | |||
892 | } | 892 | } |
893 | 893 | ||
894 | 894 | ||
895 | bool move_aliens(void) | 895 | static bool move_aliens(void) |
896 | { | 896 | { |
897 | int x, y, old_x, old_y; | 897 | int x, y, old_x, old_y; |
898 | 898 | ||
@@ -1023,7 +1023,7 @@ static inline void fire_alpha(int xc, int yc, fb_data color) | |||
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | 1025 | ||
1026 | void move_fire(void) | 1026 | static void move_fire(void) |
1027 | { | 1027 | { |
1028 | bool hit_green = false; | 1028 | bool hit_green = false; |
1029 | bool hit_white = false; | 1029 | bool hit_white = false; |
@@ -1244,7 +1244,7 @@ static inline void draw_bomb(int i) | |||
1244 | } | 1244 | } |
1245 | 1245 | ||
1246 | 1246 | ||
1247 | void move_bombs(void) | 1247 | static void move_bombs(void) |
1248 | { | 1248 | { |
1249 | int i, j, bomber; | 1249 | int i, j, bomber; |
1250 | bool abort; | 1250 | bool abort; |
@@ -1410,7 +1410,7 @@ static inline void move_ship(void) | |||
1410 | 1410 | ||
1411 | 1411 | ||
1412 | /* Unidentified Flying Object */ | 1412 | /* Unidentified Flying Object */ |
1413 | void move_ufo(void) | 1413 | static void move_ufo(void) |
1414 | { | 1414 | { |
1415 | static int ufo_speed; | 1415 | static int ufo_speed; |
1416 | static int counter; | 1416 | static int counter; |
@@ -1483,7 +1483,7 @@ void move_ufo(void) | |||
1483 | } | 1483 | } |
1484 | 1484 | ||
1485 | 1485 | ||
1486 | void draw_background(void) | 1486 | static void draw_background(void) |
1487 | { | 1487 | { |
1488 | 1488 | ||
1489 | rb->lcd_bitmap(invadrox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); | 1489 | rb->lcd_bitmap(invadrox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); |
@@ -1491,7 +1491,7 @@ void draw_background(void) | |||
1491 | } | 1491 | } |
1492 | 1492 | ||
1493 | 1493 | ||
1494 | void new_level(void) | 1494 | static void new_level(void) |
1495 | { | 1495 | { |
1496 | int i; | 1496 | int i; |
1497 | 1497 | ||
@@ -1604,7 +1604,7 @@ void new_level(void) | |||
1604 | } | 1604 | } |
1605 | 1605 | ||
1606 | 1606 | ||
1607 | void init_invadrox(void) | 1607 | static void init_invadrox(void) |
1608 | { | 1608 | { |
1609 | int i; | 1609 | int i; |
1610 | 1610 | ||
@@ -1756,7 +1756,7 @@ check_usb: | |||
1756 | } | 1756 | } |
1757 | 1757 | ||
1758 | 1758 | ||
1759 | void game_loop(void) | 1759 | static void game_loop(void) |
1760 | { | 1760 | { |
1761 | int i, end; | 1761 | int i, end; |
1762 | 1762 | ||
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 | |||
381 | /* the height and width of the field */ | 381 | /* the height and width of the field */ |
382 | #define MAX_HEIGHT (LCD_HEIGHT/TileSize) | 382 | #define MAX_HEIGHT (LCD_HEIGHT/TileSize) |
383 | #define MAX_WIDTH (LCD_WIDTH/TileSize) | 383 | #define MAX_WIDTH (LCD_WIDTH/TileSize) |
384 | int height = MAX_HEIGHT; | 384 | static int height = MAX_HEIGHT; |
385 | int width = MAX_WIDTH; | 385 | static int width = MAX_WIDTH; |
386 | int top; | 386 | static int top; |
387 | int left; | 387 | static int left; |
388 | 388 | ||
389 | /* The Minefield. Caution it is defined as Y, X! Not the opposite. */ | 389 | /* The Minefield. Caution it is defined as Y, X! Not the opposite. */ |
390 | tile minefield[MAX_HEIGHT][MAX_WIDTH]; | 390 | static tile minefield[MAX_HEIGHT][MAX_WIDTH]; |
391 | 391 | ||
392 | /* total number of mines on the game */ | 392 | /* total number of mines on the game */ |
393 | int mine_num = 0; | 393 | static int mine_num = 0; |
394 | 394 | ||
395 | /* percentage of mines on minefield used during generation */ | 395 | /* percentage of mines on minefield used during generation */ |
396 | int percent = 16; | 396 | static int percent = 16; |
397 | 397 | ||
398 | /* number of tiles left on the game */ | 398 | /* number of tiles left on the game */ |
399 | int tiles_left; | 399 | static int tiles_left; |
400 | 400 | ||
401 | /* Because mines are set after the first move... */ | 401 | /* Because mines are set after the first move... */ |
402 | bool no_mines = true; | 402 | static bool no_mines = true; |
403 | 403 | ||
404 | /* We need a stack (created on discover()) for the cascade algorithm. */ | 404 | /* We need a stack (created on discover()) for the cascade algorithm. */ |
405 | int stack_pos = 0; | 405 | static int stack_pos = 0; |
406 | 406 | ||
407 | #ifdef HAVE_TOUCHSCREEN | 407 | #ifdef HAVE_TOUCHSCREEN |
408 | 408 | ||
@@ -411,7 +411,7 @@ static struct ts_raster mine_raster = { 0, 0, MAX_WIDTH, MAX_HEIGHT, TileSize, T | |||
411 | #endif | 411 | #endif |
412 | 412 | ||
413 | 413 | ||
414 | void push( int *stack, int y, int x ) | 414 | static void push( int *stack, int y, int x ) |
415 | { | 415 | { |
416 | if( stack_pos <= height*width ) | 416 | if( stack_pos <= height*width ) |
417 | { | 417 | { |
@@ -421,7 +421,7 @@ void push( int *stack, int y, int x ) | |||
421 | } | 421 | } |
422 | 422 | ||
423 | /* Unveil tiles and push them to stack if they are empty. */ | 423 | /* Unveil tiles and push them to stack if they are empty. */ |
424 | void unveil( int *stack, int y, int x ) | 424 | static void unveil( int *stack, int y, int x ) |
425 | { | 425 | { |
426 | if( x < 0 || y < 0 || x > width - 1 || y > height - 1 | 426 | if( x < 0 || y < 0 || x > width - 1 || y > height - 1 |
427 | || minefield[y][x].known | 427 | || minefield[y][x].known |
@@ -433,14 +433,14 @@ void unveil( int *stack, int y, int x ) | |||
433 | push( stack, y, x ); | 433 | push( stack, y, x ); |
434 | } | 434 | } |
435 | 435 | ||
436 | int is_flagged( int y, int x ) | 436 | static int is_flagged( int y, int x ) |
437 | { | 437 | { |
438 | if( x >= 0 && y >= 0 && x < width && y < height && minefield[y][x].flag ) | 438 | if( x >= 0 && y >= 0 && x < width && y < height && minefield[y][x].flag ) |
439 | return 1; | 439 | return 1; |
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
442 | 442 | ||
443 | int neighbors_flagged( int y, int x ) | 443 | static int neighbors_flagged( int y, int x ) |
444 | { | 444 | { |
445 | return is_flagged( y-1, x-1 ) + | 445 | return is_flagged( y-1, x-1 ) + |
446 | is_flagged( y-1, x ) + | 446 | is_flagged( y-1, x ) + |
@@ -453,7 +453,7 @@ int neighbors_flagged( int y, int x ) | |||
453 | is_flagged( y+1, x+1 ); | 453 | is_flagged( y+1, x+1 ); |
454 | } | 454 | } |
455 | 455 | ||
456 | bool discover( int y, int x, bool explore_neighbors ) | 456 | static bool discover( int y, int x, bool explore_neighbors ) |
457 | { | 457 | { |
458 | /* Selected tile. */ | 458 | /* Selected tile. */ |
459 | if( x < 0 || y < 0 || x > width - 1 || y > height - 1) | 459 | if( x < 0 || y < 0 || x > width - 1 || y > height - 1) |
@@ -513,7 +513,7 @@ bool discover( int y, int x, bool explore_neighbors ) | |||
513 | } | 513 | } |
514 | 514 | ||
515 | /* Reset the whole board for a new game. */ | 515 | /* Reset the whole board for a new game. */ |
516 | void minesweeper_init( void ) | 516 | static void minesweeper_init( void ) |
517 | { | 517 | { |
518 | rb->memset(minefield, 0, sizeof(minefield)); | 518 | rb->memset(minefield, 0, sizeof(minefield)); |
519 | no_mines = true; | 519 | no_mines = true; |
@@ -524,7 +524,7 @@ void minesweeper_init( void ) | |||
524 | /* put mines on the mine field */ | 524 | /* put mines on the mine field */ |
525 | /* there is p% chance that a tile is a mine */ | 525 | /* there is p% chance that a tile is a mine */ |
526 | /* if the tile has coordinates (x,y), then it can't be a mine */ | 526 | /* if the tile has coordinates (x,y), then it can't be a mine */ |
527 | void minesweeper_putmines( int p, int x, int y ) | 527 | static void minesweeper_putmines( int p, int x, int y ) |
528 | { | 528 | { |
529 | int i,j; | 529 | int i,j; |
530 | 530 | ||
@@ -585,7 +585,7 @@ void minesweeper_putmines( int p, int x, int y ) | |||
585 | 585 | ||
586 | /* A function that will uncover all the board, when the user wins or loses. | 586 | /* A function that will uncover all the board, when the user wins or loses. |
587 | can easily be expanded, (just a call assigned to a button) as a solver. */ | 587 | can easily be expanded, (just a call assigned to a button) as a solver. */ |
588 | void mine_show( void ) | 588 | static void mine_show( void ) |
589 | { | 589 | { |
590 | int i, j, button; | 590 | int i, j, button; |
591 | 591 | ||
@@ -622,7 +622,7 @@ void mine_show( void ) | |||
622 | #endif | 622 | #endif |
623 | } | 623 | } |
624 | 624 | ||
625 | int count_tiles_left( void ) | 625 | static int count_tiles_left( void ) |
626 | { | 626 | { |
627 | int tiles = 0; | 627 | int tiles = 0; |
628 | int i, j; | 628 | int i, j; |
@@ -633,7 +633,7 @@ int count_tiles_left( void ) | |||
633 | return tiles; | 633 | return tiles; |
634 | } | 634 | } |
635 | 635 | ||
636 | int count_flags( void ) | 636 | static int count_flags( void ) |
637 | { | 637 | { |
638 | int flags = 0; | 638 | int flags = 0; |
639 | int i, j; | 639 | int i, j; |
@@ -645,7 +645,7 @@ int count_flags( void ) | |||
645 | } | 645 | } |
646 | 646 | ||
647 | /* welcome screen where player can chose mine percentage */ | 647 | /* welcome screen where player can chose mine percentage */ |
648 | enum minesweeper_status menu( void ) | 648 | static enum minesweeper_status menu( void ) |
649 | { | 649 | { |
650 | int selection = 0, result = MINESWEEPER_QUIT; | 650 | int selection = 0, result = MINESWEEPER_QUIT; |
651 | bool menu_quit = false; | 651 | bool menu_quit = false; |
@@ -698,7 +698,7 @@ enum minesweeper_status menu( void ) | |||
698 | } | 698 | } |
699 | 699 | ||
700 | /* the big and ugly game function */ | 700 | /* the big and ugly game function */ |
701 | enum minesweeper_status minesweeper( void ) | 701 | static enum minesweeper_status minesweeper( void ) |
702 | { | 702 | { |
703 | int i, j; | 703 | int i, j; |
704 | int button; | 704 | 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; | |||
431 | 431 | ||
432 | /* implementation */ | 432 | /* implementation */ |
433 | 433 | ||
434 | void anim_horizontal(int cur_left, int cur_right) | 434 | static void anim_horizontal(int cur_left, int cur_right) |
435 | { | 435 | { |
436 | int cur_x, x; | 436 | int cur_x, x; |
437 | int left, right, dl, dr; | 437 | int left, right, dl, dr; |
@@ -609,7 +609,7 @@ void anim_horizontal(int cur_left, int cur_right) | |||
609 | last_pos = cur_x; | 609 | last_pos = cur_x; |
610 | } | 610 | } |
611 | 611 | ||
612 | void anim_vertical(int cur_left, int cur_right) | 612 | static void anim_vertical(int cur_left, int cur_right) |
613 | { | 613 | { |
614 | int cur_y, y; | 614 | int cur_y, y; |
615 | int left, right, dl, dr; | 615 | int left, right, dl, dr; |
@@ -784,7 +784,7 @@ void anim_vertical(int cur_left, int cur_right) | |||
784 | last_pos = cur_y; | 784 | last_pos = cur_y; |
785 | } | 785 | } |
786 | 786 | ||
787 | void cleanup(void) | 787 | static void cleanup(void) |
788 | { | 788 | { |
789 | #if LCD_DEPTH > 1 | 789 | #if LCD_DEPTH > 1 |
790 | rb->lcd_set_foreground(LCD_DEFAULT_FG); | 790 | 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) | |||
83 | 83 | ||
84 | #ifdef HAVE_LCD_COLOR | 84 | #ifdef HAVE_LCD_COLOR |
85 | /* Make a smooth colour cycle. */ | 85 | /* Make a smooth colour cycle. */ |
86 | void shades_generate(int time) | 86 | static void shades_generate(int time) |
87 | { | 87 | { |
88 | int i; | 88 | int i; |
89 | unsigned red, green, blue; | 89 | unsigned red, green, blue; |
@@ -129,7 +129,7 @@ static void shades_generate(void) | |||
129 | } | 129 | } |
130 | #endif | 130 | #endif |
131 | 131 | ||
132 | void cleanup(void) | 132 | static void cleanup(void) |
133 | { | 133 | { |
134 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 134 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
135 | if (boosted) | 135 | if (boosted) |
@@ -150,7 +150,7 @@ void cleanup(void) | |||
150 | * algorithm. | 150 | * algorithm. |
151 | */ | 151 | */ |
152 | 152 | ||
153 | int main(void) | 153 | static int main(void) |
154 | { | 154 | { |
155 | plasma_frequency = 1; | 155 | plasma_frequency = 1; |
156 | int action, x, y; | 156 | 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 { | |||
288 | struct player player[2]; | 288 | struct player player[2]; |
289 | }; | 289 | }; |
290 | 290 | ||
291 | void singlepad(int x, int y, int set) | 291 | static void singlepad(int x, int y, int set) |
292 | { | 292 | { |
293 | if(set) { | 293 | if(set) { |
294 | rb->lcd_fillrect(x, y, PAD_WIDTH, PAD_HEIGHT); | 294 | rb->lcd_fillrect(x, y, PAD_WIDTH, PAD_HEIGHT); |
@@ -300,7 +300,7 @@ void singlepad(int x, int y, int set) | |||
300 | } | 300 | } |
301 | } | 301 | } |
302 | 302 | ||
303 | void pad(struct pong *p, int pad) | 303 | static void pad(struct pong *p, int pad) |
304 | { | 304 | { |
305 | struct player *player = &p->player[pad]; | 305 | struct player *player = &p->player[pad]; |
306 | /* clear existing pad */ | 306 | /* clear existing pad */ |
@@ -313,7 +313,7 @@ void pad(struct pong *p, int pad) | |||
313 | player->e_pad = player->w_pad; | 313 | player->e_pad = player->w_pad; |
314 | } | 314 | } |
315 | 315 | ||
316 | bool wallcollide(struct pong *p, int pad) | 316 | static bool wallcollide(struct pong *p, int pad) |
317 | { | 317 | { |
318 | /* we have already checked for pad-collision, just check if this hits | 318 | /* we have already checked for pad-collision, just check if this hits |
319 | the wall */ | 319 | the wall */ |
@@ -332,7 +332,7 @@ bool wallcollide(struct pong *p, int pad) | |||
332 | /* returns true if the ball has hit a pad, and then the info variable | 332 | /* returns true if the ball has hit a pad, and then the info variable |
333 | will have extra angle info */ | 333 | will have extra angle info */ |
334 | 334 | ||
335 | bool padcollide(struct pong *p, int pad, int *info) | 335 | static bool padcollide(struct pong *p, int pad, int *info) |
336 | { | 336 | { |
337 | struct player *player = &p->player[pad]; | 337 | struct player *player = &p->player[pad]; |
338 | int x = p->ball.x/RES; | 338 | int x = p->ball.x/RES; |
@@ -366,7 +366,7 @@ bool padcollide(struct pong *p, int pad, int *info) | |||
366 | return false; /* nah */ | 366 | return false; /* nah */ |
367 | } | 367 | } |
368 | 368 | ||
369 | void bounce(struct pong *p, int pad, int info) | 369 | static void bounce(struct pong *p, int pad, int info) |
370 | { | 370 | { |
371 | p->ball.speedx = -p->ball.speedx; | 371 | p->ball.speedx = -p->ball.speedx; |
372 | 372 | ||
@@ -410,7 +410,7 @@ void bounce(struct pong *p, int pad, int info) | |||
410 | #endif | 410 | #endif |
411 | } | 411 | } |
412 | 412 | ||
413 | void score(struct pong *p, int pad) | 413 | static void score(struct pong *p, int pad) |
414 | { | 414 | { |
415 | if(pad) | 415 | if(pad) |
416 | rb->splash(HZ/4, "right scores!"); | 416 | rb->splash(HZ/4, "right scores!"); |
@@ -436,7 +436,7 @@ void score(struct pong *p, int pad) | |||
436 | p->player[1].e_pad = -1; | 436 | p->player[1].e_pad = -1; |
437 | } | 437 | } |
438 | 438 | ||
439 | void ball(struct pong *p) | 439 | static void ball(struct pong *p) |
440 | { | 440 | { |
441 | int oldx = p->ball.x/RES; | 441 | int oldx = p->ball.x/RES; |
442 | int oldy = p->ball.y/RES; | 442 | int oldy = p->ball.y/RES; |
@@ -487,7 +487,7 @@ void ball(struct pong *p) | |||
487 | rb->lcd_fillrect(newx, newy, BALL_WIDTH, BALL_HEIGHT); | 487 | rb->lcd_fillrect(newx, newy, BALL_WIDTH, BALL_HEIGHT); |
488 | } | 488 | } |
489 | 489 | ||
490 | void padmove(int *pos, int dir) | 490 | static void padmove(int *pos, int dir) |
491 | { | 491 | { |
492 | *pos += dir; | 492 | *pos += dir; |
493 | if(*pos > (LCD_HEIGHT-PAD_HEIGHT)) | 493 | if(*pos > (LCD_HEIGHT-PAD_HEIGHT)) |
@@ -496,7 +496,7 @@ void padmove(int *pos, int dir) | |||
496 | *pos = 0; | 496 | *pos = 0; |
497 | } | 497 | } |
498 | 498 | ||
499 | void key_pad(struct pong *p, int pad, int up, int down) | 499 | static void key_pad(struct pong *p, int pad, int up, int down) |
500 | { | 500 | { |
501 | struct player *player = &p->player[pad]; | 501 | struct player *player = &p->player[pad]; |
502 | if(player->iscpu) { | 502 | if(player->iscpu) { |
@@ -526,7 +526,7 @@ void key_pad(struct pong *p, int pad, int up, int down) | |||
526 | } | 526 | } |
527 | } | 527 | } |
528 | 528 | ||
529 | int keys(struct pong *p) | 529 | static int keys(struct pong *p) |
530 | { | 530 | { |
531 | int key; | 531 | int key; |
532 | #ifdef PONG_PAUSE | 532 | #ifdef PONG_PAUSE |
@@ -609,7 +609,7 @@ int keys(struct pong *p) | |||
609 | return 1; /* return 0 to exit game */ | 609 | return 1; /* return 0 to exit game */ |
610 | } | 610 | } |
611 | 611 | ||
612 | void showscore(struct pong *p) | 612 | static void showscore(struct pong *p) |
613 | { | 613 | { |
614 | static char buffer[20]; | 614 | static char buffer[20]; |
615 | int w; | 615 | int w; |
@@ -620,7 +620,7 @@ void showscore(struct pong *p) | |||
620 | rb->lcd_putsxy( (LCD_WIDTH / 2) - (w / 2), 0, (unsigned char *)buffer); | 620 | rb->lcd_putsxy( (LCD_WIDTH / 2) - (w / 2), 0, (unsigned char *)buffer); |
621 | } | 621 | } |
622 | 622 | ||
623 | void blink_demo(void) | 623 | static void blink_demo(void) |
624 | { | 624 | { |
625 | static char buffer[30]; | 625 | static char buffer[30]; |
626 | int w; | 626 | 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) { | |||
120 | } | 120 | } |
121 | 121 | ||
122 | /* clear grid */ | 122 | /* clear grid */ |
123 | void init_grid(char *pgrid){ | 123 | static void init_grid(char *pgrid){ |
124 | memset(pgrid, 0, GRID_W * GRID_H); | 124 | memset(pgrid, 0, GRID_W * GRID_H); |
125 | } | 125 | } |
126 | 126 | ||
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 @@ | |||
25 | 25 | ||
26 | 26 | ||
27 | 27 | ||
28 | bool append_entry_to_file(sc_file_t *file, char *path, bool is_dir) | 28 | static bool append_entry_to_file(sc_file_t *file, char *path, bool is_dir) |
29 | { | 29 | { |
30 | sc_entry_t entry; | 30 | sc_entry_t entry; |
31 | 31 | ||
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; | |||
359 | static const char * initial_bmp_path=NULL; | 359 | static const char * initial_bmp_path=NULL; |
360 | 360 | ||
361 | #ifdef HAVE_ALBUMART | 361 | #ifdef HAVE_ALBUMART |
362 | const char * get_albumart_bmp_path(void) | 362 | static const char * get_albumart_bmp_path(void) |
363 | { | 363 | { |
364 | struct mp3entry* track = rb->audio_current_track(); | 364 | struct mp3entry* track = rb->audio_current_track(); |
365 | 365 | ||
@@ -374,10 +374,12 @@ const char * get_albumart_bmp_path(void) | |||
374 | } | 374 | } |
375 | #endif | 375 | #endif |
376 | 376 | ||
377 | const char * get_random_bmp_path(void) | 377 | #if 0 /* unused */ |
378 | static const char * get_random_bmp_path(void) | ||
378 | { | 379 | { |
379 | return(initial_bmp_path); | 380 | return(initial_bmp_path); |
380 | } | 381 | } |
382 | #endif | ||
381 | 383 | ||
382 | static bool load_resize_bitmap(void) | 384 | static bool load_resize_bitmap(void) |
383 | { | 385 | { |
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) | |||
245 | * Marks the entire area of the osci buffer invalid. | 245 | * Marks the entire area of the osci buffer invalid. |
246 | * It will be drawn with new values in the next loop. | 246 | * It will be drawn with new values in the next loop. |
247 | */ | 247 | */ |
248 | void splitedit_invalidate_osci(void) | 248 | static void splitedit_invalidate_osci(void) |
249 | { | 249 | { |
250 | osci_valid = false; | 250 | osci_valid = false; |
251 | validation_start = ~(unsigned int)0; | 251 | validation_start = ~(unsigned int)0; |
@@ -254,7 +254,7 @@ void splitedit_invalidate_osci(void) | |||
254 | /** | 254 | /** |
255 | * Returns the loop mode. See the LOOP_MODE_XXX constants above. | 255 | * Returns the loop mode. See the LOOP_MODE_XXX constants above. |
256 | */ | 256 | */ |
257 | int splitedit_get_loop_mode(void) | 257 | static int splitedit_get_loop_mode(void) |
258 | { | 258 | { |
259 | return loop_mode; | 259 | return loop_mode; |
260 | } | 260 | } |
@@ -300,7 +300,7 @@ static void update_icons(void) | |||
300 | /** | 300 | /** |
301 | * Sets the loop mode. See the LOOP_MODE_XXX constants above. | 301 | * Sets the loop mode. See the LOOP_MODE_XXX constants above. |
302 | */ | 302 | */ |
303 | void splitedit_set_loop_mode(int mode) | 303 | static void splitedit_set_loop_mode(int mode) |
304 | { | 304 | { |
305 | int old_loop_mode = loop_mode; | 305 | int old_loop_mode = loop_mode; |
306 | /* range restriction */ | 306 | /* range restriction */ |
@@ -386,7 +386,7 @@ static void set_range_by_time( | |||
386 | /** | 386 | /** |
387 | * Set the split point in screen coordinates | 387 | * Set the split point in screen coordinates |
388 | */ | 388 | */ |
389 | void splitedit_set_split_x(int newx) | 389 | static void splitedit_set_split_x(int newx) |
390 | { | 390 | { |
391 | int minx = split_x - 2 > 0 ? split_x - 2: 0; | 391 | int minx = split_x - 2 > 0 ? split_x - 2: 0; |
392 | 392 | ||
@@ -424,7 +424,7 @@ void splitedit_set_split_x(int newx) | |||
424 | /** | 424 | /** |
425 | * returns the split point in screen coordinates | 425 | * returns the split point in screen coordinates |
426 | */ | 426 | */ |
427 | int splitedit_get_split_x(void) | 427 | static int splitedit_get_split_x(void) |
428 | { | 428 | { |
429 | return split_x; | 429 | return split_x; |
430 | } | 430 | } |
@@ -502,7 +502,7 @@ static void scroll(struct mp3entry *mp3) | |||
502 | /** | 502 | /** |
503 | * Zooms in by 3/4 | 503 | * Zooms in by 3/4 |
504 | */ | 504 | */ |
505 | void splitedit_zoom_in(struct mp3entry *mp3) | 505 | static void splitedit_zoom_in(struct mp3entry *mp3) |
506 | { | 506 | { |
507 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 507 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
508 | rb->lcd_fillrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); | 508 | rb->lcd_fillrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); |
@@ -516,7 +516,7 @@ void splitedit_zoom_in(struct mp3entry *mp3) | |||
516 | /** | 516 | /** |
517 | * Zooms out by 4/3 | 517 | * Zooms out by 4/3 |
518 | */ | 518 | */ |
519 | void splitedit_zoom_out(struct mp3entry *mp3) | 519 | static void splitedit_zoom_out(struct mp3entry *mp3) |
520 | { | 520 | { |
521 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 521 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
522 | rb->lcd_fillrect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); | 522 | rb->lcd_fillrect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); |
@@ -915,9 +915,9 @@ static void save_editor(struct mp3entry *mp3, int splittime) | |||
915 | /** | 915 | /** |
916 | * The main loop of the editor | 916 | * The main loop of the editor |
917 | */ | 917 | */ |
918 | unsigned long splitedit_editor(struct mp3entry * mp3_to_split, | 918 | static unsigned long splitedit_editor(struct mp3entry * mp3_to_split, |
919 | unsigned int split_time, | 919 | unsigned int split_time, |
920 | unsigned int range) | 920 | unsigned int range) |
921 | { | 921 | { |
922 | int button = BUTTON_NONE; | 922 | int button = BUTTON_NONE; |
923 | int lastbutton = BUTTON_NONE; | 923 | 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) | |||
399 | 399 | ||
400 | static struct starfield starfield; | 400 | static struct starfield starfield; |
401 | 401 | ||
402 | int plugin_main(void) | 402 | static int plugin_main(void) |
403 | { | 403 | { |
404 | int button, avg_peak, t_disp=0; | 404 | int button, avg_peak, t_disp=0; |
405 | int font_h, font_w; | 405 | 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 @@ | |||
65 | 65 | ||
66 | 66 | ||
67 | /****************** prototypes ******************/ | 67 | /****************** prototypes ******************/ |
68 | void timer4_isr(void); /* IMIA4 ISR */ | 68 | static void timer4_isr(void); /* IMIA4 ISR */ |
69 | int check_button(void); /* determine next relative frame */ | 69 | int check_button(void); /* determine next relative frame */ |
70 | 70 | ||
71 | 71 | ||
@@ -207,7 +207,7 @@ tFileHeader gFileHdr; /* file header */ | |||
207 | /****************** implementation ******************/ | 207 | /****************** implementation ******************/ |
208 | 208 | ||
209 | /* tool function: return how much playable audio/video is left */ | 209 | /* tool function: return how much playable audio/video is left */ |
210 | int Available(unsigned char* pSnapshot) | 210 | static int Available(unsigned char* pSnapshot) |
211 | { | 211 | { |
212 | if (pSnapshot <= gBuf.pBufFill) | 212 | if (pSnapshot <= gBuf.pBufFill) |
213 | return gBuf.pBufFill - pSnapshot; | 213 | return gBuf.pBufFill - pSnapshot; |
@@ -216,7 +216,7 @@ int Available(unsigned char* pSnapshot) | |||
216 | } | 216 | } |
217 | 217 | ||
218 | /* debug function to draw buffer indicators */ | 218 | /* debug function to draw buffer indicators */ |
219 | void DrawBuf(void) | 219 | static void DrawBuf(void) |
220 | { | 220 | { |
221 | int ypos, fill, video, audio; | 221 | int ypos, fill, video, audio; |
222 | 222 | ||
@@ -247,7 +247,7 @@ void DrawBuf(void) | |||
247 | 247 | ||
248 | 248 | ||
249 | /* helper function to draw a position indicator */ | 249 | /* helper function to draw a position indicator */ |
250 | void DrawPosition(int pos, int total) | 250 | static void DrawPosition(int pos, int total) |
251 | { | 251 | { |
252 | int w, h; | 252 | int w, h; |
253 | int sec; /* estimated seconds */ | 253 | int sec; /* estimated seconds */ |
@@ -283,7 +283,7 @@ void DrawPosition(int pos, int total) | |||
283 | } | 283 | } |
284 | 284 | ||
285 | /* Put text on OSD and activate it for 1 second */ | 285 | /* Put text on OSD and activate it for 1 second */ |
286 | void osd_show_text(void) | 286 | static void osd_show_text(void) |
287 | { | 287 | { |
288 | int h, ypos; | 288 | int h, ypos; |
289 | 289 | ||
@@ -305,7 +305,7 @@ void osd_show_text(void) | |||
305 | } | 305 | } |
306 | 306 | ||
307 | /* helper function to change the volume by a certain amount, +/- */ | 307 | /* helper function to change the volume by a certain amount, +/- */ |
308 | void ChangeVolume(int delta) | 308 | static void ChangeVolume(int delta) |
309 | { | 309 | { |
310 | int minvol = rb->sound_min(SOUND_VOLUME); | 310 | int minvol = rb->sound_min(SOUND_VOLUME); |
311 | int maxvol = rb->sound_max(SOUND_VOLUME); | 311 | int maxvol = rb->sound_max(SOUND_VOLUME); |
@@ -325,7 +325,7 @@ void ChangeVolume(int delta) | |||
325 | 325 | ||
326 | 326 | ||
327 | /* helper function to change the LCD contrast by a certain amount, +/- */ | 327 | /* helper function to change the LCD contrast by a certain amount, +/- */ |
328 | void ChangeContrast(int delta) | 328 | static void ChangeContrast(int delta) |
329 | { | 329 | { |
330 | static int mycontrast = -1; /* the "permanent" value while running */ | 330 | static int mycontrast = -1; /* the "permanent" value while running */ |
331 | int contrast; /* updated value */ | 331 | int contrast; /* updated value */ |
@@ -348,7 +348,7 @@ void ChangeContrast(int delta) | |||
348 | 348 | ||
349 | 349 | ||
350 | /* sync the video to the current audio */ | 350 | /* sync the video to the current audio */ |
351 | void SyncVideo(void) | 351 | static void SyncVideo(void) |
352 | { | 352 | { |
353 | tAudioFrameHeader* pAudioBuf; | 353 | tAudioFrameHeader* pAudioBuf; |
354 | 354 | ||
@@ -370,7 +370,7 @@ void SyncVideo(void) | |||
370 | 370 | ||
371 | 371 | ||
372 | /* timer interrupt handler to display a frame */ | 372 | /* timer interrupt handler to display a frame */ |
373 | void timer4_isr(void) | 373 | static void timer4_isr(void) |
374 | { | 374 | { |
375 | int available; | 375 | int available; |
376 | tAudioFrameHeader* pAudioBuf; | 376 | tAudioFrameHeader* pAudioBuf; |
@@ -446,7 +446,7 @@ void timer4_isr(void) | |||
446 | 446 | ||
447 | 447 | ||
448 | /* ISR function to get more mp3 data */ | 448 | /* ISR function to get more mp3 data */ |
449 | void GetMoreMp3(unsigned char** start, size_t* size) | 449 | static void GetMoreMp3(unsigned char** start, size_t* size) |
450 | { | 450 | { |
451 | int available; | 451 | int available; |
452 | int advance; | 452 | int advance; |
@@ -476,7 +476,7 @@ void GetMoreMp3(unsigned char** start, size_t* size) | |||
476 | } | 476 | } |
477 | 477 | ||
478 | 478 | ||
479 | int WaitForButton(void) | 479 | static int WaitForButton(void) |
480 | { | 480 | { |
481 | int button; | 481 | int button; |
482 | 482 | ||
@@ -490,7 +490,7 @@ int WaitForButton(void) | |||
490 | } | 490 | } |
491 | 491 | ||
492 | 492 | ||
493 | bool WantResume(int fd) | 493 | static bool WantResume(int fd) |
494 | { | 494 | { |
495 | int button; | 495 | int button; |
496 | 496 | ||
@@ -507,7 +507,7 @@ bool WantResume(int fd) | |||
507 | } | 507 | } |
508 | 508 | ||
509 | 509 | ||
510 | int SeekTo(int fd, int nPos) | 510 | static int SeekTo(int fd, int nPos) |
511 | { | 511 | { |
512 | int read_now, got_now; | 512 | int read_now, got_now; |
513 | 513 | ||
@@ -574,7 +574,7 @@ int SeekTo(int fd, int nPos) | |||
574 | } | 574 | } |
575 | 575 | ||
576 | /* called from default_event_handler_ex() or at end of playback */ | 576 | /* called from default_event_handler_ex() or at end of playback */ |
577 | void Cleanup(void *fd) | 577 | static void Cleanup(void *fd) |
578 | { | 578 | { |
579 | rb->close(*(int*)fd); /* close the file */ | 579 | rb->close(*(int*)fd); /* close the file */ |
580 | 580 | ||
@@ -592,7 +592,7 @@ void Cleanup(void *fd) | |||
592 | } | 592 | } |
593 | 593 | ||
594 | /* returns >0 if continue, =0 to stop, <0 to abort (USB) */ | 594 | /* returns >0 if continue, =0 to stop, <0 to abort (USB) */ |
595 | int PlayTick(int fd) | 595 | static int PlayTick(int fd) |
596 | { | 596 | { |
597 | int button; | 597 | int button; |
598 | static int lastbutton = 0; | 598 | static int lastbutton = 0; |
@@ -867,7 +867,7 @@ int PlayTick(int fd) | |||
867 | } | 867 | } |
868 | 868 | ||
869 | 869 | ||
870 | int main(char* filename) | 870 | static int main(char* filename) |
871 | { | 871 | { |
872 | int file_size; | 872 | int file_size; |
873 | int fd; /* file descriptor handle */ | 873 | 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 { | |||
433 | int digital_decay; | 433 | int digital_decay; |
434 | } vumeter_settings; | 434 | } vumeter_settings; |
435 | 435 | ||
436 | void reset_settings(void) { | 436 | static void reset_settings(void) { |
437 | vumeter_settings.meter_type=ANALOG; | 437 | vumeter_settings.meter_type=ANALOG; |
438 | vumeter_settings.analog_use_db_scale=true; | 438 | vumeter_settings.analog_use_db_scale=true; |
439 | vumeter_settings.digital_use_db_scale=true; | 439 | vumeter_settings.digital_use_db_scale=true; |
@@ -443,7 +443,7 @@ void reset_settings(void) { | |||
443 | vumeter_settings.digital_decay=0; | 443 | vumeter_settings.digital_decay=0; |
444 | } | 444 | } |
445 | 445 | ||
446 | void calc_scales(void) | 446 | static void calc_scales(void) |
447 | { | 447 | { |
448 | unsigned int fx_log_factor = E_POW_5/half_width; | 448 | unsigned int fx_log_factor = E_POW_5/half_width; |
449 | unsigned int y,z; | 449 | unsigned int y,z; |
@@ -477,7 +477,7 @@ void calc_scales(void) | |||
477 | } | 477 | } |
478 | } | 478 | } |
479 | 479 | ||
480 | void load_settings(void) { | 480 | static void load_settings(void) { |
481 | int fp = rb->open(PLUGIN_DEMOS_DATA_DIR "/.vu_meter", O_RDONLY); | 481 | int fp = rb->open(PLUGIN_DEMOS_DATA_DIR "/.vu_meter", O_RDONLY); |
482 | if(fp>=0) { | 482 | if(fp>=0) { |
483 | rb->read(fp, &vumeter_settings, sizeof(struct saved_settings)); | 483 | rb->read(fp, &vumeter_settings, sizeof(struct saved_settings)); |
@@ -489,7 +489,7 @@ void load_settings(void) { | |||
489 | } | 489 | } |
490 | } | 490 | } |
491 | 491 | ||
492 | void save_settings(void) { | 492 | static void save_settings(void) { |
493 | int fp = rb->creat(PLUGIN_DEMOS_DATA_DIR "/.vu_meter", 0666); | 493 | int fp = rb->creat(PLUGIN_DEMOS_DATA_DIR "/.vu_meter", 0666); |
494 | if(fp >= 0) { | 494 | if(fp >= 0) { |
495 | rb->write (fp, &vumeter_settings, sizeof(struct saved_settings)); | 495 | rb->write (fp, &vumeter_settings, sizeof(struct saved_settings)); |
@@ -497,7 +497,7 @@ void save_settings(void) { | |||
497 | } | 497 | } |
498 | } | 498 | } |
499 | 499 | ||
500 | void change_volume(int delta) { | 500 | static void change_volume(int delta) { |
501 | int minvol = rb->sound_min(SOUND_VOLUME); | 501 | int minvol = rb->sound_min(SOUND_VOLUME); |
502 | int maxvol = rb->sound_max(SOUND_VOLUME); | 502 | int maxvol = rb->sound_max(SOUND_VOLUME); |
503 | int vol = rb->global_settings->volume + delta; | 503 | int vol = rb->global_settings->volume + delta; |
@@ -602,7 +602,7 @@ static bool vu_meter_menu(void) | |||
602 | return exit; | 602 | return exit; |
603 | } | 603 | } |
604 | 604 | ||
605 | void draw_analog_minimeters(void) { | 605 | static void draw_analog_minimeters(void) { |
606 | rb->lcd_mono_bitmap(sound_speaker, quarter_width-28, 12, 4, 8); | 606 | rb->lcd_mono_bitmap(sound_speaker, quarter_width-28, 12, 4, 8); |
607 | rb->lcd_set_drawmode(DRMODE_FG); | 607 | rb->lcd_set_drawmode(DRMODE_FG); |
608 | if(analog_mini_1<left_needle_top_x) | 608 | if(analog_mini_1<left_needle_top_x) |
@@ -628,7 +628,7 @@ void draw_analog_minimeters(void) { | |||
628 | rb->lcd_set_drawmode(DRMODE_SOLID); | 628 | rb->lcd_set_drawmode(DRMODE_SOLID); |
629 | } | 629 | } |
630 | 630 | ||
631 | void draw_digital_minimeters(void) { | 631 | static void draw_digital_minimeters(void) { |
632 | #ifdef HAVE_LCD_COLOR | 632 | #ifdef HAVE_LCD_COLOR |
633 | rb->lcd_set_foreground(LCD_RGBPACK(255, 255 - 23 * num_left_leds, 0)); | 633 | rb->lcd_set_foreground(LCD_RGBPACK(255, 255 - 23 * num_left_leds, 0)); |
634 | #endif | 634 | #endif |
@@ -664,7 +664,7 @@ void draw_digital_minimeters(void) { | |||
664 | #endif | 664 | #endif |
665 | } | 665 | } |
666 | 666 | ||
667 | void analog_meter(void) { | 667 | static void analog_meter(void) { |
668 | 668 | ||
669 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | 669 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
670 | int left_peak = rb->mas_codec_readreg(0xC); | 670 | int left_peak = rb->mas_codec_readreg(0xC); |
@@ -723,7 +723,7 @@ void analog_meter(void) { | |||
723 | } | 723 | } |
724 | } | 724 | } |
725 | 725 | ||
726 | void digital_meter(void) { | 726 | static void digital_meter(void) { |
727 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | 727 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
728 | int left_peak = rb->mas_codec_readreg(0xC); | 728 | int left_peak = rb->mas_codec_readreg(0xC); |
729 | int right_peak = rb->mas_codec_readreg(0xD); | 729 | int right_peak = rb->mas_codec_readreg(0xD); |