tests/opr/time-t.c: Use labs instead of abs for long argument

Resolves this warning with clang:

time-t.c:46:8: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause
      truncation of value [-Wabsolute-value]
    ok(abs(osTime - osNow) < 2, "opr_time_Now returns a reasonable value");
       ^
time-t.c:46:8: note: use function 'labs' instead
    ok(abs(osTime - osNow) < 2, "opr_time_Now returns a reasonable value");
       ^~~
       labs

Change-Id: Ib98069e1349161d936c8ada0e69f9b33d2f71ce3
Reviewed-on: http://gerrit.openafs.org/11965
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
Anders Kaseorg 2015-08-01 05:54:42 -04:00 committed by Benjamin Kaduk
parent 09bf3ebb26
commit ac39d879f8

View File

@ -43,7 +43,7 @@ main(int argc, char **argv)
is_int(0, opr_time_Now(&oprTime), "opr_time_Now succeeds");
osNow = time(NULL);
osTime = opr_time_ToSecs(&oprTime);
ok(abs(osTime - osNow) < 2, "opr_time_Now returns a reasonable value");
ok(labs(osTime - osNow) < 2, "opr_time_Now returns a reasonable value");
return 0;
}