summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/file.cxx15
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;