summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2007-08-19 10:22:46 +0000
committerNils Wallménius <nils@rockbox.org>2007-08-19 10:22:46 +0000
commit9b591839531b77948b19191a50f816a6806e20e5 (patch)
tree06a08ff0926403f2e507e51f3ce708d4df7b81b1
parent24b85ff1e3481abaa2271b26a64131c52fd36322 (diff)
downloadrockbox-9b591839531b77948b19191a50f816a6806e20e5.tar.gz
rockbox-9b591839531b77948b19191a50f816a6806e20e5.zip
Use size_t type for the buffer_size parameter to formatter functions, static two private functions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14392 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/option_select.c6
-rw-r--r--apps/menus/eq_menu.c8
-rw-r--r--apps/menus/eq_menu.h8
-rw-r--r--apps/menus/main_menu.c2
-rw-r--r--apps/plugin.h2
-rw-r--r--apps/settings.c2
-rw-r--r--apps/settings.h4
-rw-r--r--apps/settings_list.c16
-rw-r--r--apps/settings_list.h2
9 files changed, 25 insertions, 25 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index 7b6322ff91..c57bb6411b 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -45,7 +45,7 @@ static const char *unit_strings[] =
45 [UNIT_PM_TICK] = "units/10ms", 45 [UNIT_PM_TICK] = "units/10ms",
46}; 46};
47 47
48char *option_get_valuestring(struct settings_list *setting, 48static char *option_get_valuestring(struct settings_list *setting,
49 char *buffer, int buf_len, 49 char *buffer, int buf_len,
50 intptr_t temp_var) 50 intptr_t temp_var)
51{ 51{
@@ -121,7 +121,7 @@ char *option_get_valuestring(struct settings_list *setting,
121 return buffer; 121 return buffer;
122} 122}
123 123
124void option_talk(struct settings_list *setting, int temp_var) 124static void option_talk(struct settings_list *setting, int temp_var)
125{ 125{
126 if (!talk_menus_enabled()) 126 if (!talk_menus_enabled())
127 return; 127 return;
@@ -492,7 +492,7 @@ bool set_int_ex(const unsigned char* string,
492 int step, 492 int step,
493 int min, 493 int min,
494 int max, 494 int max,
495 void (*formatter)(char*, int, int, const char*), 495 void (*formatter)(char*, size_t, int, const char*),
496 long (*get_talk_id)(int)) 496 long (*get_talk_id)(int))
497{ 497{
498 (void)unit; 498 (void)unit;
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c
index d16ef6912d..8058fa10aa 100644
--- a/apps/menus/eq_menu.c
+++ b/apps/menus/eq_menu.c
@@ -56,7 +56,7 @@
56 * Utility functions 56 * Utility functions
57 */ 57 */
58 58
59void eq_gain_format(char* buffer, int buffer_size, int value, const char* unit) 59void eq_gain_format(char* buffer, size_t buffer_size, int value, const char* unit)
60{ 60{
61 int v = abs(value); 61 int v = abs(value);
62 62
@@ -64,12 +64,12 @@ void eq_gain_format(char* buffer, int buffer_size, int value, const char* unit)
64 v / EQ_USER_DIVISOR, v % EQ_USER_DIVISOR, unit); 64 v / EQ_USER_DIVISOR, v % EQ_USER_DIVISOR, unit);
65} 65}
66 66
67void eq_q_format(char* buffer, int buffer_size, int value, const char* unit) 67void eq_q_format(char* buffer, size_t buffer_size, int value, const char* unit)
68{ 68{
69 snprintf(buffer, buffer_size, "%d.%d %s", value / EQ_USER_DIVISOR, value % EQ_USER_DIVISOR, unit); 69 snprintf(buffer, buffer_size, "%d.%d %s", value / EQ_USER_DIVISOR, value % EQ_USER_DIVISOR, unit);
70} 70}
71 71
72void eq_precut_format(char* buffer, int buffer_size, int value, const char* unit) 72void eq_precut_format(char* buffer, size_t buffer_size, int value, const char* unit)
73{ 73{
74 snprintf(buffer, buffer_size, "%s%d.%d %s", value == 0 ? " " : "-", 74 snprintf(buffer, buffer_size, "%s%d.%d %s", value == 0 ? " " : "-",
75 value / EQ_USER_DIVISOR, value % EQ_USER_DIVISOR, unit); 75 value / EQ_USER_DIVISOR, value % EQ_USER_DIVISOR, unit);
@@ -642,7 +642,7 @@ MAKE_MENU(equalizer_menu, ID2P(LANG_EQUALIZER), NULL, Icon_EQ,
642 642
643#ifdef HAVE_WM8758 643#ifdef HAVE_WM8758
644 644
645void eq_hw_gain_format(char* buffer, int buffer_size, int value, 645void eq_hw_gain_format(char* buffer, size_t buffer_size, int value,
646 const char* unit) 646 const char* unit)
647{ 647{
648 snprintf(buffer, buffer_size, "%d %s", value, unit); 648 snprintf(buffer, buffer_size, "%d %s", value, unit);
diff --git a/apps/menus/eq_menu.h b/apps/menus/eq_menu.h
index 8f3cb834d8..b101ff36ed 100644
--- a/apps/menus/eq_menu.h
+++ b/apps/menus/eq_menu.h
@@ -41,11 +41,11 @@ bool eq_browse_presets(void);
41bool eq_menu_graphical(void); 41bool eq_menu_graphical(void);
42 42
43/* utility functions for settings_list.c */ 43/* utility functions for settings_list.c */
44void eq_gain_format(char* buffer, int buffer_size, int value, const char* unit); 44void eq_gain_format(char* buffer, size_t buffer_size, int value, const char* unit);
45void eq_q_format(char* buffer, int buffer_size, int value, const char* unit); 45void eq_q_format(char* buffer, size_t buffer_size, int value, const char* unit);
46void eq_precut_format(char* buffer, int buffer_size, int value, const char* unit); 46void eq_precut_format(char* buffer, size_t buffer_size, int value, const char* unit);
47#ifdef HAVE_WM8758 47#ifdef HAVE_WM8758
48void eq_hw_gain_format(char* buffer, int buffer_size, int value, 48void eq_hw_gain_format(char* buffer, size_t buffer_size, int value,
49 const char* unit); 49 const char* unit);
50/* WM8758 equalizer supports -12 to +12 dB gain in 1 dB increments. */ 50/* WM8758 equalizer supports -12 to +12 dB gain in 1 dB increments. */
51#define EQ_HW_GAIN_STEP 1 51#define EQ_HW_GAIN_STEP 1
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index f01e8dc23a..1ae5774d15 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -358,7 +358,7 @@ MENUITEM_FUNCTION(show_info_item, 0, ID2P(LANG_ROCKBOX_INFO),
358 358
359 359
360/* sleep Menu */ 360/* sleep Menu */
361static void sleep_timer_formatter(char* buffer, int buffer_size, int value, 361static void sleep_timer_formatter(char* buffer, size_t buffer_size, int value,
362 const char* unit) 362 const char* unit)
363{ 363{
364 int minutes, hours; 364 int minutes, hours;
diff --git a/apps/plugin.h b/apps/plugin.h
index b3db0a9d20..c3e5a5b714 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -516,7 +516,7 @@ struct plugin_api {
516 void (*function)(bool)); 516 void (*function)(bool));
517 bool (*set_int)(const unsigned char* string, const char* unit, int voice_unit, 517 bool (*set_int)(const unsigned char* string, const char* unit, int voice_unit,
518 int* variable, void (*function)(int), int step, int min, 518 int* variable, void (*function)(int), int step, int min,
519 int max, void (*formatter)(char*, int, int, const char*) ); 519 int max, void (*formatter)(char*, size_t, int, const char*) );
520 bool (*set_bool)(const char* string, bool* variable ); 520 bool (*set_bool)(const char* string, bool* variable );
521 521
522#ifdef HAVE_LCD_COLOR 522#ifdef HAVE_LCD_COLOR
diff --git a/apps/settings.c b/apps/settings.c
index f2bb542928..cd1c252426 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -977,7 +977,7 @@ bool set_int(const unsigned char* string,
977 int step, 977 int step,
978 int min, 978 int min,
979 int max, 979 int max,
980 void (*formatter)(char*, int, int, const char*) ) 980 void (*formatter)(char*, size_t, int, const char*) )
981{ 981{
982 return set_int_ex(string, unit, voice_unit, variable, function, 982 return set_int_ex(string, unit, voice_unit, variable, function,
983 step, min, max, formatter, NULL); 983 step, min, max, formatter, NULL);
diff --git a/apps/settings.h b/apps/settings.h
index 8d9646ff6d..0dd21a33eb 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -275,12 +275,12 @@ bool set_option(const char* string, void* variable, enum optiontype type,
275bool set_int(const unsigned char* string, const char* unit, int voice_unit, 275bool set_int(const unsigned char* string, const char* unit, int voice_unit,
276 int* variable, 276 int* variable,
277 void (*function)(int), int step, int min, int max, 277 void (*function)(int), int step, int min, int max,
278 void (*formatter)(char*, int, int, const char*) ); 278 void (*formatter)(char*, size_t, int, const char*) );
279/* use this one if you need to create a lang from the value (i.e with TALK_ID()) */ 279/* use this one if you need to create a lang from the value (i.e with TALK_ID()) */
280bool set_int_ex(const unsigned char* string, const char* unit, int voice_unit, 280bool set_int_ex(const unsigned char* string, const char* unit, int voice_unit,
281 int* variable, 281 int* variable,
282 void (*function)(int), int step, int min, int max, 282 void (*function)(int), int step, int min, int max,
283 void (*formatter)(char*, int, int, const char*), 283 void (*formatter)(char*, size_t, int, const char*),
284 long (*get_talk_id)(int)); 284 long (*get_talk_id)(int));
285 285
286/* the following are either not in setting.c or shouldnt be */ 286/* the following are either not in setting.c or shouldnt be */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index cfac08835c..6ebeb23658 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -192,7 +192,7 @@ static long rectime_getlang(int value)
192 return LANG_OFF; 192 return LANG_OFF;
193 return TALK_ID(value, UNIT_SEC); 193 return TALK_ID(value, UNIT_SEC);
194} 194}
195static void rectime_formatter(char *buffer, int buffer_size, 195static void rectime_formatter(char *buffer, size_t buffer_size,
196 int val, const char *unit) 196 int val, const char *unit)
197{ 197{
198 (void)unit; 198 (void)unit;
@@ -207,7 +207,7 @@ static void rectime_formatter(char *buffer, int buffer_size,
207#ifdef HAVE_BACKLIGHT 207#ifdef HAVE_BACKLIGHT
208static const char backlight_times_conf [] = 208static const char backlight_times_conf [] =
209 "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90"; 209 "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90";
210static void backlight_formatter(char *buffer, int buffer_size, 210static void backlight_formatter(char *buffer, size_t buffer_size,
211 int val, const char *unit) 211 int val, const char *unit)
212{ 212{
213 (void)unit; 213 (void)unit;
@@ -233,7 +233,7 @@ static long ff_rewind_min_step_getlang(int value)
233{ 233{
234 return TALK_ID(ff_rewind_min_stepvals[value], UNIT_SEC); 234 return TALK_ID(ff_rewind_min_stepvals[value], UNIT_SEC);
235} 235}
236static void ff_rewind_min_step_formatter(char *buffer, int buffer_size, 236static void ff_rewind_min_step_formatter(char *buffer, size_t buffer_size,
237 int val, const char *unit) 237 int val, const char *unit)
238{ 238{
239 (void)unit; 239 (void)unit;
@@ -245,7 +245,7 @@ static long scanaccel_getlang(int value)
245 return LANG_OFF; 245 return LANG_OFF;
246 return TALK_ID(value, UNIT_SEC); 246 return TALK_ID(value, UNIT_SEC);
247} 247}
248static void scanaccel_formatter(char *buffer, int buffer_size, 248static void scanaccel_formatter(char *buffer, size_t buffer_size,
249 int val, const char *unit) 249 int val, const char *unit)
250{ 250{
251 (void)unit; 251 (void)unit;
@@ -262,7 +262,7 @@ static long poweroff_idle_timer_getlang(int value)
262 return LANG_OFF; 262 return LANG_OFF;
263 return TALK_ID(poweroff_idle_timer_times[value], UNIT_MIN); 263 return TALK_ID(poweroff_idle_timer_times[value], UNIT_MIN);
264} 264}
265static void poweroff_idle_timer_formatter(char *buffer, int buffer_size, 265static void poweroff_idle_timer_formatter(char *buffer, size_t buffer_size,
266 int val, const char *unit) 266 int val, const char *unit)
267{ 267{
268 (void)unit; 268 (void)unit;
@@ -279,7 +279,7 @@ static long listaccel_getlang(int value)
279 return LANG_OFF; 279 return LANG_OFF;
280 return TALK_ID((HZ/2)*value, UNIT_MS); 280 return TALK_ID((HZ/2)*value, UNIT_MS);
281} 281}
282static void listaccel_formatter(char *buffer, int buffer_size, 282static void listaccel_formatter(char *buffer, size_t buffer_size,
283 int val, const char *unit) 283 int val, const char *unit)
284{ 284{
285 (void)unit; 285 (void)unit;
@@ -291,7 +291,7 @@ static void listaccel_formatter(char *buffer, int buffer_size,
291#endif /* HAVE_SCROLLWHEEL */ 291#endif /* HAVE_SCROLLWHEEL */
292 292
293#if CONFIG_CODEC == SWCODEC 293#if CONFIG_CODEC == SWCODEC
294static void crossfeed_format(char* buffer, int buffer_size, int value, 294static void crossfeed_format(char* buffer, size_t buffer_size, int value,
295 const char* unit) 295 const char* unit)
296{ 296{
297 snprintf(buffer, buffer_size, "%s%d.%d %s", value == 0 ? " " : "-", 297 snprintf(buffer, buffer_size, "%s%d.%d %s", value == 0 ? " " : "-",
@@ -305,7 +305,7 @@ static void crossfeed_cross_set(int val)
305 global_settings.crossfeed_hf_cutoff); 305 global_settings.crossfeed_hf_cutoff);
306} 306}
307 307
308static void replaygain_preamp_format(char* buffer, int buffer_size, int value, 308static void replaygain_preamp_format(char* buffer, size_t buffer_size, int value,
309 const char* unit) 309 const char* unit)
310{ 310{
311 int v = abs(value); 311 int v = abs(value);
diff --git a/apps/settings_list.h b/apps/settings_list.h
index 829d4f78eb..b7044c8039 100644
--- a/apps/settings_list.h
+++ b/apps/settings_list.h
@@ -69,7 +69,7 @@ struct int_setting {
69 int min; 69 int min;
70 int max; 70 int max;
71 int step; 71 int step;
72 void (*formatter)(char*, int, int, const char*); 72 void (*formatter)(char*, size_t, int, const char*);
73 long (*get_talk_id)(int); 73 long (*get_talk_id)(int);
74}; 74};
75#define F_INT_SETTING 0x80 75#define F_INT_SETTING 0x80