From 47c79b79d57d017d590e9423cf1a93ed6bdfad38 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 7 Sep 2015 23:44:41 +0200 Subject: 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 --- libass/ass_strtod.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libass/ass_strtod.c') diff --git a/libass/ass_strtod.c b/libass/ass_strtod.c index 4e964049..566f6e4a 100644 --- a/libass/ass_strtod.c +++ b/libass/ass_strtod.c @@ -13,8 +13,8 @@ */ #include -#include #include +#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; } -- cgit v1.2.3