mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 22:58:44 +00:00
svg_loader util: just fix a typo
exponet -> exponent
This commit is contained in:
parent
5a6240bdf3
commit
d9f421ff4a
1 changed files with 8 additions and 8 deletions
|
@ -164,12 +164,12 @@ float svgUtilStrtof(const char *nPtr, char **endPtr)
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int exponetPart = 0;
|
unsigned int exponentPart = 0;
|
||||||
|
|
||||||
if (isdigit(*iter)) {
|
if (isdigit(*iter)) {
|
||||||
while (*iter == 0) iter++;
|
while (*iter == 0) iter++;
|
||||||
for (; isdigit(*iter); iter++) {
|
for (; isdigit(*iter); iter++) {
|
||||||
exponetPart = exponetPart * 10U + static_cast<unsigned int>(*iter - '0');
|
exponentPart = exponentPart * 10U + static_cast<unsigned int>(*iter - '0');
|
||||||
}
|
}
|
||||||
} else if (!isdigit(*(a - 1))) {
|
} else if (!isdigit(*(a - 1))) {
|
||||||
a = nPtr;
|
a = nPtr;
|
||||||
|
@ -178,14 +178,14 @@ float svgUtilStrtof(const char *nPtr, char **endPtr)
|
||||||
goto success;
|
goto success;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_floatExact(val, 2.2250738585072011f)) && ((minus_e * static_cast<int>(exponetPart)) == -308)) {
|
if ((_floatExact(val, 2.2250738585072011f)) && ((minus_e * static_cast<int>(exponentPart)) == -308)) {
|
||||||
val *= 1.0e-308f;
|
val *= 1.0e-308f;
|
||||||
a = iter;
|
a = iter;
|
||||||
errno = ERANGE;
|
errno = ERANGE;
|
||||||
goto success;
|
goto success;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_floatExact(val, 2.2250738585072012f)) && ((minus_e * static_cast<int>(exponetPart)) <= -308)) {
|
if ((_floatExact(val, 2.2250738585072012f)) && ((minus_e * static_cast<int>(exponentPart)) <= -308)) {
|
||||||
val *= 1.0e-308f;
|
val *= 1.0e-308f;
|
||||||
a = iter;
|
a = iter;
|
||||||
goto success;
|
goto success;
|
||||||
|
@ -194,13 +194,13 @@ float svgUtilStrtof(const char *nPtr, char **endPtr)
|
||||||
a = iter;
|
a = iter;
|
||||||
auto scale = 1.0f;
|
auto scale = 1.0f;
|
||||||
|
|
||||||
while (exponetPart >= 8U) {
|
while (exponentPart >= 8U) {
|
||||||
scale *= 1E8;
|
scale *= 1E8;
|
||||||
exponetPart -= 8U;
|
exponentPart -= 8U;
|
||||||
}
|
}
|
||||||
while (exponetPart > 0U) {
|
while (exponentPart > 0U) {
|
||||||
scale *= 10.0f;
|
scale *= 10.0f;
|
||||||
exponetPart--;
|
exponentPart--;
|
||||||
}
|
}
|
||||||
val = (minus_e == -1) ? (val / scale) : (val * scale);
|
val = (minus_e == -1) ? (val / scale) : (val * scale);
|
||||||
} else if ((iter > nPtr) && !isdigit(*(iter - 1))) {
|
} else if ((iter > nPtr) && !isdigit(*(iter - 1))) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue