diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-10-14 16:45:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-10-15 07:59:10 +0000 |
commit | 613213240a84327a0a72bb5ee98cc88d50c1fd0e (patch) | |
tree | 718ae88e8ea896ff4dc8cb8542d1de9349dd74d9 /tools/source | |
parent | 810e664de088721b6452016d83fb3ef3e6ca5eb1 (diff) |
clang-cl loplugin: tools
Change-Id: I6f02d9607405e144727f925c8f8a1de6041688b9
Reviewed-on: https://gerrit.libreoffice.org/29844
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/misc/cpuid.cxx | 2 | ||||
-rw-r--r-- | tools/source/misc/pathutils.cxx | 2 | ||||
-rw-r--r-- | tools/source/stream/strmwnt.cxx | 26 |
3 files changed, 15 insertions, 15 deletions
diff --git a/tools/source/misc/cpuid.cxx b/tools/source/misc/cpuid.cxx index 5bef56c0fe9c..1518dfc175c4 100644 --- a/tools/source/misc/cpuid.cxx +++ b/tools/source/misc/cpuid.cxx @@ -24,7 +24,7 @@ namespace #include <intrin.h> void getCpuId(uint32_t array[4]) { - __cpuid((int*)array, 1); + __cpuid(reinterpret_cast<int*>(array), 1); } #else #include <cpuid.h> diff --git a/tools/source/misc/pathutils.cxx b/tools/source/misc/pathutils.cxx index d939483e4764..28e63ac674a8 100644 --- a/tools/source/misc/pathutils.cxx +++ b/tools/source/misc/pathutils.cxx @@ -98,7 +98,7 @@ WCHAR * buildPath( return p; } else { SetLastError(ERROR_FILENAME_EXCED_RANGE); - return NULL; + return nullptr; } } diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx index 627471c64edf..204602fff220 100644 --- a/tools/source/stream/strmwnt.cxx +++ b/tools/source/stream/strmwnt.cxx @@ -40,7 +40,7 @@ public: StreamData() { - hFile = 0; + hFile = nullptr; } }; @@ -138,7 +138,7 @@ std::size_t SvFileStream::GetData( void* pData, std::size_t nSize ) DWORD nCount = 0; if( IsOpen() ) { - bool bResult = ReadFile(pInstanceData->hFile,(LPVOID)pData,nSize,&nCount,NULL); + bool bResult = ReadFile(pInstanceData->hFile,pData,nSize,&nCount,nullptr); if( !bResult ) { std::size_t nTestError = GetLastError(); @@ -153,7 +153,7 @@ std::size_t SvFileStream::PutData( const void* pData, std::size_t nSize ) DWORD nCount = 0; if( IsOpen() ) { - if(!WriteFile(pInstanceData->hFile,(LPVOID)pData,nSize,&nCount,NULL)) + if(!WriteFile(pInstanceData->hFile,pData,nSize,&nCount,nullptr)) SetError(::GetSvError( GetLastError() ) ); } return nCount; @@ -168,9 +168,9 @@ sal_uInt64 SvFileStream::SeekPos(sal_uInt64 const nPos) { if( nPos != STREAM_SEEK_TO_END ) // 64-Bit files are not supported - nNewPos=SetFilePointer(pInstanceData->hFile,nPos,NULL,FILE_BEGIN); + nNewPos=SetFilePointer(pInstanceData->hFile,nPos,nullptr,FILE_BEGIN); else - nNewPos=SetFilePointer(pInstanceData->hFile,0L,NULL,FILE_END); + nNewPos=SetFilePointer(pInstanceData->hFile,0L,nullptr,FILE_END); if( nNewPos == 0xFFFFFFFF ) { @@ -318,10 +318,10 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nMode ) aFileNameA.getStr(), nAccessMode, nShareMode, - (LPSECURITY_ATTRIBUTES)NULL, + nullptr, nOpenAction, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - (HANDLE) NULL + nullptr ); if( pInstanceData->hFile!=INVALID_HANDLE_VALUE && ( @@ -352,10 +352,10 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nMode ) aFileNameA.getStr(), GENERIC_READ, nShareMode, - (LPSECURITY_ATTRIBUTES)NULL, + nullptr, nOpenAction, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, - (HANDLE) NULL + nullptr ); if( GetLastError() == ERROR_ALREADY_EXISTS ) SetLastError( ERROR_SUCCESS ); @@ -407,18 +407,18 @@ void SvFileStream::SetSize(sal_uInt64 const nSize) if( IsOpen() ) { - int bError = false; + bool bError = false; HANDLE hFile = pInstanceData->hFile; - DWORD const nOld = SetFilePointer( hFile, 0L, NULL, FILE_CURRENT ); + DWORD const nOld = SetFilePointer( hFile, 0L, nullptr, FILE_CURRENT ); if( nOld != 0xffffffff ) { - if( SetFilePointer(hFile,nSize,NULL,FILE_BEGIN ) != 0xffffffff) + if( SetFilePointer(hFile,nSize,nullptr,FILE_BEGIN ) != 0xffffffff) { bool bSucc = SetEndOfFile( hFile ); if( !bSucc ) bError = true; } - if( SetFilePointer( hFile,nOld,NULL,FILE_BEGIN ) == 0xffffffff) + if( SetFilePointer( hFile,nOld,nullptr,FILE_BEGIN ) == 0xffffffff) bError = true; } if( bError ) |