summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-05-21 12:54:07 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-05-21 12:54:07 +0000
commit9d5e376fc37caae42816f5603fc480380574bce5 (patch)
tree04dea2d0a218a9e108853307dcc55f84e18faf70 /apps/gui
parentbcdf43dbc12a90b81d0f6f5ba97ce50aa9641514 (diff)
downloadrockbox-9d5e376fc37caae42816f5603fc480380574bce5.tar.gz
rockbox-9d5e376fc37caae42816f5603fc480380574bce5.zip
Allow the day of month (%cm) and day of week (%cu and %cw) RTC tags to be used in enums.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13454 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/gwps-common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 9e5329bd4f..2429d74b86 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -1106,6 +1106,8 @@ static char *get_token_value(struct gui_wps *gwps,
1106 1106
1107 case WPS_TOKEN_RTC_MONTH: 1107 case WPS_TOKEN_RTC_MONTH:
1108 /* m: month (01..12) */ 1108 /* m: month (01..12) */
1109 if (intval)
1110 *intval = tm->tm_mon + 1;
1109 snprintf(buf, buf_size, "%02d", tm->tm_mon + 1); 1111 snprintf(buf, buf_size, "%02d", tm->tm_mon + 1);
1110 return buf; 1112 return buf;
1111 1113
@@ -1151,11 +1153,15 @@ static char *get_token_value(struct gui_wps *gwps,
1151 1153
1152 case WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON: 1154 case WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON:
1153 /* u: day of week (1..7); 1 is Monday */ 1155 /* u: day of week (1..7); 1 is Monday */
1156 if (intval)
1157 *intval = (tm->tm_wday == 0) ? 7 : tm->tm_wday;
1154 snprintf(buf, buf_size, "%1d", tm->tm_wday + 1); 1158 snprintf(buf, buf_size, "%1d", tm->tm_wday + 1);
1155 return buf; 1159 return buf;
1156 1160
1157 case WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN: 1161 case WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN:
1158 /* w: day of week (0..6); 0 is Sunday */ 1162 /* w: day of week (0..6); 0 is Sunday */
1163 if (intval)
1164 *intval = tm->tm_wday + 1;
1159 snprintf(buf, buf_size, "%1d", tm->tm_wday); 1165 snprintf(buf, buf_size, "%1d", tm->tm_wday);
1160 return buf; 1166 return buf;
1161#endif 1167#endif