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.
This commit is contained in:
		@@ -317,28 +317,6 @@ 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 <= 'f');
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int av_match_name(const char *name, const char *names)
 | 
					int av_match_name(const char *name, const char *names)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const char *p;
 | 
					    const char *p;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -203,17 +203,27 @@ char *av_strtok(char *s, const char *delim, char **saveptr);
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 * Locale-independent conversion of ASCII isdigit.
 | 
					 * 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.
 | 
					 * 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.
 | 
					 * 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.
 | 
					 * 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.
 | 
					 * 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.
 | 
					 * Locale-independent case-insensitive compare.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user