summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-01 10:12:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-10-01 13:20:30 +0200
commita3e29642b9c118674ad88785500ce164aa103de9 (patch)
treecc56b0087f4e3529b75865f6bad0f9e5a2119f1d
parent720af01132d9e623389b82b5251c1687240d3569 (diff)
loplugin:data (clang-cl)
Change-Id: Ib8b2bc1c5f7b27a646036ce23cae2b6a06edd038 Reviewed-on: https://gerrit.libreoffice.org/79922 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--basic/source/runtime/dllmgr-x64.cxx8
-rw-r--r--canvas/source/directx/dx_canvashelper.cxx2
-rw-r--r--canvas/source/directx/dx_canvashelper_texturefill.cxx8
-rw-r--r--canvas/source/directx/dx_impltools.cxx8
-rw-r--r--connectivity/source/drivers/ado/ADriver.cxx2
-rw-r--r--fpicker/source/win32/VistaFilePickerImpl.cxx2
-rw-r--r--idlc/source/options.cxx4
-rw-r--r--sal/osl/w32/module.cxx6
-rw-r--r--sal/osl/w32/procimpl.cxx10
-rw-r--r--sal/osl/w32/profile.cxx8
-rw-r--r--shell/source/win32/ooofilereader/basereader.cxx2
-rw-r--r--shell/source/win32/simplemail/senddoc.cxx4
-rw-r--r--shell/source/win32/simplemail/smplmailclient.cxx2
-rw-r--r--shell/source/win32/zipfile/zipfile.cxx8
-rw-r--r--vcl/win/gdi/gdiimpl.cxx2
-rw-r--r--vcl/win/gdi/salfont.cxx4
16 files changed, 40 insertions, 40 deletions
diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx
index c35046a89752..aa59c29fc752 100644
--- a/basic/source/runtime/dllmgr-x64.cxx
+++ b/basic/source/runtime/dllmgr-x64.cxx
@@ -64,7 +64,7 @@ using namespace css;
namespace {
char * address(std::vector< char > & blob) {
- return blob.empty() ? nullptr : &blob[0];
+ return blob.empty() ? nullptr : blob.data();
}
ErrCode convert(OUString const & source, OString * target) {
@@ -183,7 +183,7 @@ std::size_t alignment(SbxVariable const * variable) {
sal_Int32 up;
arr->GetDim32(i + 1, low[i], up);
}
- return alignment(arr->Get32(&low[0]));
+ return alignment(arr->Get32(low.data()));
}
}
@@ -239,7 +239,7 @@ ErrCode marshalArray(
}
for (std::vector< sal_Int32 > idx = low;;) {
ErrCode e = marshal(
- false, arr->Get32(&idx[0]), false, blob, offset, data);
+ false, arr->Get32(idx.data()), false, blob, offset, data);
if (e != ERRCODE_NONE) {
return e;
}
@@ -434,7 +434,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
arr->GetDim32(i + 1, low[i], up[i]);
}
for (std::vector< sal_Int32 > idx = low;;) {
- data = unmarshal(arr->Get32(&idx[0]), data);
+ data = unmarshal(arr->Get32(idx.data()), data);
int i = dims - 1;
while (idx[i] == up[i]) {
idx[i] = low[i];
diff --git a/canvas/source/directx/dx_canvashelper.cxx b/canvas/source/directx/dx_canvashelper.cxx
index d606aab9a621..927f838244ab 100644
--- a/canvas/source/directx/dx_canvashelper.cxx
+++ b/canvas/source/directx/dx_canvashelper.cxx
@@ -365,7 +365,7 @@ namespace dxcanvas
strokeAttributes.DashArray ) );
if( !rDashArray.empty() )
{
- aPen.SetDashPattern( &rDashArray[0],
+ aPen.SetDashPattern( rDashArray.data(),
rDashArray.size() );
}
aPen.SetLineCap( gdiCapFromCap(strokeAttributes.StartCapType),
diff --git a/canvas/source/directx/dx_canvashelper_texturefill.cxx b/canvas/source/directx/dx_canvashelper_texturefill.cxx
index df0d27f154ef..33a6c018670e 100644
--- a/canvas/source/directx/dx_canvashelper_texturefill.cxx
+++ b/canvas/source/directx/dx_canvashelper_texturefill.cxx
@@ -68,8 +68,8 @@ namespace dxcanvas
rColors[0],
rColors[1] );
- aBrush.SetInterpolationColors(&rColors[0],
- &rStops[0],
+ aBrush.SetInterpolationColors(rColors.data(),
+ rStops.data(),
rColors.size());
// render background color, as LinearGradientBrush does not
@@ -378,8 +378,8 @@ namespace dxcanvas
pGradientBrush.reset(
new Gdiplus::PathGradientBrush( pGradientPath.get() ) );
- pGradientBrush->SetInterpolationColors( &rColors[0],
- &rStops[0],
+ pGradientBrush->SetInterpolationColors( rColors.data(),
+ rStops.data(),
rStops.size() );
// explicitly setup center point. Since the center of GDI+
diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx
index 55bf94919cb3..416b46034408 100644
--- a/canvas/source/directx/dx_impltools.cxx
+++ b/canvas/source/directx/dx_impltools.cxx
@@ -232,7 +232,7 @@ namespace dxcanvas
}
else
{
- rOutput->AddBeziers( &rPoints[0], nCurrOutput );
+ rOutput->AddBeziers( rPoints.data(), nCurrOutput );
}
}
else
@@ -254,7 +254,7 @@ namespace dxcanvas
}
else
{
- rOutput->AddBeziers( &rPoints[0], nCurrOutput-2 );
+ rOutput->AddBeziers( rPoints.data(), nCurrOutput-2 );
}
}
}
@@ -288,7 +288,7 @@ namespace dxcanvas
}
else
{
- rOutput->AddLines( &rPoints[0], nPoints );
+ rOutput->AddLines( rPoints.data(), nPoints );
}
}
@@ -423,7 +423,7 @@ namespace dxcanvas
aPoints.begin(),
implGdiPlusPointFromRealPoint2D );
- pRes->AddLines( &aPoints[0], nCurrSize );
+ pRes->AddLines( aPoints.data(), nCurrSize );
}
}
diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx
index 95ce03ab79cc..f8afdde132c0 100644
--- a/connectivity/source/drivers/ado/ADriver.cxx
+++ b/connectivity/source/drivers/ado/ADriver.cxx
@@ -173,7 +173,7 @@ Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const OUString
,OUString( )
,Sequence< OUString > ())
);
- return Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size());
+ return Sequence< DriverPropertyInfo >(aDriverInfo.data(),aDriverInfo.size());
}
return Sequence< DriverPropertyInfo >();
}
diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx b/fpicker/source/win32/VistaFilePickerImpl.cxx
index a4b5a88c5d48..1899f6addfc9 100644
--- a/fpicker/source/win32/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/VistaFilePickerImpl.cxx
@@ -846,7 +846,7 @@ void VistaFilePickerImpl::impl_sta_setFiltersOnDialog()
if (lFilters.empty())
return;
- COMDLG_FILTERSPEC *pFilt = &lFilters[0];
+ COMDLG_FILTERSPEC *pFilt = lFilters.data();
iDialog->SetFileTypes(lFilters.size(), pFilt/*&lFilters[0]*/);
iDialog->SetFileTypeIndex(nCurrentFilter + 1);
diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx
index bfd273ace1ba..c3a19a365267 100644
--- a/idlc/source/options.cxx
+++ b/idlc/source/options.cxx
@@ -193,11 +193,11 @@ static OString convertIncPathtoShortWindowsPath(const OString& incPath) {
std::vector<sal_Unicode> vec(path.getLength() + 1);
//GetShortPathNameW only works if the file can be found!
const DWORD len = GetShortPathNameW(
- o3tl::toW(path.getStr()), o3tl::toW(&vec[0]), path.getLength() + 1);
+ o3tl::toW(path.getStr()), o3tl::toW(vec.data()), path.getLength() + 1);
if (len > 0)
{
- OUString ret(&vec[0], len);
+ OUString ret(vec.data(), len);
return OUStringToOString(ret, RTL_TEXTENCODING_UTF8);
}
diff --git a/sal/osl/w32/module.cxx b/sal/osl/w32/module.cxx
index 6794fb512c87..43b386e90f99 100644
--- a/sal/osl/w32/module.cxx
+++ b/sal/osl/w32/module.cxx
@@ -67,13 +67,13 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 /*nRtldM
if (h == nullptr && Module->length > 260)
{
std::vector<WCHAR> vec(Module->length + 1);
- DWORD len = GetShortPathNameW(o3tl::toW(Module->buffer), &vec[0], Module->length + 1);
+ DWORD len = GetShortPathNameW(o3tl::toW(Module->buffer), vec.data(), Module->length + 1);
if (len )
{
- h = LoadLibraryW(&vec[0]);
+ h = LoadLibraryW(vec.data());
if (h == nullptr)
- h = LoadLibraryExW(&vec[0], nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
+ h = LoadLibraryExW(vec.data(), nullptr, LOAD_WITH_ALTERED_SEARCH_PATH);
}
}
diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx
index 27212eec17d5..d01b060e31c4 100644
--- a/sal/osl/w32/procimpl.cxx
+++ b/sal/osl/w32/procimpl.cxx
@@ -264,7 +264,7 @@ namespace /* private */
std::vector<sal_Unicode> vec(path.getLength() + 1);
//GetShortPathNameW only works if the file can be found!
const DWORD len = GetShortPathNameW(
- o3tl::toW(path.getStr()), o3tl::toW(&vec[0]), path.getLength() + 1);
+ o3tl::toW(path.getStr()), o3tl::toW(vec.data()), path.getLength() + 1);
if (!len && GetLastError() == ERROR_FILE_NOT_FOUND
&& extension.getLength())
@@ -273,12 +273,12 @@ namespace /* private */
std::vector<sal_Unicode> vec2(
extPath.getLength() + 1);
const DWORD len2 = GetShortPathNameW(
- o3tl::toW(extPath.getStr()), o3tl::toW(&vec2[0]), extPath.getLength() + 1);
- ret = OUString(&vec2[0], len2);
+ o3tl::toW(extPath.getStr()), o3tl::toW(vec2.data()), extPath.getLength() + 1);
+ ret = OUString(vec2.data(), len2);
}
else
{
- ret = OUString(&vec[0], len);
+ ret = OUString(vec.data(), len);
}
}
return ret;
@@ -456,7 +456,7 @@ oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO(
return osl_Process_E_InvalidError;
flags |= CREATE_UNICODE_ENVIRONMENT;
- p_environment = &environment[0];
+ p_environment = environment.data();
}
OUString cwd;
diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx
index 8fc6ee9d076f..90db6d437a16 100644
--- a/sal/osl/w32/profile.cxx
+++ b/sal/osl/w32/profile.cxx
@@ -391,7 +391,7 @@ DWORD GetPrivateProfileStringWrapper(const osl_TProfileImpl* pProfile,
pWDefault = (pDefault ? o3tl::toW(rtl_uString_getStr(pDefault)) : nullptr);
std::vector<wchar_t> aBuf(MaxLen + 1);
- GetPrivateProfileStringW(pWSection, pWEntry, pWDefault, &aBuf[0], MaxLen, o3tl::toW(rtl_uString_getStr(pProfile->m_strFileName)));
+ GetPrivateProfileStringW(pWSection, pWEntry, pWDefault, aBuf.data(), MaxLen, o3tl::toW(rtl_uString_getStr(pProfile->m_strFileName)));
if (pDefault)
rtl_uString_release(pDefault);
@@ -400,7 +400,7 @@ DWORD GetPrivateProfileStringWrapper(const osl_TProfileImpl* pProfile,
if (pSection)
rtl_uString_release(pSection);
- return WideCharToMultiByte(CP_ACP, 0, &aBuf[0], -1, pszString, MaxLen, nullptr, nullptr);
+ return WideCharToMultiByte(CP_ACP, 0, aBuf.data(), -1, pszString, MaxLen, nullptr, nullptr);
}
// Use Unicode version of WritePrivateProfileString, to work with Multi-language paths
@@ -1012,9 +1012,9 @@ sal_uInt32 SAL_CALL osl_getProfileSections(oslProfile Profile, sal_Char* pszBuff
else
{
std::vector<wchar_t> aBuf(MaxLen + 1);
- GetPrivateProfileSectionNamesW(&aBuf[0], MaxLen, o3tl::toW(rtl_uString_getStr(pProfile->m_strFileName)));
+ GetPrivateProfileSectionNamesW(aBuf.data(), MaxLen, o3tl::toW(rtl_uString_getStr(pProfile->m_strFileName)));
- n = WideCharToMultiByte(CP_ACP, 0, &aBuf[0], -1, pszBuffer, MaxLen, nullptr, nullptr);
+ n = WideCharToMultiByte(CP_ACP, 0, aBuf.data(), -1, pszBuffer, MaxLen, nullptr, nullptr);
}
releaseProfile(pProfile);
diff --git a/shell/source/win32/ooofilereader/basereader.cxx b/shell/source/win32/ooofilereader/basereader.cxx
index e0b1558c1c7b..7bf53b2752cd 100644
--- a/shell/source/win32/ooofilereader/basereader.cxx
+++ b/shell/source/win32/ooofilereader/basereader.cxx
@@ -67,7 +67,7 @@ void CBaseReader::Initialize( const std::string& ContentName)
{
xml_parser parser;
parser.set_document_handler(this); // pass current reader as reader to the sax parser
- parser.parse(&m_ZipContent[0], m_ZipContent.size(), true/*IsFinal*/);
+ parser.parse(m_ZipContent.data(), m_ZipContent.size(), true/*IsFinal*/);
}
}
catch(std::exception&)
diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx
index a7a87fdb2a25..3b57684fe821 100644
--- a/shell/source/win32/simplemail/senddoc.cxx
+++ b/shell/source/win32/simplemail/senddoc.cxx
@@ -162,10 +162,10 @@ static void initMapiMessage(
pMapiMessage->lpszSubject = const_cast<wchar_t*>(gSubject.c_str());
pMapiMessage->lpszNoteText = (gBody.length() ? const_cast<wchar_t*>(gBody.c_str()) : nullptr);
pMapiMessage->lpOriginator = aMapiOriginator;
- pMapiMessage->lpRecips = aMapiRecipientList.size() ? &aMapiRecipientList[0] : nullptr;
+ pMapiMessage->lpRecips = aMapiRecipientList.size() ? aMapiRecipientList.data() : nullptr;
pMapiMessage->nRecipCount = aMapiRecipientList.size();
if (!aMapiAttachmentList.empty())
- pMapiMessage->lpFiles = &aMapiAttachmentList[0];
+ pMapiMessage->lpFiles = aMapiAttachmentList.data();
pMapiMessage->nFileCount = aMapiAttachmentList.size();
}
diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx
index 1466d3f86228..7b225d16975b 100644
--- a/shell/source/win32/simplemail/smplmailclient.cxx
+++ b/shell/source/win32/simplemail/smplmailclient.cxx
@@ -136,7 +136,7 @@ namespace /* private */
an array of pointers to rtl_uString's */
oslProcessError err = osl_executeProcess(
senddocUrl.pData,
- const_cast<rtl_uString**>(reinterpret_cast<rtl_uString * const *>(&rCommandArgs[0])),
+ const_cast<rtl_uString**>(reinterpret_cast<rtl_uString * const *>(rCommandArgs.data())),
rCommandArgs.size(),
nProcOption,
nullptr,
diff --git a/shell/source/win32/zipfile/zipfile.cxx b/shell/source/win32/zipfile/zipfile.cxx
index 9de4b047a976..13f79a041018 100644
--- a/shell/source/win32/zipfile/zipfile.cxx
+++ b/shell/source/win32/zipfile/zipfile.cxx
@@ -464,7 +464,7 @@ void ZipFile::GetUncompressedContent(
ContentBuffer.clear();
ContentBuffer = ZipContentBuffer_t(entry.uncompressed_size);
if (!entry.compression)
- m_pStream->sread(reinterpret_cast<unsigned char *>(&ContentBuffer[0]), entry.uncompressed_size);
+ m_pStream->sread(reinterpret_cast<unsigned char *>(ContentBuffer.data()), entry.uncompressed_size);
else
{
int ret;
@@ -481,14 +481,14 @@ void ZipFile::GetUncompressedContent(
return;
std::vector<unsigned char> tmpBuffer(entry.compressed_size);
- if (entry.compressed_size != m_pStream->sread(&tmpBuffer[0], entry.compressed_size))
+ if (entry.compressed_size != m_pStream->sread(tmpBuffer.data(), entry.compressed_size))
return;
strm.avail_in = entry.compressed_size;
- strm.next_in = reinterpret_cast<Bytef *>(&tmpBuffer[0]);
+ strm.next_in = reinterpret_cast<Bytef *>(tmpBuffer.data());
strm.avail_out = entry.uncompressed_size;
- strm.next_out = reinterpret_cast<Bytef *>(&ContentBuffer[0]);
+ strm.next_out = reinterpret_cast<Bytef *>(ContentBuffer.data());
ret = inflate(&strm, Z_FINISH);
switch (ret)
{
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index c3d891cd681e..95fd346af1a5 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -1137,7 +1137,7 @@ bool WinSalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip )
if(nTargetCount)
{
- mrParent.mhRegion = CreatePolyPolygonRgn( &aPolyPoints[0], &aPolyCounts[0], nTargetCount, ALTERNATE );
+ mrParent.mhRegion = CreatePolyPolygonRgn( aPolyPoints.data(), aPolyCounts.data(), nTargetCount, ALTERNATE );
}
}
}
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 343e3f8b6208..b09c6848a58d 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -718,7 +718,7 @@ void WinFontFace::GetFontCapabilities( HDC hDC ) const
if( (nLength != GDI_ERROR) && nLength )
{
std::vector<unsigned char> aTable( nLength );
- unsigned char* pTable = &aTable[0];
+ unsigned char* pTable = aTable.data();
::GetFontData( hDC, OS2Tag, 0, pTable, nLength );
vcl::getTTCoverage(maFontCapabilities.oUnicodeRange, maFontCapabilities.oCodePageRange, pTable, nLength);
}
@@ -1729,7 +1729,7 @@ void WinSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont,
for( int i = 0; i < nGlyphs; i++ )
aGlyphIds[i] = sal_uInt16(i);
std::unique_ptr<sal_uInt16[]> pMetrics = ::GetTTSimpleGlyphMetrics( aSftTTF.get(),
- &aGlyphIds[0],
+ aGlyphIds.data(),
nGlyphs,
bVertical );
if( pMetrics )