From 98963398054a20287cf6b354932ef56ddb4da48c Mon Sep 17 00:00:00 2001 From: weili Date: Tue, 7 Jun 2016 11:28:31 -0700 Subject: Fix more code which has shadow variables The code has local variables that shadow struct or class member variables. Also, when this happens, different variable names should be used instead of namespaces. These were discovered by /Wshadow warning flag in Clang. Review-Url: https://codereview.chromium.org/2034253003 --- fpdfsdk/fsdk_baseannot.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'fpdfsdk/fsdk_baseannot.cpp') diff --git a/fpdfsdk/fsdk_baseannot.cpp b/fpdfsdk/fsdk_baseannot.cpp index 1345f234b6..7dcb663505 100644 --- a/fpdfsdk/fsdk_baseannot.cpp +++ b/fpdfsdk/fsdk_baseannot.cpp @@ -376,8 +376,7 @@ CFX_ByteString CPDFSDK_DateTime::ToPDFDateTimeString() { } void CPDFSDK_DateTime::ToSystemTime(FX_SYSTEMTIME& st) { - CPDFSDK_DateTime dt = *this; - time_t t = (time_t)dt; + time_t t = (time_t)(*this); struct tm* pTime = localtime(&t); if (pTime) { st.wYear = (uint16_t)pTime->tm_year + 1900; @@ -392,11 +391,12 @@ void CPDFSDK_DateTime::ToSystemTime(FX_SYSTEMTIME& st) { } CPDFSDK_DateTime CPDFSDK_DateTime::ToGMT() const { - CPDFSDK_DateTime dt = *this; - dt.AddSeconds(-gAfxGetTimeZoneInSeconds(dt.dt.tzHour, dt.dt.tzMinute)); - dt.dt.tzHour = 0; - dt.dt.tzMinute = 0; - return dt; + CPDFSDK_DateTime new_dt = *this; + new_dt.AddSeconds( + -gAfxGetTimeZoneInSeconds(new_dt.dt.tzHour, new_dt.dt.tzMinute)); + new_dt.dt.tzHour = 0; + new_dt.dt.tzMinute = 0; + return new_dt; } CPDFSDK_DateTime& CPDFSDK_DateTime::AddDays(short days) { -- cgit v1.2.3