diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-24 10:49:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-24 10:51:22 +0200 |
commit | 858e455634ebfff8ef7b65a9c97d3bc8240cd094 (patch) | |
tree | 688dd5dbe73ee53ef4b84124632e045045b404d1 /sal | |
parent | a6df3c0babf409d8fc0bf52efd9c2fa74a95998e (diff) |
loplugin:constantfunction: various
Change-Id: I6eddda9f4b31c7ce413c328b6a857a81bd222eed
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/file.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 4d60a6c41ce7..143207efbd5f 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -1092,10 +1092,7 @@ SAL_CALL osl_syncFile(oslFileHandle Handle) return osl_File_E_None; } -inline off_t max_off_t() -{ - return std::numeric_limits< off_t >::max(); -} +const off_t MAX_OFF_T = std::numeric_limits< off_t >::max(); oslFileError SAL_CALL osl_mapFile ( @@ -1116,7 +1113,7 @@ SAL_CALL osl_mapFile ( return osl_File_E_OVERFLOW; size_t const nLength = sal::static_int_cast< size_t >(uLength); - sal_uInt64 const limit_off_t = max_off_t(); + sal_uInt64 const limit_off_t = MAX_OFF_T; if (uOffset > limit_off_t) return osl_File_E_OVERFLOW; @@ -1321,7 +1318,7 @@ SAL_CALL osl_readFileAt ( if (0 == (pImpl->m_state & FileHandle_Impl::STATE_SEEKABLE)) return osl_File_E_SPIPE; - sal_uInt64 const limit_off_t = max_off_t(); + sal_uInt64 const limit_off_t = MAX_OFF_T; if (uOffset > limit_off_t) return osl_File_E_OVERFLOW; off_t const nOffset = sal::static_int_cast< off_t >(uOffset); @@ -1353,7 +1350,7 @@ SAL_CALL osl_writeFileAt ( if (0 == (pImpl->m_state & FileHandle_Impl::STATE_WRITEABLE)) return osl_File_E_BADF; - sal_uInt64 const limit_off_t = max_off_t(); + sal_uInt64 const limit_off_t = MAX_OFF_T; if (limit_off_t < uOffset) return osl_File_E_OVERFLOW; off_t const nOffset = sal::static_int_cast< off_t >(uOffset); @@ -1402,7 +1399,7 @@ SAL_CALL osl_setFilePos (oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uOffse if ((0 == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (-1 == pImpl->m_fd))) return osl_File_E_INVAL; - sal_Int64 const limit_off_t = max_off_t(); + sal_Int64 const limit_off_t = MAX_OFF_T; if (uOffset > limit_off_t) return osl_File_E_OVERFLOW; off_t nPos = 0, nOffset = sal::static_int_cast< off_t >(uOffset); @@ -1461,7 +1458,7 @@ SAL_CALL osl_setFileSize( oslFileHandle Handle, sal_uInt64 uSize ) if (0 == (pImpl->m_state & FileHandle_Impl::STATE_WRITEABLE)) return osl_File_E_BADF; - sal_uInt64 const limit_off_t = max_off_t(); + sal_uInt64 const limit_off_t = MAX_OFF_T; if (uSize > limit_off_t) return osl_File_E_OVERFLOW; |