summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--src/Timer.cxx8
-rw-r--r--src/event/Loop.cxx8
-rw-r--r--src/system/Clock.cxx (renamed from src/system/clock.c)8
-rw-r--r--src/system/Clock.hxx (renamed from src/system/clock.h)14
5 files changed, 16 insertions, 24 deletions
diff --git a/Makefile.am b/Makefile.am
index 55975fe53..064c181c2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -278,7 +278,7 @@ libsystem_a_SOURCES = \
src/system/EventFD.cxx src/system/EventFD.hxx \
src/system/SignalFD.cxx src/system/SignalFD.hxx \
src/system/EPollFD.cxx src/system/EPollFD.hxx \
- src/system/clock.c src/system/clock.h
+ src/system/Clock.cxx src/system/Clock.hxx
# Event loop library
diff --git a/src/Timer.cxx b/src/Timer.cxx
index 75fba03aa..e32ebe04b 100644
--- a/src/Timer.cxx
+++ b/src/Timer.cxx
@@ -20,7 +20,7 @@
#include "config.h"
#include "Timer.hxx"
#include "AudioFormat.hxx"
-#include "system/clock.h"
+#include "system/Clock.hxx"
#include <glib.h>
@@ -37,7 +37,7 @@ Timer::Timer(const AudioFormat af)
void Timer::Start()
{
- time = monotonic_clock_us();
+ time = MonotonicClockUS();
started = true;
}
@@ -58,7 +58,7 @@ void Timer::Add(int size)
unsigned Timer::GetDelay() const
{
- int64_t delay = (int64_t)(time - monotonic_clock_us()) / 1000;
+ int64_t delay = (int64_t)(time - MonotonicClockUS()) / 1000;
if (delay < 0)
return 0;
@@ -74,7 +74,7 @@ void Timer::Synchronize() const
assert(started);
- sleep_duration = time - monotonic_clock_us();
+ sleep_duration = time - MonotonicClockUS();
if (sleep_duration > 0)
g_usleep(sleep_duration);
}
diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx
index faf967f21..e8d9e4b96 100644
--- a/src/event/Loop.cxx
+++ b/src/event/Loop.cxx
@@ -19,10 +19,10 @@
#include "config.h"
#include "Loop.hxx"
-#include "system/clock.h"
#ifdef USE_EPOLL
+#include "system/Clock.hxx"
#include "TimeoutMonitor.hxx"
#include "SocketMonitor.hxx"
#include "IdleMonitor.hxx"
@@ -31,7 +31,7 @@
EventLoop::EventLoop(Default)
:SocketMonitor(*this),
- now_ms(::monotonic_clock_ms()),
+ now_ms(::MonotonicClockMS()),
quit(false),
n_events(0),
thread(ThreadId::Null())
@@ -114,7 +114,7 @@ EventLoop::Run()
assert(!quit);
do {
- now_ms = ::monotonic_clock_ms();
+ now_ms = ::MonotonicClockMS();
/* invoke timers */
@@ -162,7 +162,7 @@ EventLoop::Run()
const int n = epoll.Wait(events, MAX_EVENTS, timeout_ms);
n_events = std::max(n, 0);
- now_ms = ::monotonic_clock_ms();
+ now_ms = ::MonotonicClockMS();
assert(!quit);
diff --git a/src/system/clock.c b/src/system/Clock.cxx
index d987aed48..347997a44 100644
--- a/src/system/clock.c
+++ b/src/system/Clock.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "clock.h"
+#include "Clock.hxx"
#ifdef WIN32
#include <windows.h>
@@ -31,7 +31,7 @@
#endif
unsigned
-monotonic_clock_ms(void)
+MonotonicClockMS(void)
{
#ifdef WIN32
return GetTickCount();
@@ -55,7 +55,7 @@ monotonic_clock_ms(void)
}
uint64_t
-monotonic_clock_us(void)
+MonotonicClockUS(void)
{
#ifdef WIN32
LARGE_INTEGER l_value, l_frequency;
diff --git a/src/system/clock.h b/src/system/Clock.hxx
index ae774ff85..7be1127bf 100644
--- a/src/system/clock.h
+++ b/src/system/Clock.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -24,26 +24,18 @@
#include <stdint.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/**
* Returns the value of a monotonic clock in milliseconds.
*/
gcc_pure
unsigned
-monotonic_clock_ms(void);
+MonotonicClockMS();
/**
* Returns the value of a monotonic clock in microseconds.
*/
gcc_pure
uint64_t
-monotonic_clock_us(void);
-
-#ifdef __cplusplus
-}
-#endif
+MonotonicClockUS();
#endif