summaryrefslogtreecommitdiff
path: root/apps/plugins/calendar.c
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/plugins/calendar.c
parentc6be818212de133da4a51cebcdfee84c6dbae984 (diff)
downloadrockbox-607e67172578d426ca8e852bd48ad6a406a75e03.tar.gz
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/plugins/calendar.c')
-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
30static const struct plugin_api* rb; 30static const struct plugin_api* rb;
31 31
32static bool leap_year; 32static bool leap_year;
33static int days_in_month[2][13] = { 33static const int days_in_month[2][13] = {
34 {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, 34 {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
35 {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, 35 {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
36}; 36};
@@ -104,25 +104,25 @@ static int space = LCD_WIDTH / 7;
104static void draw_headers(void) 104static void draw_headers(void)
105{ 105{
106 int i,w,h; 106 int i,w,h;
107 char *Dayname[7] = {"M","T","W","T","F","S","S"}; 107 const char *Dayname[7] = {"M","T","W","T","F","S","S"};
108 int ws = 2; 108 int ws = 2;
109 rb->lcd_getstringsize("A",&w,&h); 109 rb->lcd_getstringsize("A",&w,&h);
110 for (i = 0; i < 7;) 110 for (i = 0; i < 7; i++)
111 { 111 {
112 rb->lcd_putsxy(ws, 0 , Dayname[i++]); 112 rb->lcd_putsxy(ws, 0 , Dayname[i]);
113 ws += space; 113 ws += space;
114 } 114 }
115 rb->lcd_hline(0, LCD_WIDTH-1 ,h); 115 rb->lcd_hline(0, LCD_WIDTH-1 ,h);
116} 116}
117 117
118static bool day_has_memo[31]; 118static bool day_has_memo[32];
119static bool wday_has_memo[6]; 119static bool wday_has_memo[7];
120static void draw_calendar(struct shown *shown) 120static void draw_calendar(struct shown *shown)
121{ 121{
122 int w,h; 122 int w,h;
123 int ws,row,pos,days_per_month,j; 123 int ws,row,pos,days_per_month,j;
124 char buffer[9]; 124 char buffer[9];
125 char *Monthname[] = { 125 const char *Monthname[] = {
126 "Jan", 126 "Jan",
127 "Feb", 127 "Feb",
128 "Mar", 128 "Mar",
@@ -430,7 +430,7 @@ static bool edit_memo(int change, struct shown *shown)
430 rb->lcd_puts(0,0,"New :"); 430 rb->lcd_puts(0,0,"New :");
431 rb->lcd_puts(2,1,"weekly : Left"); 431 rb->lcd_puts(2,1,"weekly : Left");
432 rb->lcd_puts(2,2,"monthly : Play"); 432 rb->lcd_puts(2,2,"monthly : Play");
433 rb->lcd_puts(2,3,"anualy : Right"); 433 rb->lcd_puts(2,3,"annually : Right");
434 rb->lcd_puts(2,4,"one off : On"); 434 rb->lcd_puts(2,4,"one off : On");
435 } 435 }
436 rb->lcd_update(); 436 rb->lcd_update();