diff options
Diffstat (limited to 'apps/settings_list.c')
-rw-r--r-- | apps/settings_list.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c index a9cfd79952..450d0eada4 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -269,13 +269,14 @@ static const char graphic_numeric[] = "graphic,numeric"; | |||
269 | 269 | ||
270 | #endif /* HAVE_RECORDING */ | 270 | #endif /* HAVE_RECORDING */ |
271 | 271 | ||
272 | static void formatter_unit_0_is_off(char *buffer, size_t buffer_size, | 272 | static const char* formatter_unit_0_is_off(char *buffer, size_t buffer_size, |
273 | int val, const char *unit) | 273 | int val, const char *unit) |
274 | { | 274 | { |
275 | if (val == 0) | 275 | if (val == 0) |
276 | strcpy(buffer, str(LANG_OFF)); | 276 | return str(LANG_OFF); |
277 | else | 277 | else |
278 | snprintf(buffer, buffer_size, "%d %s", val, unit); | 278 | snprintf(buffer, buffer_size, "%d %s", val, unit); |
279 | return buffer; | ||
279 | } | 280 | } |
280 | 281 | ||
281 | static int32_t getlang_unit_0_is_off(int value, int unit) | 282 | static int32_t getlang_unit_0_is_off(int value, int unit) |
@@ -286,16 +287,17 @@ static int32_t getlang_unit_0_is_off(int value, int unit) | |||
286 | return TALK_ID(value,unit); | 287 | return TALK_ID(value,unit); |
287 | } | 288 | } |
288 | 289 | ||
289 | static void formatter_unit_0_is_skip_track(char *buffer, size_t buffer_size, | 290 | static const char* formatter_unit_0_is_skip_track(char *buffer, size_t buffer_size, |
290 | int val, const char *unit) | 291 | int val, const char *unit) |
291 | { | 292 | { |
292 | (void)unit; | 293 | (void)unit; |
293 | if (val == 0) | 294 | if (val == 0) |
294 | strcpy(buffer, str(LANG_SKIP_TRACK)); | 295 | return str(LANG_SKIP_TRACK); |
295 | else if (val % 60 == 0) | 296 | else if (val % 60 == 0) |
296 | snprintf(buffer, buffer_size, "%d min", val/60); | 297 | snprintf(buffer, buffer_size, "%d min", val/60); |
297 | else | 298 | else |
298 | snprintf(buffer, buffer_size, "%d s", val); | 299 | snprintf(buffer, buffer_size, "%d s", val); |
300 | return buffer; | ||
299 | } | 301 | } |
300 | 302 | ||
301 | static int32_t getlang_unit_0_is_skip_track(int value, int unit) | 303 | static int32_t getlang_unit_0_is_skip_track(int value, int unit) |
@@ -310,15 +312,16 @@ static int32_t getlang_unit_0_is_skip_track(int value, int unit) | |||
310 | } | 312 | } |
311 | 313 | ||
312 | #ifdef HAVE_BACKLIGHT | 314 | #ifdef HAVE_BACKLIGHT |
313 | static void backlight_formatter(char *buffer, size_t buffer_size, | 315 | static const char* backlight_formatter(char *buffer, size_t buffer_size, |
314 | int val, const char *unit) | 316 | int val, const char *unit) |
315 | { | 317 | { |
316 | if (val == -1) | 318 | if (val == -1) |
317 | strcpy(buffer, str(LANG_OFF)); | 319 | return str(LANG_OFF); |
318 | else if (val == 0) | 320 | else if (val == 0) |
319 | strcpy(buffer, str(LANG_ON)); | 321 | return str(LANG_ON); |
320 | else | 322 | else |
321 | snprintf(buffer, buffer_size, "%d %s", val, unit); | 323 | snprintf(buffer, buffer_size, "%d %s", val, unit); |
324 | return buffer; | ||
322 | } | 325 | } |
323 | static int32_t backlight_getlang(int value, int unit) | 326 | static int32_t backlight_getlang(int value, int unit) |
324 | { | 327 | { |
@@ -332,14 +335,15 @@ static int32_t backlight_getlang(int value, int unit) | |||
332 | #endif | 335 | #endif |
333 | 336 | ||
334 | #ifndef HAVE_WHEEL_ACCELERATION | 337 | #ifndef HAVE_WHEEL_ACCELERATION |
335 | static void scanaccel_formatter(char *buffer, size_t buffer_size, | 338 | static const char* scanaccel_formatter(char *buffer, size_t buffer_size, |
336 | int val, const char *unit) | 339 | int val, const char *unit) |
337 | { | 340 | { |
338 | (void)unit; | 341 | (void)unit; |
339 | if (val == 0) | 342 | if (val == 0) |
340 | strcpy(buffer, str(LANG_OFF)); | 343 | return str(LANG_OFF); |
341 | else | 344 | else |
342 | snprintf(buffer, buffer_size, "2x/%ds", val); | 345 | snprintf(buffer, buffer_size, "2x/%ds", val); |
346 | return buffer; | ||
343 | } | 347 | } |
344 | #endif | 348 | #endif |
345 | 349 | ||
@@ -352,13 +356,14 @@ static void crossfeed_cross_set(int val) | |||
352 | global_settings.crossfeed_hf_cutoff); | 356 | global_settings.crossfeed_hf_cutoff); |
353 | } | 357 | } |
354 | 358 | ||
355 | static void db_format(char* buffer, size_t buffer_size, int value, | 359 | static const char* db_format(char* buffer, size_t buffer_size, int value, |
356 | const char* unit) | 360 | const char* unit) |
357 | { | 361 | { |
358 | int v = abs(value); | 362 | int v = abs(value); |
359 | 363 | ||
360 | snprintf(buffer, buffer_size, "%s%d.%d %s", value < 0 ? "-" : "", | 364 | snprintf(buffer, buffer_size, "%s%d.%d %s", value < 0 ? "-" : "", |
361 | v / 10, v % 10, unit); | 365 | v / 10, v % 10, unit); |
366 | return buffer; | ||
362 | } | 367 | } |
363 | 368 | ||
364 | static int32_t get_dec_talkid(int value, int unit) | 369 | static int32_t get_dec_talkid(int value, int unit) |
@@ -384,27 +389,25 @@ static void set_superbass(bool value) | |||
384 | #endif | 389 | #endif |
385 | 390 | ||
386 | #ifdef HAVE_LCD_CHARCELLS | 391 | #ifdef HAVE_LCD_CHARCELLS |
387 | static void jumpscroll_format(char* buffer, size_t buffer_size, int value, | 392 | static const char* jumpscroll_format(char* buffer, size_t buffer_size, int value, |
388 | const char* unit) | 393 | const char* unit) |
389 | { | 394 | { |
390 | (void)unit; | 395 | (void)unit; |
391 | switch (value) | 396 | switch (value) |
392 | { | 397 | { |
393 | case 0: | 398 | case 0: |
394 | strcpy(buffer, str(LANG_OFF)); | 399 | return str(LANG_OFF); |
395 | break; | ||
396 | case 1: | 400 | case 1: |
397 | strcpy(buffer, str(LANG_ONE_TIME)); | 401 | return str(LANG_ONE_TIME); |
398 | break; | ||
399 | case 2: | 402 | case 2: |
400 | case 3: | 403 | case 3: |
401 | case 4: | 404 | case 4: |
402 | snprintf(buffer, buffer_size, "%d", value); | 405 | snprintf(buffer, buffer_size, "%d", value); |
403 | break; | 406 | break; |
404 | case 5: | 407 | case 5: |
405 | strcpy(buffer, str(LANG_ALWAYS)); | 408 | return str(LANG_ALWAYS); |
406 | break; | ||
407 | } | 409 | } |
410 | return buffer; | ||
408 | } | 411 | } |
409 | static int32_t jumpscroll_getlang(int value, int unit) | 412 | static int32_t jumpscroll_getlang(int value, int unit) |
410 | { | 413 | { |