Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use llabs instead of abs on 64bit integers.
  • Loading branch information
UllrichKossow authored and perexg committed Apr 15, 2015
1 parent 310a77c commit e3debcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plumbing/tsfix.c
Expand Up @@ -82,14 +82,14 @@ tsfix_ts_diff(int64_t ts1, int64_t ts2)
ts1 &= PTS_MASK;
ts2 &= PTS_MASK;

r = abs(ts1 - ts2);
r = llabs(ts1 - ts2);
if (r > (PTS_MASK / 2)) {
/* try to wrap the lowest value */
if (ts1 < ts2)
ts1 += PTS_MASK + 1;
else
ts2 += PTS_MASK + 1;
return abs(ts1 - ts2);
return llabs(ts1 - ts2);
}
return r;
}
Expand Down

0 comments on commit e3debcd

Please sign in to comment.