From c7efc8f4f8de72aa43b085736e359fca58f2f428 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Tue, 21 Oct 2014 23:56:06 +0800 Subject: [PATCH] Drop unused variable Signed-off-by: Sup Yut Sum --- src/Git/GitRev.cpp | 64 ------------------------------------------------------ src/Git/GitRev.h | 2 -- 2 files changed, 66 deletions(-) diff --git a/src/Git/GitRev.cpp b/src/Git/GitRev.cpp index ba304e553..147409dae 100644 --- a/src/Git/GitRev.cpp +++ b/src/Git/GitRev.cpp @@ -47,12 +47,6 @@ GitRev::GitRev(void) m_Mark = 0; memset(&this->m_GitCommit,0,sizeof(GIT_COMMIT)); - - // fetch local machine timezone info - if ( GetTimeZoneInformation( &m_TimeZone ) == TIME_ZONE_ID_INVALID ) - { - ASSERT(false); - } } GitRev::~GitRev(void) @@ -107,64 +101,6 @@ int GitRev::CopyFrom(GitRev &rev,bool OmitParentAndMark) return 0; } -CTime GitRev::ConverFromString(CString input) -{ - // pick up date from string - try - { - COleDateTime tm(_wtoi(input.Mid(0,4)), - _wtoi(input.Mid(5,2)), - _wtoi(input.Mid(8,2)), - _wtoi(input.Mid(11,2)), - _wtoi(input.Mid(14,2)), - _wtoi(input.Mid(17,2))); - if( tm.GetStatus() != COleDateTime::valid ) - return CTime();//Error parsing time-string - - // pick up utc offset - CString sign = input.Mid(20,1); // + or - - int hoursOffset = _wtoi(input.Mid(21,2)); - int minsOffset = _wtoi(input.Mid(23,2)); - // convert to a fraction of a day - double offset = (hoursOffset*60 + minsOffset) / 1440.0; // 1440 mins = 1 day - if ( sign == "-" ) - { - offset = -offset; - } - // we have to subtract this from the time given to get UTC - tm -= offset; - // get utc time as a SYSTEMTIME - SYSTEMTIME sysTime; - tm.GetAsSystemTime( sysTime ); - // and convert to users local time - SYSTEMTIME local; - if ( SystemTimeToTzSpecificLocalTime( &m_TimeZone, &sysTime, &local ) ) - { - sysTime = local; - } - else - { - ASSERT(false); // this should not happen but leave time in utc if it does - } - // convert to CTime and return - return CTime( sysTime, -1 ); - } - catch(CException* e) - { - //Probably the date was something like 1970-01-01 00:00:00. _mktime64() doesnt like this. - //Dont let the application crash on this exception - -#ifdef _AFX //CException classes are only defined when afx.h is included. - //When afx.h is not included, the exception is leaked. - //This will probably never happen because when CException is not defined, it cannot be thrown. - e->Delete(); -#else - UNREFERENCED_PARAMETER(e); -#endif //ifdef _AFX - } - return CTime(); //Return an invalid time -} - int GitRev::SafeGetSimpleList(CGit *git) { if(InterlockedExchange(&m_IsUpdateing,TRUE) == FALSE) diff --git a/src/Git/GitRev.h b/src/Git/GitRev.h index 088bbebd2..5ce634907 100644 --- a/src/Git/GitRev.h +++ b/src/Git/GitRev.h @@ -211,7 +211,6 @@ public: void Clear(); //int ParserFromLog(BYTE_VECTOR &log,int start=0); - CTime ConverFromString(CString input); inline int ParentsCount(){ return (int)m_ParentHash.size(); } //Show version tree Graphic @@ -242,5 +241,4 @@ public: int AddMergeFiles(); private: int GetCommitFromHash_withoutLock(CGitHash &hash); - TIME_ZONE_INFORMATION m_TimeZone; }; -- 2.11.4.GIT