diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2013-03-03 11:17:50 +0100 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2013-03-03 21:44:10 +0100 |
commit | 88d55b827d5ecac94c9ec399d219cc02b46ed694 (patch) | |
tree | 6aa644bd0328757eae325c5ba61df169d75cfa6e /libavcodec | |
parent | 2cffe38df3df8ee1ec0fea0b2a2d3fed6e75da0d (diff) | |
download | ffmpeg-88d55b827d5ecac94c9ec399d219cc02b46ed694.tar.gz |
Remove incorrect use of ctype.h functions.
As far as I can tell the code should not change behaviour
depending on locale in any of these places.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dvdsubdec.c | 3 | ||||
-rw-r--r-- | libavcodec/realtextdec.c | 4 | ||||
-rw-r--r-- | libavcodec/samidec.c | 10 | ||||
-rw-r--r-- | libavcodec/utils.c | 8 | ||||
-rw-r--r-- | libavcodec/xbmdec.c | 5 |
5 files changed, 16 insertions, 14 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index a5c90cd7fa..cb268b8dfe 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -24,6 +24,7 @@ #include "libavutil/colorspace.h" #include "libavutil/opt.h" #include "libavutil/imgutils.h" +#include "libavutil/avstring.h" //#define DEBUG @@ -523,7 +524,7 @@ static void parse_palette(DVDSubContext *ctx, char *p) ctx->has_palette = 1; for(i=0;i<16;i++) { ctx->palette[i] = strtoul(p, &p, 16); - while(*p == ',' || isspace(*p)) + while(*p == ',' || av_isspace(*p)) p++; } } diff --git a/libavcodec/realtextdec.c b/libavcodec/realtextdec.c index 102e0d924f..45788977b5 100644 --- a/libavcodec/realtextdec.c +++ b/libavcodec/realtextdec.c @@ -35,11 +35,11 @@ static int rt_event_to_ass(AVBPrint *buf, const char *p) while (*p) { if (*p != '<') { - if (!isspace(*p)) + if (!av_isspace(*p)) av_bprint_chars(buf, *p, 1); else if (!prev_chr_is_space) av_bprint_chars(buf, ' ', 1); - prev_chr_is_space = isspace(*p); + prev_chr_is_space = av_isspace(*p); } else { const char *end = strchr(p, '>'); if (!end) diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c index c04b8a336e..39ac6082bc 100644 --- a/libavcodec/samidec.c +++ b/libavcodec/samidec.c @@ -52,7 +52,7 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src) p = av_stristr(p, "<P"); if (!p) break; - if (p[2] != '>' && !isspace(p[2])) { // avoid confusion with tags such as <PRE> + if (p[2] != '>' && !av_isspace(p[2])) { // avoid confusion with tags such as <PRE> p++; continue; } @@ -70,7 +70,7 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src) } /* if empty event -> skip subtitle */ - while (isspace(*p)) + while (av_isspace(*p)) p++; if (!strncmp(p, " ", 6)) { ret = -1; @@ -80,7 +80,7 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src) /* extract the text, stripping most of the tags */ while (*p) { if (*p == '<') { - if (!av_strncasecmp(p, "<P", 2) && (p[2] == '>' || isspace(p[2]))) + if (!av_strncasecmp(p, "<P", 2) && (p[2] == '>' || av_isspace(p[2]))) break; if (!av_strncasecmp(p, "<BR", 3)) av_bprintf(dst, "\\N"); @@ -92,11 +92,11 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src) if (*p == '>') p++; } - if (!isspace(*p)) + if (!av_isspace(*p)) av_bprint_chars(dst, *p, 1); else if (!prev_chr_is_space) av_bprint_chars(dst, ' ', 1); - prev_chr_is_space = isspace(*p); + prev_chr_is_space = av_isspace(*p); p++; } } diff --git a/libavcodec/utils.c b/libavcodec/utils.c index d680f5ae48..0cf60910cc 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -2777,10 +2777,10 @@ int avpriv_unlock_avformat(void) unsigned int avpriv_toupper4(unsigned int x) { - return toupper(x & 0xFF) - + (toupper((x >> 8) & 0xFF) << 8) - + (toupper((x >> 16) & 0xFF) << 16) - + (toupper((x >> 24) & 0xFF) << 24); + return av_toupper(x & 0xFF) + + (av_toupper((x >> 8) & 0xFF) << 8) + + (av_toupper((x >> 16) & 0xFF) << 16) + + (av_toupper((x >> 24) & 0xFF) << 24); } #if !HAVE_THREADS diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c index 2a41836492..8632db7b0f 100644 --- a/libavcodec/xbmdec.c +++ b/libavcodec/xbmdec.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "internal.h" #include "mathops.h" +#include "libavutil/avstring.h" static av_cold int xbm_decode_init(AVCodecContext *avctx) { @@ -94,10 +95,10 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data, uint8_t val; ptr += strcspn(ptr, "x") + 1; - if (ptr < end && isxdigit(*ptr)) { + if (ptr < end && av_isxdigit(*ptr)) { val = convert(*ptr); ptr++; - if (isxdigit(*ptr)) + if (av_isxdigit(*ptr)) val = (val << 4) + convert(*ptr); *dst++ = ff_reverse[val]; } else { |