summaryrefslogtreecommitdiff
path: root/apps/menus
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/eq_menu.c9
-rw-r--r--apps/menus/eq_menu.h6
-rw-r--r--apps/menus/main_menu.c28
-rw-r--r--apps/menus/recording_menu.c2
4 files changed, 25 insertions, 20 deletions
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c
index 6087ebfd5b..0e04dddc18 100644
--- a/apps/menus/eq_menu.c
+++ b/apps/menus/eq_menu.c
@@ -51,15 +51,18 @@
51 * Utility functions 51 * Utility functions
52 */ 52 */
53 53
54void eq_q_format(char* buffer, size_t buffer_size, int value, const char* unit) 54const char* eq_q_format(char* buffer, size_t buffer_size, int value, const char* unit)
55{ 55{
56 snprintf(buffer, buffer_size, "%d.%d %s", value / EQ_USER_DIVISOR, value % EQ_USER_DIVISOR, unit); 56 snprintf(buffer, buffer_size, "%d.%d %s", value / EQ_USER_DIVISOR,
57 value % EQ_USER_DIVISOR, unit);
58 return buffer;
57} 59}
58 60
59void eq_precut_format(char* buffer, size_t buffer_size, int value, const char* unit) 61const char* eq_precut_format(char* buffer, size_t buffer_size, int value, const char* unit)
60{ 62{
61 snprintf(buffer, buffer_size, "%s%d.%d %s", value == 0 ? " " : "-", 63 snprintf(buffer, buffer_size, "%s%d.%d %s", value == 0 ? " " : "-",
62 value / EQ_USER_DIVISOR, value % EQ_USER_DIVISOR, unit); 64 value / EQ_USER_DIVISOR, value % EQ_USER_DIVISOR, unit);
65 return buffer;
63} 66}
64 67
65/* 68/*
diff --git a/apps/menus/eq_menu.h b/apps/menus/eq_menu.h
index 6be099113a..6c8301c572 100644
--- a/apps/menus/eq_menu.h
+++ b/apps/menus/eq_menu.h
@@ -43,7 +43,9 @@ bool eq_browse_presets(void);
43bool eq_menu_graphical(void); 43bool eq_menu_graphical(void);
44 44
45/* utility functions for settings_list.c */ 45/* utility functions for settings_list.c */
46void eq_q_format(char* buffer, size_t buffer_size, int value, const char* unit); 46const char* eq_q_format(char* buffer, size_t buffer_size, int value,
47void eq_precut_format(char* buffer, size_t buffer_size, int value, const char* unit); 47 const char* unit);
48const char* eq_precut_format(char* buffer, size_t buffer_size, int value,
49 const char* unit);
48 50
49#endif 51#endif
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 1e7465559e..99c73f2cdb 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -164,8 +164,8 @@ static const unsigned char *byte_units[] =
164 ID2P(LANG_MEGABYTE) 164 ID2P(LANG_MEGABYTE)
165}; 165};
166 166
167static char* info_getname(int selected_item, void *data, 167static const char* info_getname(int selected_item, void *data,
168 char *buffer, size_t buffer_len) 168 char *buffer, size_t buffer_len)
169{ 169{
170 struct info_data *info = (struct info_data*)data; 170 struct info_data *info = (struct info_data*)data;
171 char s1[32]; 171 char s1[32];
@@ -199,27 +199,27 @@ static char* info_getname(int selected_item, void *data,
199#if CONFIG_CHARGING == CHARGING_SIMPLE 199#if CONFIG_CHARGING == CHARGING_SIMPLE
200 /* Only know if plugged */ 200 /* Only know if plugged */
201 if (charger_inserted()) 201 if (charger_inserted())
202 return (char *)str(LANG_BATTERY_CHARGE); 202 return str(LANG_BATTERY_CHARGE);
203 else 203 else
204#elif CONFIG_CHARGING >= CHARGING_MONITOR 204#elif CONFIG_CHARGING >= CHARGING_MONITOR
205#ifdef ARCHOS_RECORDER 205#ifdef ARCHOS_RECORDER
206 /* Report the particular algorithm state */ 206 /* Report the particular algorithm state */
207 if (charge_state == CHARGING) 207 if (charge_state == CHARGING)
208 return (char *)str(LANG_BATTERY_CHARGE); 208 return str(LANG_BATTERY_CHARGE);
209 else if (charge_state == TOPOFF) 209 else if (charge_state == TOPOFF)
210 return (char *)str(LANG_BATTERY_TOPOFF_CHARGE); 210 return str(LANG_BATTERY_TOPOFF_CHARGE);
211 else if (charge_state == TRICKLE) 211 else if (charge_state == TRICKLE)
212 return (char *)str(LANG_BATTERY_TRICKLE_CHARGE); 212 return str(LANG_BATTERY_TRICKLE_CHARGE);
213 else 213 else
214#else /* !ARCHOS_RECORDER */ 214#else /* !ARCHOS_RECORDER */
215 /* Go by what power management reports */ 215 /* Go by what power management reports */
216 if (charging_state()) 216 if (charging_state())
217 return (char *)str(LANG_BATTERY_CHARGE); 217 return str(LANG_BATTERY_CHARGE);
218 else 218 else
219#endif /* ARCHOS_RECORDER */ 219#endif /* ARCHOS_RECORDER */
220#endif /* CONFIG_CHARGING = */ 220#endif /* CONFIG_CHARGING = */
221 if (battery_level() >= 0) 221 if (battery_level() >= 0)
222 snprintf(buffer, buffer_len, (char *)str(LANG_BATTERY_TIME), 222 snprintf(buffer, buffer_len, str(LANG_BATTERY_TIME),
223 battery_level(), battery_time() / 60, battery_time() % 60); 223 battery_level(), battery_time() / 60, battery_time() % 60);
224 else 224 else
225 return "(n/a)"; 225 return "(n/a)";
@@ -399,19 +399,19 @@ MENUITEM_FUNCTION(show_info_item, 0, ID2P(LANG_ROCKBOX_INFO),
399 399
400 400
401/* sleep Menu */ 401/* sleep Menu */
402static void sleep_timer_formatter(char* buffer, size_t buffer_size, int value, 402static const char* sleep_timer_formatter(char* buffer, size_t buffer_size,
403 const char* unit) 403 int value, const char* unit)
404{ 404{
405 int minutes, hours;
406
407 (void) unit; 405 (void) unit;
406 int minutes, hours;
408 407
409 if (value) { 408 if (value) {
410 hours = value / 60; 409 hours = value / 60;
411 minutes = value - (hours * 60); 410 minutes = value - (hours * 60);
412 snprintf(buffer, buffer_size, "%d:%02d", hours, minutes); 411 snprintf(buffer, buffer_size, "%d:%02d", hours, minutes);
413 } else { 412 return buffer;
414 strlcpy(buffer, str(LANG_OFF), buffer_size); 413 } else {
414 return str(LANG_OFF);
415 } 415 }
416} 416}
417 417
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index c15a18291c..7b99b48a2d 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -415,7 +415,7 @@ static enum themable_icons trigger_get_icon(int selected_item, void * data)
415 return Icon_NOICON; 415 return Icon_NOICON;
416} 416}
417 417
418static char * trigger_get_name(int selected_item, void * data, 418static const char * trigger_get_name(int selected_item, void * data,
419 char * buffer, size_t buffer_len) 419 char * buffer, size_t buffer_len)
420{ 420{
421 const struct settings_list **settings = 421 const struct settings_list **settings =