try to remove the spurious warning for static analysis

Change-Id: Ib81f16c70a0bfad05021401c1cf6788c974b63bd
This commit is contained in:
skal 2014-05-26 18:19:43 +02:00
parent a891164398
commit dc5b122f23

View File

@ -46,10 +46,13 @@ static WEBP_INLINE void StopwatchReset(Stopwatch* watch) {
}
static WEBP_INLINE double StopwatchReadAndReset(Stopwatch* watch) {
const struct timeval old_value = *watch;
struct timeval old_value;
double delta_sec, delta_usec;
memcpy(&old_value, watch, sizeof(old_value));
gettimeofday(watch, NULL);
return watch->tv_sec - old_value.tv_sec +
(watch->tv_usec - old_value.tv_usec) / 1000000.0;
delta_sec = (double)watch->tv_sec - old_value.tv_sec;
delta_usec = (double)watch->tv_usec - old_value.tv_usec;
return delta_sec + delta_usec / 1000000.0;
}
#endif /* _WIN32 */