Tools/ChangeLog

 12010-12-23 Evan Martin <evan@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 [chromium] LayoutTestController warning in float->int conversion
 6 https://bugs.webkit.org/show_bug.cgi?id=51553
 7
 8 Rather than reading an int, converting to a float, then getting a compiler
 9 warning on passing the float to something that expects an int, instead
 10 just pass around ints.
 11
 12 No tests, fixes a compiler warning.
 13
 14 * DumpRenderTree/chromium/LayoutTestController.cpp:
 15 (parsePageSizeParameters):
 16 (LayoutTestController::pageNumberForElementById):
 17 (LayoutTestController::numberOfPages):
 18
1192010-12-23 Lucas Forschler <lforschler@apple.com>
220
321 Reviewed by Darin Adler.

Tools/DumpRenderTree/chromium/LayoutTestController.cpp

@@void LayoutTestController::counterValueForElementById(const CppArgumentList& arg
13791379
13801380static bool parsePageSizeParameters(const CppArgumentList& arguments,
13811381 int argOffset,
1382  float* pageWidthInPixels,
1383  float* pageHeightInPixels)
 1382 int* pageWidthInPixels,
 1383 int* pageHeightInPixels)
13841384{
13851385 // WebKit is using the window width/height of DumpRenderTree as the
13861386 // default value of the page size.

@@static bool parsePageSizeParameters(const CppArgumentList& arguments,
13911391 case 2:
13921392 if (!arguments[argOffset].isNumber() || !arguments[1 + argOffset].isNumber())
13931393 return false;
1394  *pageWidthInPixels = static_cast<float>(arguments[argOffset].toInt32());
1395  *pageHeightInPixels = static_cast<float>(arguments[1 + argOffset].toInt32());
 1394 *pageWidthInPixels = arguments[argOffset].toInt32();
 1395 *pageHeightInPixels = arguments[1 + argOffset].toInt32();
13961396 // fall through.
13971397 case 0:
13981398 break;

@@static bool parsePageSizeParameters(const CppArgumentList& arguments,
14051405void LayoutTestController::pageNumberForElementById(const CppArgumentList& arguments, CppVariant* result)
14061406{
14071407 result->setNull();
1408  float pageWidthInPixels = 0;
1409  float pageHeightInPixels = 0;
 1408 int pageWidthInPixels = 0;
 1409 int pageHeightInPixels = 0;
14101410 if (!parsePageSizeParameters(arguments, 1,
14111411 &pageWidthInPixels, &pageHeightInPixels))
14121412 return;

@@void LayoutTestController::pageNumberForElementById(const CppArgumentList& argum
14161416 if (!frame)
14171417 return;
14181418 result->set(frame->pageNumberForElementById(cppVariantToWebString(arguments[0]),
1419  pageWidthInPixels, pageHeightInPixels));
 1419 static_cast<float>(pageWidthInPixels),
 1420 static_cast<float>(pageHeightInPixels)));
14201421}
14211422
14221423void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVariant* result)
14231424{
14241425 result->setNull();
1425  float pageWidthInPixels = 0;
1426  float pageHeightInPixels = 0;
 1426 int pageWidthInPixels = 0;
 1427 int pageHeightInPixels = 0;
14271428 if (!parsePageSizeParameters(arguments, 0, &pageWidthInPixels, &pageHeightInPixels))
14281429 return;
14291430