input: handle change in std::span::size type

The pre-standardized version of std::span in external/libcxx had a
ptrdiff_t size, but the finalized std::span has a size_t size instead.
Also, the std::span::index_type typedef is renamed to size_type. Use an
old-style constructor call to implicitly coerce the size value to the
proper type.

Insert a cast to avoid a signedness comparison warning.

Bug: b/175635923
Test: treehugger
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5a8af506b234685a0749b5753ba205c06688f870)
Merged-In: I96ccf6d5b54d4118b096f97c901073b4fc2f6f9f
Change-Id: I96ccf6d5b54d4118b096f97c901073b4fc2f6f9f
diff --git a/libs/input/MotionPredictor.cpp b/libs/input/MotionPredictor.cpp
index f7ca5e7..5736ad7 100644
--- a/libs/input/MotionPredictor.cpp
+++ b/libs/input/MotionPredictor.cpp
@@ -181,7 +181,8 @@
     int64_t predictionTime = mBuffers->lastTimestamp();
     const int64_t futureTime = timestamp + mPredictionTimestampOffsetNanos;
 
-    for (int i = 0; i < predictedR.size() && predictionTime <= futureTime; ++i) {
+    for (size_t i = 0; i < static_cast<size_t>(predictedR.size()) && predictionTime <= futureTime;
+         ++i) {
         if (predictedR[i] < mModel->config().distanceNoiseFloor) {
             // Stop predicting when the predicted output is below the model's noise floor.
             //
@@ -198,7 +199,7 @@
         const TfLiteMotionPredictorSample::Point predictedPoint =
                 convertPrediction(axisFrom, axisTo, predictedR[i], predictedPhi[i]);
 
-        ALOGD_IF(isDebug(), "prediction %d: %f, %f", i, predictedPoint.x, predictedPoint.y);
+        ALOGD_IF(isDebug(), "prediction %zu: %f, %f", i, predictedPoint.x, predictedPoint.y);
         PointerCoords coords;
         coords.clear();
         coords.setAxisValue(AMOTION_EVENT_AXIS_X, predictedPoint.x);