summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-30 15:42:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-30 15:42:00 +0000
commitdddfdad6ebb4e7172ff36f5a0db8a5cbf58d45f3 (patch)
tree2098bca3a3218c2480620a02f0e5ef479dad4653 /samples
parent56569acb6daa4d487a3d3eccce5784028873651c (diff)
downloadpdfium-dddfdad6ebb4e7172ff36f5a0db8a5cbf58d45f3.tar.xz
Run clang-tidy modernize-use-auto on //third_party/pdfium
See the bugs and cxx post for justification and details: https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8 This change was done using clang-tidy as described here: https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md Bug: chromium:776257 Change-Id: I1f6637cde8b3e41825993a736bed6763dd7beacb Reviewed-on: https://pdfium-review.googlesource.com/19971 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/pdfium_test.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index bc0ad86297..97090cfadf 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -154,7 +154,7 @@ std::string WritePpm(const char* pdf_name,
int stride,
int width,
int height) {
- const char* buffer = reinterpret_cast<const char*>(buffer_void);
+ const auto* buffer = reinterpret_cast<const char*>(buffer_void);
if (!CheckDimensions(stride, width, height))
return "";
@@ -451,7 +451,7 @@ std::string WritePng(const char* pdf_name,
return "";
std::vector<unsigned char> png_encoding;
- const unsigned char* buffer = static_cast<const unsigned char*>(buffer_void);
+ const auto* buffer = static_cast<const unsigned char*>(buffer_void);
if (!image_diff_png::EncodeBGRAPNG(
buffer, width, height, stride, false, &png_encoding)) {
fprintf(stderr, "Failed to convert bitmap to PNG\n");
@@ -644,7 +644,7 @@ int ExampleAppResponse(IPDF_JSPLATFORM*,
GetPlatformWString(label).c_str(), is_password, length);
// UTF-16, always LE regardless of platform.
- uint8_t* ptr = static_cast<uint8_t*>(response);
+ auto* ptr = static_cast<uint8_t*>(response);
ptr[0] = 'N';
ptr[1] = 0;
ptr[2] = 'o';
@@ -1249,8 +1249,8 @@ bool RenderPage(const std::string& name,
if (!options.scale_factor_as_string.empty())
std::stringstream(options.scale_factor_as_string) >> scale;
- int width = static_cast<int>(FPDF_GetPageWidth(page) * scale);
- int height = static_cast<int>(FPDF_GetPageHeight(page) * scale);
+ auto width = static_cast<int>(FPDF_GetPageWidth(page) * scale);
+ auto height = static_cast<int>(FPDF_GetPageHeight(page) * scale);
int alpha = FPDFPage_HasTransparency(page) ? 1 : 0;
std::unique_ptr<void, FPDFBitmapDeleter> bitmap(
FPDFBitmap_Create(width, height, alpha));