summaryrefslogtreecommitdiffstats
path: root/src/profiler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiler.c')
-rw-r--r--src/profiler.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/profiler.c b/src/profiler.c
index 780b958..504d713 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -287,11 +287,13 @@ profile_equal(proftime_T *tm1, proftime_T *tm2)
profile_cmp(const proftime_T *tm1, const proftime_T *tm2)
{
# ifdef MSWIN
- return (int)(tm2->QuadPart - tm1->QuadPart);
+ return tm2->QuadPart == tm1->QuadPart ? 0 :
+ tm2->QuadPart > tm1->QuadPart ? 1 : -1;
# else
if (tm1->tv_sec == tm2->tv_sec)
- return tm2->tv_fsec - tm1->tv_fsec;
- return tm2->tv_sec - tm1->tv_sec;
+ return tm2->tv_fsec == tm1->tv_fsec ? 0 :
+ tm2->tv_fsec > tm1->tv_fsec ? 1 : -1;
+ return tm2->tv_sec > tm1->tv_sec ? 1 : -1;
# endif
}