Add explicit casts in pdfium_test_event_helper.cc
Implicit casts from an integer to a float generates a warning or error
in some environments due to loss of precision.
PiperOrigin-RevId: 306641817
Change-Id: I00b64704505d76d074bb4332c6f4ee9d76e5cbac
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/68790
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andrew Weintraub <asweintraub@google.com>
diff --git a/samples/pdfium_test_event_helper.cc b/samples/pdfium_test_event_helper.cc
index f45063d..1fe30c3 100644
--- a/samples/pdfium_test_event_helper.cc
+++ b/samples/pdfium_test_event_helper.cc
@@ -131,7 +131,8 @@
return;
}
- const FS_POINTF point = {atoi(tokens[1].c_str()), atoi(tokens[2].c_str())};
+ const FS_POINTF point = {static_cast<float>(atoi(tokens[1].c_str())),
+ static_cast<float>(atoi(tokens[2].c_str()))};
int delta_x = atoi(tokens[3].c_str());
int delta_y = atoi(tokens[4].c_str());
int modifiers = tokens.size() >= 6 ? GetModifiers(tokens[5]) : 0;