From a0bbb173f47fc3baa56bb587047216b390cb16e8 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Tue, 9 Feb 2021 10:22:52 -0600 Subject: [PATCH] LGTM: Remove unused Time() function The ConsoleSingleton::Time() function is flagged by LGTM for using two different unsafe time-related functions. It is not called anywhere in the current codebase, and is not exposed in the Python API, so was removed rather than being repaired. --- src/Base/Console.cpp | 16 ---------------- src/Base/Console.h | 2 -- 2 files changed, 18 deletions(-) diff --git a/src/Base/Console.cpp b/src/Base/Console.cpp index ee8fd5d884..d39a71c3ef 100644 --- a/src/Base/Console.cpp +++ b/src/Base/Console.cpp @@ -339,22 +339,6 @@ void ConsoleSingleton::Log( const char *pMsg, ... ) } } -/** Delivers the time/date - * This method gives you a string with the actual time/date. You can - * use that for Log() calls to make timestamps. - * @return Const string with the date/time - */ -const char* ConsoleSingleton::Time(void) -{ - struct tm *newtime; - time_t aclock; - time( &aclock ); // Get time in seconds - newtime = localtime( &aclock ); // Convert time to struct tm form - char* st = asctime( newtime ); - st[24] = 0; - return st; -} - //************************************************************************** diff --git a/src/Base/Console.h b/src/Base/Console.h index 650b621004..d88dbd8a57 100644 --- a/src/Base/Console.h +++ b/src/Base/Console.h @@ -533,8 +533,6 @@ namespace Base { void NotifyError (const char *sMsg); void NotifyLog (const char *sMsg); - /// Delivers a time/date string - const char* Time(void); /// Attaches an Observer to FCConsole void AttachObserver(ILogger *pcObserver); /// Detaches an Observer from FCConsole