diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-08 14:57:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-08 14:57:41 +0100 |
commit | 6c17ff84ad8f2be64ddc9bd4955e1cc87842ac29 (patch) | |
tree | 48f9a7c9169dc29106f18a4ed13010e255d52bcb | |
parent | 80f91a70be5f03fc95eb89d222d760eeaf91b135 (diff) | |
parent | efa7f4202088c70caba11d7834641bc6eaf41830 (diff) | |
download | ffmpeg-6c17ff84ad8f2be64ddc9bd4955e1cc87842ac29.tar.gz |
Merge commit 'efa7f4202088c70caba11d7834641bc6eaf41830'
* commit 'efa7f4202088c70caba11d7834641bc6eaf41830':
Use the avstring.h locale-independent character type functions
avstring: Add locale independent versions of some ctype.h functions
Conflicts:
avprobe.c
doc/APIchanges
libavcodec/dvdsubdec.c
libavcodec/utils.c
libavutil/avstring.c
libavutil/avstring.h
libavutil/eval.c
libavutil/parseutils.c
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | doc/APIchanges | 3 | ||||
-rw-r--r-- | libavcodec/utils.c | 8 | ||||
-rw-r--r-- | libavfilter/af_channelmap.c | 8 | ||||
-rw-r--r-- | libavutil/avstring.c | 22 | ||||
-rw-r--r-- | libavutil/avstring.h | 21 | ||||
-rw-r--r-- | libavutil/version.h | 2 |
6 files changed, 38 insertions, 26 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index a1e81808e7..d4362c1b56 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -144,6 +144,9 @@ API changes, most recent first: 2012-03-26 - a67d9cf - lavfi 2.66.100 Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions. +2013-xx-xx - xxxxxxx - lavu 52.8.0 - avstring.h + Add av_isdigit, av_isgraph, av_isspace, av_isxdigit. + 2013-xx-xx - xxxxxxx - lavfi 3.4.0 - avfiltergraph.h Add resample_lavr_opts to AVFilterGraph for setting libavresample options for auto-inserted resample filters. diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 9aec72a8cc..72450decfd 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 av_toupper(x & 0xFF) - + (av_toupper((x >> 8) & 0xFF) << 8) - + (av_toupper((x >> 16) & 0xFF) << 16) - + (av_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/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index 6fe8704694..44ed717688 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -149,17 +149,17 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args) } else { char *dash = strchr(mapping, '-'); if (!dash) { // short mapping - if (isdigit(*mapping)) + if (av_isdigit(*mapping)) mode = MAP_ONE_INT; else mode = MAP_ONE_STR; - } else if (isdigit(*mapping)) { - if (isdigit(*(dash+1))) + } else if (av_isdigit(*mapping)) { + if (av_isdigit(*(dash+1))) mode = MAP_PAIR_INT_INT; else mode = MAP_PAIR_INT_STR; } else { - if (isdigit(*(dash+1))) + if (av_isdigit(*(dash+1))) mode = MAP_PAIR_STR_INT; else mode = MAP_PAIR_STR_STR; diff --git a/libavutil/avstring.c b/libavutil/avstring.c index 45f8d78172..788667e9d6 100644 --- a/libavutil/avstring.c +++ b/libavutil/avstring.c @@ -285,6 +285,28 @@ int av_escape(char **dst, const char *src, const char *special_chars, } } +int av_isdigit(int c) +{ + return c >= '0' && c <= '9'; +} + +int av_isgraph(int c) +{ + return c > 32 && c < 127; +} + +int av_isspace(int c) +{ + return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || + c == '\v'; +} + +int av_isxdigit(int c) +{ + c = av_tolower(c); + return av_isdigit(c) || (c >= 'a' && c <= 'z'); +} + #ifdef TEST int main(void) diff --git a/libavutil/avstring.h b/libavutil/avstring.h index 5b078f15ae..438ef799eb 100644 --- a/libavutil/avstring.h +++ b/libavutil/avstring.h @@ -188,26 +188,17 @@ char *av_strtok(char *s, const char *delim, char **saveptr); /** * Locale-independent conversion of ASCII isdigit. */ -static inline int av_isdigit(int c) -{ - return c >= '0' && c <= '9'; -} +int av_isdigit(int c); /** * Locale-independent conversion of ASCII isgraph. */ -static inline int av_isgraph(int c) -{ - return c > 32 && c < 127; -} +int av_isgraph(int c); /** * Locale-independent conversion of ASCII isspace. */ -static inline int av_isspace(int c) -{ - return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v'; -} +int av_isspace(int c); /** * Locale-independent conversion of ASCII characters to uppercase. @@ -232,11 +223,7 @@ static inline int av_tolower(int c) /** * Locale-independent conversion of ASCII isxdigit. */ -static inline int av_isxdigit(int c) -{ - c = av_tolower(c); - return av_isdigit(c) || (c >= 'a' && c <= 'z'); -} +int av_isxdigit(int c); /** * Locale-independent case-insensitive compare. diff --git a/libavutil/version.h b/libavutil/version.h index 4cd82268db..ee33390157 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -75,7 +75,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 52 -#define LIBAVUTIL_VERSION_MINOR 18 +#define LIBAVUTIL_VERSION_MINOR 19 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |