summaryrefslogtreecommitdiff
path: root/source/svg
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-09-17 22:48:46 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-09-18 15:43:47 +0800
commit5f07a4df2f4ef85b21ca0f447606c32cc05752f3 (patch)
tree84371d4b93a8a34f6b8995a318f974169aa7ac21 /source/svg
parent4f79809193250b8f791b2f56afc1bc3a1da24956 (diff)
downloadmupdf-5f07a4df2f4ef85b21ca0f447606c32cc05752f3.tar.xz
svg: Use fz_atof() and fz_strtod().
Diffstat (limited to 'source/svg')
-rw-r--r--source/svg/svg-color.c4
-rw-r--r--source/svg/svg-parse.c10
-rw-r--r--source/svg/svg-run.c2
3 files changed, 8 insertions, 8 deletions
diff --git a/source/svg/svg-color.c b/source/svg/svg-color.c
index 3fef124e..4f6031e7 100644
--- a/source/svg/svg-color.c
+++ b/source/svg/svg-color.c
@@ -230,11 +230,11 @@ svg_parse_color(fz_context *ctx, svg_document *doc, char *str, float *rgb)
if (*str == '%')
{
str ++;
- rgb[i] = atof(numberbuf) / 100.0;
+ rgb[i] = fz_atof(numberbuf) / 100.0;
}
else
{
- rgb[i] = atof(numberbuf) / 255.0;
+ rgb[i] = fz_atof(numberbuf) / 255.0;
}
}
}
diff --git a/source/svg/svg-parse.c b/source/svg/svg-parse.c
index b8db376f..ac7731e1 100644
--- a/source/svg/svg-parse.c
+++ b/source/svg/svg-parse.c
@@ -42,7 +42,7 @@ svg_lex_number(float *fp, const char *ss)
while (*s >= '0' && *s <= '9')
++s;
}
- *fp = atof(ss);
+ *fp = fz_atof(ss);
return s;
}
@@ -52,7 +52,7 @@ svg_parse_number(const char *str, float min, float max, float inherit)
float x;
if (!strcmp(str, "inherit"))
return inherit;
- x = atof(str);
+ x = fz_atof(str);
if (x < min) return min;
if (x > max) return max;
return x;
@@ -65,7 +65,7 @@ svg_parse_length(const char *str, float percent, float font_size)
char *end;
float val;
- val = (float)strtod(str, &end);
+ val = (float)fz_strtod(str, &end);
if (end == str)
return 0; /* failed */
@@ -96,7 +96,7 @@ svg_parse_angle(const char *str)
char *end;
float val;
- val = (float)strtod(str, &end);
+ val = (float)fz_strtod(str, &end);
if (end == str)
return 0; /* failed */
@@ -170,7 +170,7 @@ svg_parse_transform(fz_context *ctx, svg_document *doc, char *str, fz_matrix *tr
number[numberlen++] = *str++;
number[numberlen] = 0;
- args[nargs++] = atof(number);
+ args[nargs++] = fz_atof(number);
while (svg_is_whitespace_or_comma(*str))
str ++;
diff --git a/source/svg/svg-run.c b/source/svg/svg-run.c
index f0427341..0a72e508 100644
--- a/source/svg/svg-run.c
+++ b/source/svg/svg-run.c
@@ -940,7 +940,7 @@ svg_parse_document_bounds(fz_context *ctx, svg_document *doc, fz_xml *root)
version = 10;
if (version_att)
- version = atof(version_att) * 10;
+ version = fz_atof(version_att) * 10;
if (version > 12)
fz_warn(ctx, "svg document version is newer than we support");