diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/datetime/ttime.cxx | 8 | ||||
-rw-r--r-- | tools/source/zcodec/zcodec.cxx | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index 7fbd361573de..356f1994ee4c 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -401,8 +401,6 @@ Time tools::Time::GetUTCOffset() sal_uInt64 nTicks = tools::Time::GetSystemTicks(); time_t nTime; tm aTM; - sal_Int32 nLocalTime; - sal_Int32 nUTC; short nTempTime; // determine value again if needed @@ -413,17 +411,17 @@ Time tools::Time::GetUTCOffset() { nTime = time( nullptr ); localtime_r( &nTime, &aTM ); - nLocalTime = mktime( &aTM ); + sal_Int32 nLocalTime = mktime( &aTM ); #if defined(__sun) // Solaris gmtime_r() seems not to handle daylight saving time // flags correctly nUTC = nLocalTime + ( aTM.tm_isdst == 0 ? timezone : altzone ); #elif defined( LINUX ) // Linux mktime() seems not to handle tm_isdst correctly - nUTC = nLocalTime - aTM.tm_gmtoff; + sal_Int32 nUTC = nLocalTime - aTM.tm_gmtoff; #else gmtime_r( &nTime, &aTM ); - nUTC = mktime( &aTM ); + sal_Int32 nUTC = mktime( &aTM ); #endif nCacheTicks = nTicks; nCacheSecOffset = (nLocalTime-nUTC) / 60; diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx index 525834681ef8..36386b9bb498 100644 --- a/tools/source/zcodec/zcodec.cxx +++ b/tools/source/zcodec/zcodec.cxx @@ -331,7 +331,7 @@ void ZCodec::InitDecompress(SvStream & inStream) auto pStream = static_cast<z_stream*>(mpsC_Stream); if ( mbStatus && mbGzLib ) { - sal_uInt8 n1, n2, j, nMethod, nFlags; + sal_uInt8 j, nMethod, nFlags; for (int i : gz_magic) // gz - magic number { inStream.ReadUChar( j ); @@ -349,6 +349,7 @@ void ZCodec::InitDecompress(SvStream & inStream) /* skip the extra field */ if ( nFlags & GZ_EXTRA_FIELD ) { + sal_uInt8 n1, n2; inStream.ReadUChar( n1 ).ReadUChar( n2 ); inStream.SeekRel( n1 + ( n2 << 8 ) ); } |