aboutsummaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorReimar Döffinger2013-03-03 11:17:50 +0100
committerMartin Storsjö2013-03-07 15:16:36 +0200
commitefa7f4202088c70caba11d7834641bc6eaf41830 (patch)
tree7ef0beba253b642affcc69f634f192fdc7c12428 /libavutil
parent12c5c1d3e3906e18a96ec380605d2f1504fc3d3b (diff)
Use the avstring.h locale-independent character type functions
Make sure the behavior does not change with the locale. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/avstring.c3
-rw-r--r--libavutil/common.h1
-rw-r--r--libavutil/dict.c3
-rw-r--r--libavutil/eval.c3
-rw-r--r--libavutil/parseutils.c4
5 files changed, 6 insertions, 8 deletions
diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index 6ce0310c1a..973ba4357e 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -23,7 +23,6 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include "config.h"
#include "common.h"
@@ -43,7 +42,7 @@ int av_strstart(const char *str, const char *pfx, const char **ptr)
int av_stristart(const char *str, const char *pfx, const char **ptr)
{
- while (*pfx && toupper((unsigned)*pfx) == toupper((unsigned)*str)) {
+ while (*pfx && av_toupper((unsigned)*pfx) == av_toupper((unsigned)*str)) {
pfx++;
str++;
}
diff --git a/libavutil/common.h b/libavutil/common.h
index cc4df16e4a..caa6b1963b 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -26,7 +26,6 @@
#ifndef AVUTIL_COMMON_H
#define AVUTIL_COMMON_H
-#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
diff --git a/libavutil/dict.c b/libavutil/dict.c
index 6532a56561..9ac4831688 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <ctype.h>
#include <string.h>
#include "avstring.h"
@@ -50,7 +49,7 @@ av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int
for(; i<m->count; i++){
const char *s= m->elems[i].key;
if(flags & AV_DICT_MATCH_CASE) for(j=0; s[j] == key[j] && key[j]; j++);
- else for(j=0; toupper(s[j]) == toupper(key[j]) && key[j]; j++);
+ else for(j=0; av_toupper(s[j]) == av_toupper(key[j]) && key[j]; j++);
if(key[j])
continue;
if(s[j] && !(flags & AV_DICT_IGNORE_SUFFIX))
diff --git a/libavutil/eval.c b/libavutil/eval.c
index a0e968dc34..0ca7472ffd 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -31,6 +31,7 @@
#include "eval.h"
#include "log.h"
#include "mathematics.h"
+#include "avstring.h"
typedef struct Parser {
const AVClass *class;
@@ -503,7 +504,7 @@ int av_expr_parse(AVExpr **expr, const char *s,
return AVERROR(ENOMEM);
while (*s)
- if (!isspace(*s++)) *wp++ = s[-1];
+ if (!av_isspace(*s++)) *wp++ = s[-1];
*wp++ = 0;
p.class = &class;
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 917451eee7..0e3fd9eab5 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -385,7 +385,7 @@ static int date_get_num(const char **pp,
val = 0;
for(i = 0; i < len_max; i++) {
c = *p;
- if (!isdigit(c))
+ if (!av_isdigit(c))
break;
val = (val * 10) + c - '0';
p++;
@@ -591,7 +591,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
int val, n;
q++;
for (val = 0, n = 100000; n >= 1; n /= 10, q++) {
- if (!isdigit(*q))
+ if (!av_isdigit(*q))
break;
val += n * (*q - '0');
}