summaryrefslogtreecommitdiff
path: root/src/common/timer.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-07-10 16:59:55 +0200
committerHaru <haru@dotalux.com>2014-07-11 08:47:27 +0200
commit68e7f53f05dd80e8b4ab9d84c9931df22a6b060c (patch)
tree5b3d0f0b2f7aad19735b16c8a443a9534d0f5224 /src/common/timer.c
parent8b4f35532c8fd7c7f0939756923fdaf14ee39531 (diff)
downloadhercules-68e7f53f05dd80e8b4ab9d84c9931df22a6b060c.tar.gz
hercules-68e7f53f05dd80e8b4ab9d84c9931df22a6b060c.tar.bz2
hercules-68e7f53f05dd80e8b4ab9d84c9931df22a6b060c.tar.xz
hercules-68e7f53f05dd80e8b4ab9d84c9931df22a6b060c.zip
Fixed reserved __identifier violations
- Complies with CERT DCL37-C - Fixes issue #293 (special thanks to elfring) Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/timer.c')
-rw-r--r--src/common/timer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/timer.c b/src/common/timer.c
index ab0471d51..128fc4daf 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -107,7 +107,7 @@ char* search_timer_func_list(TimerFunc func)
#if defined(ENABLE_RDTSC)
static uint64 RDTSC_BEGINTICK = 0, RDTSC_CLOCK = 0;
-static __inline uint64 _rdtsc(){
+static __inline uint64 rdtsc_() {
register union{
uint64 qw;
uint32 dw[2];
@@ -127,14 +127,14 @@ static void rdtsc_calibrate(){
RDTSC_CLOCK = 0;
for(i = 0; i < 5; i++){
- t1 = _rdtsc();
+ t1 = rdtsc_();
usleep(1000000); //1000 MS
- t2 = _rdtsc();
+ t2 = rdtsc_();
RDTSC_CLOCK += (t2 - t1) / 1000;
}
RDTSC_CLOCK /= 5;
- RDTSC_BEGINTICK = _rdtsc();
+ RDTSC_BEGINTICK = rdtsc_();
ShowMessage(" done. (Frequency: %u Mhz)\n", (uint32)(RDTSC_CLOCK/1000) );
}
@@ -175,7 +175,7 @@ static int64 sys_tick(void) {
#elif defined(ENABLE_RDTSC)
// RDTSC: Returns the number of CPU cycles since reset. Unreliable if
// the CPU frequency is variable.
- return (int64)((_rdtsc() - RDTSC_BEGINTICK) / RDTSC_CLOCK);
+ return (int64)((rdtsc_() - RDTSC_BEGINTICK) / RDTSC_CLOCK);
#elif defined(HAVE_MONOTONIC_CLOCK)
// Monotonic clock: Implementation-defined.
// Clock that cannot be set and represents monotonic time since some