summaryrefslogtreecommitdiff
path: root/libavutil/avstring.h
diff options
context:
space:
mode:
authorHenrik Gramner <henrik@gramner.com>2015-09-26 18:04:11 +0200
committerHenrik Gramner <henrik@gramner.com>2015-09-26 22:08:02 +0200
commitad9a543e9351d940a53450f793458664c8a74a73 (patch)
tree9bbf38f4128e46d80b1d3ed8edf8258e0b6b3b36 /libavutil/avstring.h
parent4e03f0ab08e27537512107cba6e357d34284a35f (diff)
downloadffmpeg-ad9a543e9351d940a53450f793458664c8a74a73.tar.gz
avutil/avstring: Inline some tiny functions
They're short enough that inlining them actually reduces code size due to all the overhead associated with making a function call.
Diffstat (limited to 'libavutil/avstring.h')
-rw-r--r--libavutil/avstring.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/libavutil/avstring.h b/libavutil/avstring.h
index 234c03078b..a306e8974d 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -203,17 +203,27 @@ char *av_strtok(char *s, const char *delim, char **saveptr);
/**
* Locale-independent conversion of ASCII isdigit.
*/
-av_const int av_isdigit(int c);
+static inline av_const int av_isdigit(int c)
+{
+ return c >= '0' && c <= '9';
+}
/**
* Locale-independent conversion of ASCII isgraph.
*/
-av_const int av_isgraph(int c);
+static inline av_const int av_isgraph(int c)
+{
+ return c > 32 && c < 127;
+}
/**
* Locale-independent conversion of ASCII isspace.
*/
-av_const int av_isspace(int c);
+static inline av_const int av_isspace(int c)
+{
+ return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' ||
+ c == '\v';
+}
/**
* Locale-independent conversion of ASCII characters to uppercase.
@@ -238,7 +248,11 @@ static inline av_const int av_tolower(int c)
/**
* Locale-independent conversion of ASCII isxdigit.
*/
-av_const int av_isxdigit(int c);
+static inline av_const int av_isxdigit(int c)
+{
+ c = av_tolower(c);
+ return av_isdigit(c) || (c >= 'a' && c <= 'f');
+}
/**
* Locale-independent case-insensitive compare.