From 0ddfdebab311d264234981007cda2ab254f51bf9 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 13 May 2015 20:52:19 +0200 Subject: [PATCH] Remove unused system utils functions --- src/app/system.cpp | 16 ---------------- src/app/system.h | 6 ------ src/app/system_linux.cpp | 5 ----- src/app/system_linux.h | 1 - src/app/system_other.cpp | 5 ----- src/app/system_other.h | 1 - src/app/system_windows.cpp | 5 ----- src/app/system_windows.h | 1 - 8 files changed, 40 deletions(-) diff --git a/src/app/system.cpp b/src/app/system.cpp index 6b18f63a..65461314 100644 --- a/src/app/system.cpp +++ b/src/app/system.cpp @@ -157,22 +157,6 @@ void CSystemUtils::CopyTimeStamp(SystemTimeStamp *dst, SystemTimeStamp *src) *dst = *src; } -float CSystemUtils::GetTimeStampResolution(SystemTimeUnit unit) -{ - unsigned long long exact = GetTimeStampExactResolution(); - float result = 0.0f; - if (unit == STU_SEC) - result = exact * 1e-9; - else if (unit == STU_MSEC) - result = exact * 1e-6; - else if (unit == STU_USEC) - result = exact * 1e-3; - else - assert(false); - - return result; -} - float CSystemUtils::TimeStampDiff(SystemTimeStamp *before, SystemTimeStamp *after, SystemTimeUnit unit) { long long exact = TimeStampExactDiff(before, after); diff --git a/src/app/system.h b/src/app/system.h index ab25801b..74702de3 100644 --- a/src/app/system.h +++ b/src/app/system.h @@ -115,12 +115,6 @@ public: //! Returns a time stamp associated with current time virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) = 0; - //! Returns the platform's expected time stamp resolution - TEST_VIRTUAL float GetTimeStampResolution(SystemTimeUnit unit = STU_SEC); - - //! Returns the platform's exact (in nanosecond units) expected time stamp resolution - virtual long long GetTimeStampExactResolution() = 0; - //! Returns a difference between two timestamps in given time unit /** The difference is \a after - \a before. */ TEST_VIRTUAL float TimeStampDiff(SystemTimeStamp *before, SystemTimeStamp *after, SystemTimeUnit unit = STU_SEC); diff --git a/src/app/system_linux.cpp b/src/app/system_linux.cpp index 1a1b76d1..2427b09f 100644 --- a/src/app/system_linux.cpp +++ b/src/app/system_linux.cpp @@ -87,11 +87,6 @@ void CSystemUtilsLinux::GetCurrentTimeStamp(SystemTimeStamp *stamp) clock_gettime(CLOCK_MONOTONIC_RAW, &stamp->clockTime); } -long long CSystemUtilsLinux::GetTimeStampExactResolution() -{ - return 1ll; -} - long long CSystemUtilsLinux::TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) { return (after->clockTime.tv_nsec - before->clockTime.tv_nsec) + diff --git a/src/app/system_linux.h b/src/app/system_linux.h index b60954e8..64501c4e 100644 --- a/src/app/system_linux.h +++ b/src/app/system_linux.h @@ -45,7 +45,6 @@ public: virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE; virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE; - virtual long long GetTimeStampExactResolution() OVERRIDE; virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE; virtual std::string GetSaveDir() OVERRIDE; diff --git a/src/app/system_other.cpp b/src/app/system_other.cpp index bedeb238..c156cb3d 100644 --- a/src/app/system_other.cpp +++ b/src/app/system_other.cpp @@ -30,11 +30,6 @@ void CSystemUtilsOther::GetCurrentTimeStamp(SystemTimeStamp* stamp) stamp->sdlTicks = SDL_GetTicks(); } -long long int CSystemUtilsOther::GetTimeStampExactResolution() -{ - return 1000000ll; -} - long long int CSystemUtilsOther::TimeStampExactDiff(SystemTimeStamp* before, SystemTimeStamp* after) { return (after->sdlTicks - before->sdlTicks) * 1000000ll; diff --git a/src/app/system_other.h b/src/app/system_other.h index 862f63ee..586a53dc 100644 --- a/src/app/system_other.h +++ b/src/app/system_other.h @@ -46,7 +46,6 @@ public: virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE; virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE; - virtual long long int GetTimeStampExactResolution() OVERRIDE; virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE; virtual void Usleep(int usec) OVERRIDE; diff --git a/src/app/system_windows.cpp b/src/app/system_windows.cpp index e16b65a0..7acb7901 100644 --- a/src/app/system_windows.cpp +++ b/src/app/system_windows.cpp @@ -83,11 +83,6 @@ void CSystemUtilsWindows::GetCurrentTimeStamp(SystemTimeStamp* stamp) stamp->counterValue = value.QuadPart; } -long long int CSystemUtilsWindows::GetTimeStampExactResolution() -{ - return 1000000000ll / m_counterFrequency; -} - long long int CSystemUtilsWindows::TimeStampExactDiff(SystemTimeStamp* before, SystemTimeStamp* after) { float floatValue = static_cast(after->counterValue - before->counterValue) * (1e9 / static_cast(m_counterFrequency)); diff --git a/src/app/system_windows.h b/src/app/system_windows.h index e5141cba..ca35ab37 100644 --- a/src/app/system_windows.h +++ b/src/app/system_windows.h @@ -43,7 +43,6 @@ public: virtual SystemDialogResult SystemDialog(SystemDialogType type, const std::string& title, const std::string& message) OVERRIDE; virtual void GetCurrentTimeStamp(SystemTimeStamp *stamp) OVERRIDE; - virtual long long GetTimeStampExactResolution() OVERRIDE; virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) OVERRIDE; virtual std::string GetSaveDir() OVERRIDE;