Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: core/src/fxcrt/fx_extension.cpp

Issue 1405253007: Revert "Revert "Cleanup some numeric code."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix mac build Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fxcrt/fx_extension.cpp
diff --git a/core/src/fxcrt/fx_extension.cpp b/core/src/fxcrt/fx_extension.cpp
index d64a06d08b7fcc2dfc6f070037e73f76bb1aa7b4..a75cfb48df462d681679be002e6ef6a32bf88186 100644
--- a/core/src/fxcrt/fx_extension.cpp
+++ b/core/src/fxcrt/fx_extension.cpp
@@ -13,6 +13,15 @@
#include <ctime>
#endif
+#include <cctype>
+
+int HexCharToDigit(char c) {
+ if (!std::isxdigit(c))
+ return 0;
+ char upchar = std::toupper(c);
+ return upchar > '9' ? upchar - 'A' + 10 : upchar - '0';
+}
+
IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes) {
IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create();
if (!pFA) {

Powered by Google App Engine
This is Rietveld 408576698