summaryrefslogtreecommitdiff
path: root/sal
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 /sal
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>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/w32/module.cxx6
-rw-r--r--sal/osl/w32/procimpl.cxx10
-rw-r--r--sal/osl/w32/profile.cxx8
3 files changed, 12 insertions, 12 deletions
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);