summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/z_Linux_util.c
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2015-06-04 17:29:13 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2015-06-04 17:29:13 +0000
commit1e7a1ddcee54477d84ed286e4a3932db0fd682a5 (patch)
tree6db0e013c4a93e8c053e7e49de63790fa9bf47b7 /openmp/runtime/src/z_Linux_util.c
parent185579bf0cc4bb44fade923231d8db65535b5dd6 (diff)
downloadbcm5719-llvm-1e7a1ddcee54477d84ed286e4a3932db0fd682a5.tar.gz
bcm5719-llvm-1e7a1ddcee54477d84ed286e4a3932db0fd682a5.zip
Fix some sign compare warnings.
This change changes kmp_bstate.old_tid to sign integer instead of unsigned integer. It also defines two new macros KMP_NSEC_PER_SEC and KMP_USEC_PER_SEC which lets us take control of the sign (we want them to be longs). Also, in kmp_wait_release.h, the byteref() function's return type is changed from char to unsigned char. llvm-svn: 239057
Diffstat (limited to 'openmp/runtime/src/z_Linux_util.c')
-rw-r--r--openmp/runtime/src/z_Linux_util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/openmp/runtime/src/z_Linux_util.c b/openmp/runtime/src/z_Linux_util.c
index 55f9bdfc610..c624c9d9f09 100644
--- a/openmp/runtime/src/z_Linux_util.c
+++ b/openmp/runtime/src/z_Linux_util.c
@@ -843,7 +843,7 @@ __kmp_launch_monitor( void *thr )
interval.tv_nsec = 0;
} else {
interval.tv_sec = 0;
- interval.tv_nsec = (NSEC_PER_SEC / __kmp_monitor_wakeups);
+ interval.tv_nsec = (KMP_NSEC_PER_SEC / __kmp_monitor_wakeups);
}
KA_TRACE( 10, ("__kmp_launch_monitor: #2 monitor\n" ) );
@@ -870,9 +870,9 @@ __kmp_launch_monitor( void *thr )
now.tv_sec += interval.tv_sec;
now.tv_nsec += interval.tv_nsec;
- if (now.tv_nsec >= NSEC_PER_SEC) {
+ if (now.tv_nsec >= KMP_NSEC_PER_SEC) {
now.tv_sec += 1;
- now.tv_nsec -= NSEC_PER_SEC;
+ now.tv_nsec -= KMP_NSEC_PER_SEC;
}
status = pthread_mutex_lock( & __kmp_wait_mx.m_mutex );
@@ -2248,14 +2248,14 @@ __kmp_elapsed( double *t )
status = clock_gettime( CLOCK_PROCESS_CPUTIME_ID, &ts );
KMP_CHECK_SYSFAIL_ERRNO( "clock_gettime", status );
- *t = (double) ts.tv_nsec * (1.0 / (double) NSEC_PER_SEC) +
+ *t = (double) ts.tv_nsec * (1.0 / (double) KMP_NSEC_PER_SEC) +
(double) ts.tv_sec;
# else
struct timeval tv;
status = gettimeofday( & tv, NULL );
KMP_CHECK_SYSFAIL_ERRNO( "gettimeofday", status );
- *t = (double) tv.tv_usec * (1.0 / (double) USEC_PER_SEC) +
+ *t = (double) tv.tv_usec * (1.0 / (double) KMP_USEC_PER_SEC) +
(double) tv.tv_sec;
# endif
}
OpenPOWER on IntegriCloud