Increase internal precision in FXSYS_wcstof().
Convert e.g. "73.025" to 73.025002 instead of 73.024994. This is
what the system wcstof() seems to produce, and should allow changing
to that implementation without diffing.
Change-Id: If5f77a6cf1fd907fbf2c9374e980a25af35cf94e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/117350
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/DEPS b/DEPS
index d2a3d41..89b0be5 100644
--- a/DEPS
+++ b/DEPS
@@ -167,7 +167,7 @@
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling pdfium_tests
# and whatever else without interference from each other.
- 'pdfium_tests_revision': 'c640a037f1cf0172b1c7dc12024afab865d99522',
+ 'pdfium_tests_revision': 'fb95f93e24cbce917c23da62f6161db5216b5f3a',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling resultdb
# and whatever else without interference from each other.
diff --git a/core/fxcrt/fx_extension.cpp b/core/fxcrt/fx_extension.cpp
index d9206af..e44879c 100644
--- a/core/fxcrt/fx_extension.cpp
+++ b/core/fxcrt/fx_extension.cpp
@@ -48,13 +48,13 @@
break;
}
- float fValue = 0.0f;
+ double dValue = 0.0f;
while (nUsedLen < nLength) {
wchar_t wch = pwsStr[nUsedLen];
if (!FXSYS_IsDecimalDigit(wch))
break;
- fValue = fValue * 10.0f + (wch - L'0');
+ dValue = dValue * 10.0f + (wch - L'0');
nUsedLen++;
}
@@ -66,7 +66,7 @@
break;
}
- fValue += (wch - L'0') * fPrecise;
+ dValue += (wch - L'0') * fPrecise;
fPrecise *= 0.1f;
}
}
@@ -107,9 +107,9 @@
for (size_t i = exp_value; i > 0; --i) {
if (exp_value > 0) {
if (negative_exponent) {
- fValue /= 10;
+ dValue /= 10;
} else {
- fValue *= 10;
+ dValue *= 10;
}
}
}
@@ -119,7 +119,7 @@
*pUsedLen = nUsedLen;
}
- return bNegtive ? -fValue : fValue;
+ return static_cast<float>(bNegtive ? -dValue : dValue);
});
}
diff --git a/testing/resources/pixel/xfa_specific/barcode_test_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/barcode_test_expected.pdf.0.png
index f49d591..f2d1c5e 100644
--- a/testing/resources/pixel/xfa_specific/barcode_test_expected.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/barcode_test_expected.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/barcode_test_expected_skia.pdf.0.png b/testing/resources/pixel/xfa_specific/barcode_test_expected_skia.pdf.0.png
index e144c04..5286e5f 100644
--- a/testing/resources/pixel/xfa_specific/barcode_test_expected_skia.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/barcode_test_expected_skia.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/barcode_test_expected_skia_mac.pdf.0.png b/testing/resources/pixel/xfa_specific/barcode_test_expected_skia_mac.pdf.0.png
index 1faa8a7..629cb16 100644
--- a/testing/resources/pixel/xfa_specific/barcode_test_expected_skia_mac.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/barcode_test_expected_skia_mac.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/barcode_test_expected_skia_win.pdf.0.png b/testing/resources/pixel/xfa_specific/barcode_test_expected_skia_win.pdf.0.png
index 2e4ea63..9911d94 100644
--- a/testing/resources/pixel/xfa_specific/barcode_test_expected_skia_win.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/barcode_test_expected_skia_win.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected.pdf.0.png
index adfabbc..00575b6 100644
--- a/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia.pdf.0.png b/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia.pdf.0.png
index c2f5e48..2817767 100644
--- a/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia_mac.pdf.0.png b/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia_mac.pdf.0.png
index 71597b8..cfeb019 100644
--- a/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia_mac.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia_mac.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia_win.pdf.0.png b/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia_win.pdf.0.png
index 21ad45e..5453f60 100644
--- a/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia_win.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/resolve_nodes_0_expected_skia_win.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected.pdf.0.png
index 4bfe7c8..9217d51 100644
--- a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_mac.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_mac.pdf.0.png
index 4912da0..9c62c5d 100644
--- a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_mac.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_mac.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia.pdf.0.png
index ffc1b80..59b0396 100644
--- a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia_mac.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia_mac.pdf.0.png
index 32f4ca9..729112f 100644
--- a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia_mac.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia_mac.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia_win.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia_win.pdf.0.png
index d352038..68c86b8 100644
--- a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia_win.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_skia_win.pdf.0.png
Binary files differ
diff --git a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_win.pdf.0.png b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_win.pdf.0.png
index ffa36fe..f27e137 100644
--- a/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_win.pdf.0.png
+++ b/testing/resources/pixel/xfa_specific/xfa_node_caption_expected_win.pdf.0.png
Binary files differ