Index: src/xps/SkXPSDevice.cpp |
diff --git a/src/xps/SkXPSDevice.cpp b/src/xps/SkXPSDevice.cpp |
index aef9dc8baf8659b751c966becb167a9ccd3adcda..c7f03d33cd805c64646ce638418ab77a11b9967d 100644 |
--- a/src/xps/SkXPSDevice.cpp |
+++ b/src/xps/SkXPSDevice.cpp |
@@ -18,9 +18,9 @@ |
#include <XpsObjectModel.h> |
#include <T2EmbApi.h> |
#include <FontSub.h> |
+#include <limits> |
#include "SkColor.h" |
-#include "SkConstexprMath.h" |
#include "SkData.h" |
#include "SkDraw.h" |
#include "SkEndian.h" |
@@ -202,10 +202,10 @@ HRESULT SkXPSDevice::createXpsThumbnail(IXpsOMPage* page, |
"Could not create thumbnail generator."); |
SkTScopedComPtr<IOpcPartUri> partUri; |
- static const size_t size = SkTUMax< |
- SK_ARRAY_COUNT(L"/Documents/1/Metadata/.png") + SK_DIGITS_IN(pageNum), |
- SK_ARRAY_COUNT(L"/Metadata/" L_GUID_ID L".png") |
- >::value; |
+ constexpr size_t size = SkTMax<size_t>( |
bungeman-skia
2016/05/23 18:12:38
Both parameters are size_t now, so it shouldn't ne
hal.canary
2016/05/28 17:05:54
Done.
|
+ SK_ARRAY_COUNT(L"/Documents/1/Metadata/.png") |
+ + static_cast<size_t>(std::numeric_limits<unsigned>::digits10 + 1), |
bungeman-skia
2016/05/23 18:12:38
It's rather annoying that this indentation kinda h
hal.canary
2016/05/28 17:05:54
Done.
|
+ SK_ARRAY_COUNT(L"/Metadata/" L_GUID_ID L".png")); |
wchar_t buffer[size]; |
if (pageNum > 0) { |
swprintf_s(buffer, size, L"/Documents/1/Metadata/%u.png", pageNum); |
@@ -229,8 +229,9 @@ HRESULT SkXPSDevice::createXpsThumbnail(IXpsOMPage* page, |
HRESULT SkXPSDevice::createXpsPage(const XPS_SIZE& pageSize, |
IXpsOMPage** page) { |
- static const size_t size = SK_ARRAY_COUNT(L"/Documents/1/Pages/.fpage") |
- + SK_DIGITS_IN(fCurrentPage); |
+ constexpr size_t size = |
+ SK_ARRAY_COUNT(L"/Documents/1/Pages/.fpage") |
+ + static_cast<size_t>(std::numeric_limits<unsigned>::digits10 + 1); |
wchar_t buffer[size]; |
swprintf_s(buffer, size, L"/Documents/1/Pages/%u.fpage", |
this->fCurrentPage); |