summaryrefslogtreecommitdiffstats
path: root/apps/gui/pitchscreen.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-05-06 21:04:40 +0000
committerThomas Martitz <kugel@rockbox.org>2010-05-06 21:04:40 +0000
commit50a6ca39ad4ed01922aa4f755f0ca579788226cf (patch)
treec7881b015b220558167310345b162324c96be15a /apps/gui/pitchscreen.c
parentadb506df14aded06ed6e9ebf8540e6fd383ffd6a (diff)
downloadrockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.tar.gz
rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.tar.bz2
rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.zip
Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes).
This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/pitchscreen.c')
-rw-r--r--apps/gui/pitchscreen.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/gui/pitchscreen.c b/apps/gui/pitchscreen.c
index 77b5739be1..a0058724ec 100644
--- a/apps/gui/pitchscreen.c
+++ b/apps/gui/pitchscreen.c
@@ -23,9 +23,8 @@
#include <string.h>
#include <stdio.h>
#include <math.h>
-#include <stdlib.h> /* for ABS() */
+#include <stdlib.h> /* for abs() */
#include "config.h"
-#include "sprintf.h"
#include "action.h"
#include "dsp.h"
#include "sound.h"
@@ -248,10 +247,10 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
/* Pitch:XXX.X% */
if(global_settings.pitch_mode_semitone)
{
- snprintf(buf, sizeof(buf), "%s: %s%ld.%02ld", str(LANG_PITCH),
+ snprintf(buf, sizeof(buf), "%s: %s%d.%02d", str(LANG_PITCH),
semitone >= 0 ? "+" : "-",
- ABS(semitone / PITCH_SPEED_PRECISION),
- ABS((semitone % PITCH_SPEED_PRECISION) /
+ abs(semitone / PITCH_SPEED_PRECISION),
+ abs((semitone % PITCH_SPEED_PRECISION) /
(PITCH_SPEED_PRECISION / 100))
);
}
@@ -290,10 +289,10 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
{
if(global_settings.pitch_mode_semitone)
{
- snprintf(buf, sizeof(buf), "%s%ld.%02ld",
+ snprintf(buf, sizeof(buf), "%s%d.%02d",
semitone >= 0 ? "+" : "-",
- ABS(semitone / PITCH_SPEED_PRECISION),
- ABS((semitone % PITCH_SPEED_PRECISION) /
+ abs(semitone / PITCH_SPEED_PRECISION),
+ abs((semitone % PITCH_SPEED_PRECISION) /
(PITCH_SPEED_PRECISION / 100))
);
}