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 /libavformat | |
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 'libavformat')
-rw-r--r-- | libavformat/hls.c | 2 | ||||
-rw-r--r-- | libavformat/hlsproto.c | 2 | ||||
-rw-r--r-- | libavformat/http.c | 6 | ||||
-rw-r--r-- | libavformat/httpauth.c | 5 | ||||
-rw-r--r-- | libavformat/oggparsevorbis.c | 2 | ||||
-rw-r--r-- | libavformat/rtmphttp.c | 2 | ||||
-rw-r--r-- | libavformat/subtitles.c | 4 | ||||
-rw-r--r-- | libavformat/urldecode.c | 3 | ||||
-rw-r--r-- | libavformat/utils.c | 10 |
9 files changed, 17 insertions, 19 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index 0b7d050a5e..4e7af90f33 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -110,7 +110,7 @@ typedef struct HLSContext { static int read_chomp_line(AVIOContext *s, char *buf, int maxlen) { int len = ff_get_line(s, buf, maxlen); - while (len > 0 && isspace(buf[len - 1])) + while (len > 0 && av_isspace(buf[len - 1])) buf[--len] = '\0'; return len; } diff --git a/libavformat/hlsproto.c b/libavformat/hlsproto.c index 79cf0e498b..8dedcfd7ca 100644 --- a/libavformat/hlsproto.c +++ b/libavformat/hlsproto.c @@ -71,7 +71,7 @@ typedef struct HLSContext { static int read_chomp_line(AVIOContext *s, char *buf, int maxlen) { int len = ff_get_line(s, buf, maxlen); - while (len > 0 && isspace(buf[len - 1])) + while (len > 0 && av_isspace(buf[len - 1])) buf[--len] = '\0'; return len; } diff --git a/libavformat/http.c b/libavformat/http.c index 59460005d3..1e3cff7947 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -298,9 +298,9 @@ static int process_line(URLContext *h, char *line, int line_count, p = line; if (line_count == 0) { - while (!isspace(*p) && *p != '\0') + while (!av_isspace(*p) && *p != '\0') p++; - while (isspace(*p)) + while (av_isspace(*p)) p++; s->http_code = strtol(p, &end, 10); @@ -325,7 +325,7 @@ static int process_line(URLContext *h, char *line, int line_count, *p = '\0'; tag = line; p++; - while (isspace(*p)) + while (av_isspace(*p)) p++; if (!av_strcasecmp(tag, "Location")) { av_strlcpy(s->location, p, sizeof(s->location)); diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c index e97aee1f66..5ca48b9c1d 100644 --- a/libavformat/httpauth.c +++ b/libavformat/httpauth.c @@ -27,7 +27,6 @@ #include "libavutil/md5.h" #include "urldecode.h" #include "avformat.h" -#include <ctype.h> static void handle_basic_params(HTTPAuthState *state, const char *key, int key_len, char **dest, int *dest_len) @@ -80,8 +79,8 @@ static void choose_qop(char *qop, int size) char *ptr = strstr(qop, "auth"); char *end = ptr + strlen("auth"); - if (ptr && (!*end || isspace(*end) || *end == ',') && - (ptr == qop || isspace(ptr[-1]) || ptr[-1] == ',')) { + if (ptr && (!*end || av_isspace(*end) || *end == ',') && + (ptr == qop || av_isspace(ptr[-1]) || ptr[-1] == ',')) { av_strlcpy(qop, "auth", size); } else { qop[0] = 0; diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 0b52bc7c17..da029a47df 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -122,7 +122,7 @@ ff_vorbis_comment(AVFormatContext * as, AVDictionary **m, const uint8_t *buf, in } for (j = 0; j < tl; j++) - tt[j] = toupper(t[j]); + tt[j] = av_toupper(t[j]); tt[tl] = 0; memcpy(ct, v, vl); diff --git a/libavformat/rtmphttp.c b/libavformat/rtmphttp.c index d21ac67315..3a51f7c429 100644 --- a/libavformat/rtmphttp.c +++ b/libavformat/rtmphttp.c @@ -236,7 +236,7 @@ static int rtmp_http_open(URLContext *h, const char *uri, int flags) goto fail; } } - while (off > 0 && isspace(rt->client_id[off - 1])) + while (off > 0 && av_isspace(rt->client_id[off - 1])) off--; rt->client_id[off] = '\0'; diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c index 546261605f..37ba0cb0b6 100644 --- a/libavformat/subtitles.c +++ b/libavformat/subtitles.c @@ -170,12 +170,12 @@ const char *ff_smil_get_attr_ptr(const char *s, const char *attr) while (*s) { while (*s) { - if (!in_quotes && isspace(*s)) + if (!in_quotes && av_isspace(*s)) break; in_quotes ^= *s == '"'; // XXX: support escaping? s++; } - while (isspace(*s)) + while (av_isspace(*s)) s++; if (!av_strncasecmp(s, attr, len) && s[len] == '=') return s + len + 1 + (s[len + 1] == '"'); diff --git a/libavformat/urldecode.c b/libavformat/urldecode.c index b1009037a8..283d912671 100644 --- a/libavformat/urldecode.c +++ b/libavformat/urldecode.c @@ -26,7 +26,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <ctype.h> #include <string.h> #include "libavutil/mem.h" @@ -54,7 +53,7 @@ char *ff_urldecode(const char *url) if (c == '%' && s + 2 < url_len) { char c2 = url[s++]; char c3 = url[s++]; - if (isxdigit(c2) && isxdigit(c3)) { + if (av_isxdigit(c2) && av_isxdigit(c3)) { c2 = av_tolower(c2); c3 = av_tolower(c3); diff --git a/libavformat/utils.c b/libavformat/utils.c index 7f90a9a5e0..1be391fbbf 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3641,11 +3641,11 @@ int av_get_frame_filename(char *buf, int buf_size, if (c == '%') { do { nd = 0; - while (isdigit(*p)) { + while (av_isdigit(*p)) { nd = nd * 10 + *p++ - '0'; } c = *p++; - } while (isdigit(c)); + } while (av_isdigit(c)); switch(c) { case '%': @@ -3866,7 +3866,7 @@ int ff_hex_to_data(uint8_t *data, const char *p) p += strspn(p, SPACE_CHARS); if (*p == '\0') break; - c = toupper((unsigned char) *p++); + c = av_toupper((unsigned char) *p++); if (c >= '0' && c <= '9') c = c - '0'; else if (c >= 'A' && c <= 'F') @@ -3989,7 +3989,7 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf, int key_len, dest_len = 0; /* Skip whitespace and potential commas. */ - while (*ptr && (isspace(*ptr) || *ptr == ',')) + while (*ptr && (av_isspace(*ptr) || *ptr == ',')) ptr++; if (!*ptr) break; @@ -4022,7 +4022,7 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf, if (*ptr == '\"') ptr++; } else { - for (; *ptr && !(isspace(*ptr) || *ptr == ','); ptr++) + for (; *ptr && !(av_isspace(*ptr) || *ptr == ','); ptr++) if (dest && dest < dest_end) *dest++ = *ptr; } |