summaryrefslogtreecommitdiffstats
path: root/apps/dsp.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-02-10 16:34:16 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-02-10 16:34:16 +0000
commit97f369a5876762a6f4181a8b44c85cb894ebc5f3 (patch)
treecb604ca0ee2fac52bf92635a1c136f1f97f64918 /apps/dsp.c
parentce3b774b212defb26f166d77251a11ce14cec73e (diff)
downloadrockbox-97f369a5876762a6f4181a8b44c85cb894ebc5f3.tar.gz
rockbox-97f369a5876762a6f4181a8b44c85cb894ebc5f3.zip
SWCODEC: Annoying neatness update. Use intptr_t for codec_configure_callback and dsp_configure and stop all the silly type casting of intergral types to pointers to set dsp configuration and watermarks. Shouldn't have any effect on already compiled codecs at all. Will fix any important patches in the tracker so they compile.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12259 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/dsp.c')
-rw-r--r--apps/dsp.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/dsp.c b/apps/dsp.c
index f7eb48ed03..533342ecf1 100644
--- a/apps/dsp.c
+++ b/apps/dsp.c
@@ -128,7 +128,7 @@ void sound_set_pitch(int permille)
{
pitch_ratio = permille;
- dsp_configure(DSP_SWITCH_FREQUENCY, (int *)dsp->codec_frequency);
+ dsp_configure(DSP_SWITCH_FREQUENCY, dsp->codec_frequency);
}
/* Convert at most count samples to the internal format, if needed. Returns
@@ -844,7 +844,7 @@ int dsp_stereo_mode(void)
return dsp->stereo_mode;
}
-bool dsp_configure(int setting, void *value)
+bool dsp_configure(int setting, intptr_t value)
{
dsp = &dsp_conf[current_codec];
@@ -855,7 +855,7 @@ bool dsp_configure(int setting, void *value)
sizeof(struct resample_data));
/* Fall through!!! */
case DSP_SWITCH_FREQUENCY:
- dsp->codec_frequency = ((long) value == 0) ? NATIVE_FREQUENCY : (long) value;
+ dsp->codec_frequency = (value == 0) ? NATIVE_FREQUENCY : value;
/* Account for playback speed adjustment when setting dsp->frequency
if we're called from the main audio thread. Voice UI thread should
not need this feature.
@@ -868,15 +868,15 @@ bool dsp_configure(int setting, void *value)
break;
case DSP_SET_CLIP_MIN:
- dsp->clip_min = (long) value;
+ dsp->clip_min = value;
break;
case DSP_SET_CLIP_MAX:
- dsp->clip_max = (long) value;
+ dsp->clip_max = value;
break;
case DSP_SET_SAMPLE_DEPTH:
- dsp->sample_depth = (long) value;
+ dsp->sample_depth = value;
if (dsp->sample_depth <= NATIVE_DEPTH)
{
@@ -887,10 +887,10 @@ bool dsp_configure(int setting, void *value)
}
else
{
- dsp->frac_bits = (long) value;
+ dsp->frac_bits = value;
dsp->sample_bytes = 4; /* samples are 32 bits */
- dsp->clip_max = (1 << (long)value) - 1;
- dsp->clip_min = -(1 << (long)value);
+ dsp->clip_max = (1 << value) - 1;
+ dsp->clip_min = -(1 << value);
}
dither_init();