diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2013-03-03 11:17:50 +0100 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-03-07 15:16:36 +0200 |
commit | efa7f4202088c70caba11d7834641bc6eaf41830 (patch) | |
tree | 7ef0beba253b642affcc69f634f192fdc7c12428 /libavformat | |
parent | 12c5c1d3e3906e18a96ec380605d2f1504fc3d3b (diff) | |
download | ffmpeg-efa7f4202088c70caba11d7834641bc6eaf41830.tar.gz |
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 '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/urldecode.c | 3 | ||||
-rw-r--r-- | libavformat/utils.c | 10 |
8 files changed, 15 insertions, 17 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index 4c0e0c0b63..0d691ec47e 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -108,7 +108,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 b750501c4d..fde7191c35 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 9645bd1ffb..730a5b1b2f 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -278,9 +278,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); @@ -305,7 +305,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 774ee2134f..b96da3ef12 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 bb41b52ca2..db462fc865 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 80a983bd11..e67abba57c 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/urldecode.c b/libavformat/urldecode.c index 32460da4f9..49af9ba1e0 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 be5a5caabf..a89e956d8d 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3050,11 +3050,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 '%': @@ -3255,7 +3255,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') @@ -3365,7 +3365,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; @@ -3398,7 +3398,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; } |