summaryrefslogtreecommitdiff
path: root/third_party/skia_shared/SkFloatToDecimal.cpp
diff options
context:
space:
mode:
authorJonathan Feinberg <feinberg@google.com>2018-02-22 19:16:55 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-22 19:16:55 +0000
commit3185187d256ca26f2c1bf8d29196f4ac4462907e (patch)
treebc1f76d23b1fafdac2ec0899efd9a33c201ce6a1 /third_party/skia_shared/SkFloatToDecimal.cpp
parentaa2aff78e082f14e4bc418f68b27817f90e3f07a (diff)
downloadpdfium-3185187d256ca26f2c1bf8d29196f4ac4462907e.tar.xz
Add namespaces to duplicated Skia code.
When pdfium is imported into Google's internal repository, the recently copied Skia decimal formatting code causes only-defined-once violations because many Google internal projects depends on Skia through Google's own copy. This patch puts pdfium's private copy of the needed function into a namespace. Change-Id: Id102b17f6f4652e4a50c4ff75825468fc3d90727 Reviewed-on: https://pdfium-review.googlesource.com/27530 Reviewed-by: Hal Canary <halcanary@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'third_party/skia_shared/SkFloatToDecimal.cpp')
-rw-r--r--third_party/skia_shared/SkFloatToDecimal.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/third_party/skia_shared/SkFloatToDecimal.cpp b/third_party/skia_shared/SkFloatToDecimal.cpp
index ac24a11e91..1f99990b8f 100644
--- a/third_party/skia_shared/SkFloatToDecimal.cpp
+++ b/third_party/skia_shared/SkFloatToDecimal.cpp
@@ -48,6 +48,8 @@ static double pow10(int e) {
}
}
+namespace pdfium {
+namespace skia {
/** Write a string into result, includeing a terminating '\0' (for
unit testing). Return strlen(result) (for SkWStream::write) The
resulting string will be in the form /[-]?([0-9]*.)?[0-9]+/ and
@@ -172,3 +174,5 @@ unsigned SkFloatToDecimal(float value, char result[kMaximumSkFloatToDecimalLengt
*output = '\0';
return static_cast<unsigned>(output - result);
}
+} // namespace skia
+} // namespace pdfium