Lines Matching refs:diff
157 // The value should be monotonic increasing (e.g. diff >= 0);
239 // returns false if the diff is out of int32_t bounds or negative.
241 static inline bool checkedDiff(int32_t *diff, T x2, T x1, const char *coord) {
244 *diff = (int32_t)diff64; // intentionally lose precision
246 ALOGW("LinearMap: %s overflow diff(%lld) from %llu - %llu exceeds INT32_MAX",
251 ALOGW("LinearMap: %s negative diff(%lld) from %llu - %llu",
260 *diff = x2 - x1;
261 if (*diff < 0) {
262 ALOGW("LinearMap: %s negative diff(%d) from %u - %u",
263 coord, *diff, (unsigned)x2, (unsigned)x1);
310 int32_t diff = 0;
316 diff = v - vArray[current];
317 if (diff >= 0 ||
324 return uArray[current] + diff * extrapolation;
330 // that uStep, vStep, and diff are non-negative.
335 : ((int64_t)diff * uStep + (vStep >> 1)) / vStep + uArray[current];
336 // ALOGD("u:%u diff:%d uStep:%d vStep:%d u_current:%d",
337 // u, diff, uStep, vStep, uArray[current]);
339 *method = (diff >= 0) ?
350 return uArray[previous] + diff * extrapolation;