diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-10-03 12:44:07 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-10-03 16:30:36 +0200 |
commit | 532a4dcba6ec6fe1bd88f3c2db77f05868167886 (patch) | |
tree | 82857bab5b8914677e0d17a4b668dfcb97b0467e /sal | |
parent | 372d2d78906aac32ddaf7eaa3c2037ea3d5af1ae (diff) |
Replace more reinterpret_cast with SAL_W/SAL_U
Change-Id: Ia632e4083222ad9e7f17c2ad0d0825f189c700cc
Reviewed-on: https://gerrit.libreoffice.org/43071
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/file_dirvol.cxx | 6 | ||||
-rw-r--r-- | sal/osl/w32/path_helper.hxx | 2 | ||||
-rw-r--r-- | sal/osl/w32/profile.cxx | 20 |
3 files changed, 13 insertions, 15 deletions
diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx index 446654f98759..f94c91f5aaf4 100644 --- a/sal/osl/w32/file_dirvol.cxx +++ b/sal/osl/w32/file_dirvol.cxx @@ -1647,9 +1647,9 @@ oslFileError SAL_CALL osl_getFileStatus( { ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH ); sal_uInt32 nNewLen = GetCaseCorrectPathName( SAL_W(rtl_uString_getStr( pItemImpl->m_pFullPath )), - ::osl::mingw_reinterpret_cast<LPWSTR>( aBuffer ), - aBuffer.getBufSizeInSymbols(), - true ); + SAL_W( aBuffer ), + aBuffer.getBufSizeInSymbols(), + true ); if ( nNewLen ) { diff --git a/sal/osl/w32/path_helper.hxx b/sal/osl/w32/path_helper.hxx index 68cf92cc05d8..31c245ac868c 100644 --- a/sal/osl/w32/path_helper.hxx +++ b/sal/osl/w32/path_helper.hxx @@ -118,8 +118,6 @@ public: }; - template< class U, class T > U mingw_reinterpret_cast(LongPathBuffer<T>& a) { return reinterpret_cast<U>(static_cast<T*>(a)); } - } // end namespace osl #endif diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx index f3539e658110..0137a0fc539d 100644 --- a/sal/osl/w32/profile.cxx +++ b/sal/osl/w32/profile.cxx @@ -1977,7 +1977,7 @@ static bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *strFile while ((strPath[i] != L'"') && (strPath[i] != L'\0')) i++; - WideCharToMultiByte(CP_ACP,0, reinterpret_cast<LPCWSTR>(strPath), i, Product, sizeof(Product), nullptr, nullptr); + WideCharToMultiByte(CP_ACP,0, SAL_W(strPath), i, Product, sizeof(Product), nullptr, nullptr); Product[i] = '\0'; strPath += i; @@ -2121,12 +2121,12 @@ static bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *strFile ::osl::LongPathBuffer< sal_Char > aTmpPath( MAX_LONG_PATH ); int nLen = 0; - if ((nLen = WideCharToMultiByte(CP_ACP,0, ::osl::mingw_reinterpret_cast<LPCWSTR>(aPath), -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), nullptr, nullptr)) > 0) + if ((nLen = WideCharToMultiByte(CP_ACP,0, SAL_W(aPath), -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), nullptr, nullptr)) > 0) { strcpy(aTmpPath + nLen, SVERSION_USER); if (access(aTmpPath, 0) >= 0) { - dwPathLen += MultiByteToWideChar( CP_ACP, 0, SVERSION_USER, -1, reinterpret_cast<LPWSTR>(aPath + dwPathLen), aPath.getBufSizeInSymbols() - dwPathLen ); + dwPathLen += MultiByteToWideChar( CP_ACP, 0, SVERSION_USER, -1, SAL_W(aPath + dwPathLen), aPath.getBufSizeInSymbols() - dwPathLen ); } } } @@ -2180,7 +2180,7 @@ static bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *strFile /* if we have no product identification use the executable file name */ if (*Product == 0) { - WideCharToMultiByte(CP_ACP,0, reinterpret_cast<LPCWSTR>(strExecutable->buffer + nPos + 1), -1, Product, sizeof(Product), nullptr, nullptr); + WideCharToMultiByte(CP_ACP,0, SAL_W(strExecutable->buffer + nPos + 1), -1, Product, sizeof(Product), nullptr, nullptr); /* remove extension */ if ((pChr = strrchr(Product, '.')) != nullptr) @@ -2203,7 +2203,7 @@ static bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *strFile { ::osl::LongPathBuffer< sal_Char > aTmpPath( MAX_LONG_PATH ); - WideCharToMultiByte(CP_ACP,0, ::osl::mingw_reinterpret_cast<LPCWSTR>(aPath), -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), nullptr, nullptr); + WideCharToMultiByte(CP_ACP,0, SAL_W(aPath), -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), nullptr, nullptr); /* if file not exists, remove any specified subdirectories like "bin" or "program" */ @@ -2227,7 +2227,7 @@ static bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *strFile } else { - dwPathLen = nPos + MultiByteToWideChar( CP_ACP, 0, SVERSION_USER, -1, reinterpret_cast<LPWSTR>(aPath + nPos + 1), aPath.getBufSizeInSymbols() - (nPos + 1) ); + dwPathLen = nPos + MultiByteToWideChar( CP_ACP, 0, SVERSION_USER, -1, SAL_W(aPath + nPos + 1), aPath.getBufSizeInSymbols() - (nPos + 1) ); } } else @@ -2252,7 +2252,7 @@ static bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *strFile { ::osl::LongPathBuffer< sal_Char > aTmpPath( MAX_LONG_PATH ); - WideCharToMultiByte(CP_ACP,0, ::osl::mingw_reinterpret_cast<LPCWSTR>(aPath), -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), nullptr, nullptr); + WideCharToMultiByte(CP_ACP,0, SAL_W(aPath), -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), nullptr, nullptr); if ((access(aTmpPath, 0) < 0) && (Product[0] != '\0')) { @@ -2301,7 +2301,7 @@ static bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *strFile if (Buffer[0] != '\0') { dwPathLen = MultiByteToWideChar( - CP_ACP, 0, Buffer, -1, ::osl::mingw_reinterpret_cast<LPWSTR>(aPath), aPath.getBufSizeInSymbols() ); + CP_ACP, 0, Buffer, -1, SAL_W(aPath), aPath.getBufSizeInSymbols() ); dwPathLen -=1; /* build full path */ @@ -2322,7 +2322,7 @@ static bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *strFile int n; if ((n = WideCharToMultiByte( - CP_ACP,0, ::osl::mingw_reinterpret_cast<LPCWSTR>(aPath), -1, aTmpPath2, + CP_ACP,0, SAL_W(aPath), -1, aTmpPath2, aTmpPath2.getBufSizeInSymbols(), nullptr, nullptr)) > 0) { @@ -2331,7 +2331,7 @@ static bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *strFile { dwPathLen += MultiByteToWideChar( CP_ACP, 0, SVERSION_USER, -1, - reinterpret_cast<LPWSTR>(aPath + dwPathLen), + SAL_W(aPath + dwPathLen), aPath.getBufSizeInSymbols() - dwPathLen ); } } |