[pulseaudio-commits] r2506 - in /trunk/src: modules/module-ladspa-sink.c pulsecore/core-util.c pulsecore/core-util.h
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Tue Jun 10 17:37:42 PDT 2008
Author: lennart
Date: Wed Jun 11 02:37:41 2008
New Revision: 2506
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2506&root=pulseaudio&view=rev
Log:
replace pa_atof() by pa_atod() because floats are lame
Modified:
trunk/src/modules/module-ladspa-sink.c
trunk/src/pulsecore/core-util.c
trunk/src/pulsecore/core-util.h
Modified: trunk/src/modules/module-ladspa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-ladspa-sink.c?rev=2506&root=pulseaudio&r1=2505&r2=2506&view=diff
==============================================================================
--- trunk/src/modules/module-ladspa-sink.c (original)
+++ trunk/src/modules/module-ladspa-sink.c Wed Jun 11 02:37:41 2008
@@ -511,7 +511,7 @@
p = 0;
while ((k = pa_split(cdata, ",", &state)) && p < n_control) {
- float f;
+ double f;
if (*k == 0) {
use_default[p++] = TRUE;
@@ -519,7 +519,7 @@
continue;
}
- if (pa_atof(k, &f) < 0) {
+ if (pa_atod(k, &f) < 0) {
pa_log("Failed to parse control value '%s'", k);
pa_xfree(k);
goto fail;
Modified: trunk/src/pulsecore/core-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/core-util.c?rev=2506&root=pulseaudio&r1=2505&r2=2506&view=diff
==============================================================================
--- trunk/src/pulsecore/core-util.c (original)
+++ trunk/src/pulsecore/core-util.c Wed Jun 11 02:37:41 2008
@@ -1574,13 +1574,13 @@
}
#endif
-int pa_atof(const char *s, float *ret_f) {
+int pa_atod(const char *s, double *ret_d) {
char *x = NULL;
- float f;
+ double f;
int r = 0;
pa_assert(s);
- pa_assert(ret_f);
+ pa_assert(ret_d);
/* This should be locale independent */
@@ -1595,22 +1595,18 @@
if (c_locale) {
errno = 0;
- f = strtof_l(s, &x, c_locale);
+ f = strtod_l(s, &x, c_locale);
} else
#endif
{
errno = 0;
-#ifdef HAVE_STRTOF
- f = strtof(s, &x);
-#else
f = strtod(s, &x);
-#endif
}
if (!x || *x || errno != 0)
r = -1;
else
- *ret_f = f;
+ *ret_d = f;
return r;
}
Modified: trunk/src/pulsecore/core-util.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/core-util.h?rev=2506&root=pulseaudio&r1=2505&r2=2506&view=diff
==============================================================================
--- trunk/src/pulsecore/core-util.h (original)
+++ trunk/src/pulsecore/core-util.h Wed Jun 11 02:37:41 2008
@@ -127,7 +127,7 @@
int pa_atoi(const char *s, int32_t *ret_i);
int pa_atou(const char *s, uint32_t *ret_u);
-int pa_atof(const char *s, float *ret_f);
+int pa_atod(const char *s, double *ret_d);
int pa_snprintf(char *str, size_t size, const char *format, ...);
int pa_vsnprintf(char *str, size_t size, const char *format, va_list ap);
More information about the pulseaudio-commits
mailing list