diff options
author | Grigori Goronzy <greg@chown.ath.cx> | 2015-09-07 23:44:41 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@chown.ath.cx> | 2015-09-11 01:12:47 +0200 |
commit | 47c79b79d57d017d590e9423cf1a93ed6bdfad38 (patch) | |
tree | 030579ca5e133ef3a896755ef8bcea51e91cc401 /libass/ass_strtod.c | |
parent | 448bc77c909009e5a75cf93f41fcfce0ebedd7eb (diff) | |
download | libass-47c79b79d57d017d590e9423cf1a93ed6bdfad38.tar.bz2 libass-47c79b79d57d017d590e9423cf1a93ed6bdfad38.tar.xz |
NIH: add locale-independent string functions
OS or platform-specific locale independent functions are painful to
use and/or not available, so roll our own. Not great but the least
painful and least intrusive.
v2: fix indexing, use static inline
Diffstat (limited to 'libass/ass_strtod.c')
-rw-r--r-- | libass/ass_strtod.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libass/ass_strtod.c b/libass/ass_strtod.c index 4e96404..566f6e4 100644 --- a/libass/ass_strtod.c +++ b/libass/ass_strtod.c @@ -13,8 +13,8 @@ */ #include <stdlib.h> -#include <ctype.h> #include <errno.h> +#include "ass_string.h" static const int maxExponent = 511; /* Largest possible base 10 exponent. Any @@ -100,7 +100,7 @@ ass_strtod( */ p = string; - while (isspace(*p)) { + while (ass_isspace(*p)) { p += 1; } if (*p == '-') { @@ -122,7 +122,7 @@ ass_strtod( for (mantSize = 0; ; mantSize += 1) { c = *p; - if (!isdigit(c)) { + if (!ass_isdigit(c)) { if ((c != '.') || (decPt >= 0)) { break; } @@ -198,7 +198,7 @@ ass_strtod( } expSign = 0; } - while (isdigit(*p)) { + while (ass_isdigit(*p)) { exp = exp * 10 + (*p - '0'); p += 1; } |