summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2008-10-04 11:35:53 +0000
committerBertrik Sikken <bertrik@sikken.nl>2008-10-04 11:35:53 +0000
commit607e67172578d426ca8e852bd48ad6a406a75e03 (patch)
tree6972054db71fd3cfc8b5e6f0a609f4a8500e9b3c /apps
parentc6be818212de133da4a51cebcdfee84c6dbae984 (diff)
downloadrockbox-607e67172578d426ca8e852bd48ad6a406a75e03.tar.gz
rockbox-607e67172578d426ca8e852bd48ad6a406a75e03.tar.bz2
rockbox-607e67172578d426ca8e852bd48ad6a406a75e03.zip
Made some read-only arrays const, simplified a funky for-loop, fixed potential memo buffer overflow, fixed spelling in calendar plugin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18707 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/calendar.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index 286dd83c5b..8fb9b7a61a 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -30,7 +30,7 @@ PLUGIN_HEADER
static const struct plugin_api* rb;
static bool leap_year;
-static int days_in_month[2][13] = {
+static const int days_in_month[2][13] = {
{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
};
@@ -104,25 +104,25 @@ static int space = LCD_WIDTH / 7;
static void draw_headers(void)
{
int i,w,h;
- char *Dayname[7] = {"M","T","W","T","F","S","S"};
+ const char *Dayname[7] = {"M","T","W","T","F","S","S"};
int ws = 2;
rb->lcd_getstringsize("A",&w,&h);
- for (i = 0; i < 7;)
+ for (i = 0; i < 7; i++)
{
- rb->lcd_putsxy(ws, 0 , Dayname[i++]);
+ rb->lcd_putsxy(ws, 0 , Dayname[i]);
ws += space;
}
rb->lcd_hline(0, LCD_WIDTH-1 ,h);
}
-static bool day_has_memo[31];
-static bool wday_has_memo[6];
+static bool day_has_memo[32];
+static bool wday_has_memo[7];
static void draw_calendar(struct shown *shown)
{
int w,h;
int ws,row,pos,days_per_month,j;
char buffer[9];
- char *Monthname[] = {
+ const char *Monthname[] = {
"Jan",
"Feb",
"Mar",
@@ -430,7 +430,7 @@ static bool edit_memo(int change, struct shown *shown)
rb->lcd_puts(0,0,"New :");
rb->lcd_puts(2,1,"weekly : Left");
rb->lcd_puts(2,2,"monthly : Play");
- rb->lcd_puts(2,3,"anualy : Right");
+ rb->lcd_puts(2,3,"annually : Right");
rb->lcd_puts(2,4,"one off : On");
}
rb->lcd_update();