Commit 3624d45d authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

compat/strtod: Add missing const qualifiers.

Fixes many warnings:
initialization discards 'const' qualifier from pointer target type
parent a78ae465
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
#include "libavutil/mathematics.h" #include "libavutil/mathematics.h"
static char *check_nan_suffix(char *s) static const char *check_nan_suffix(const char *s)
{ {
char *start = s; const char *start = s;
if (*s++ != '(') if (*s++ != '(')
return start; return start;
...@@ -44,7 +44,7 @@ double strtod(const char *, char **); ...@@ -44,7 +44,7 @@ double strtod(const char *, char **);
double avpriv_strtod(const char *nptr, char **endptr) double avpriv_strtod(const char *nptr, char **endptr)
{ {
char *end; const char *end;
double res; double res;
/* Skip leading spaces */ /* Skip leading spaces */
...@@ -81,13 +81,13 @@ double avpriv_strtod(const char *nptr, char **endptr) ...@@ -81,13 +81,13 @@ double avpriv_strtod(const char *nptr, char **endptr)
!av_strncasecmp(nptr, "+0x", 3)) { !av_strncasecmp(nptr, "+0x", 3)) {
/* FIXME this doesn't handle exponents, non-integers (float/double) /* FIXME this doesn't handle exponents, non-integers (float/double)
* and numbers too large for long long */ * and numbers too large for long long */
res = strtoll(nptr, &end, 16); res = strtoll(nptr, (char **)&end, 16);
} else { } else {
res = strtod(nptr, &end); res = strtod(nptr, (char **)&end);
} }
if (endptr) if (endptr)
*endptr = end; *endptr = (char *)end;
return res; return res;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment