summaryrefslogtreecommitdiff
path: root/binaryurp
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-05-22 13:49:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-05-22 16:35:20 +0200
commitc18e2ea2a52fc171c50fcb22d431e94c6aececc5 (patch)
treea63721b18626947e5278a51feb7fd64604e80eee /binaryurp
parent7cf4bcef41448218f76fa1e974f541e13dc03023 (diff)
New loplugin:data
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'binaryurp')
-rw-r--r--binaryurp/source/incomingrequest.cxx12
-rw-r--r--binaryurp/source/writer.cxx4
2 files changed, 8 insertions, 8 deletions
diff --git a/binaryurp/source/incomingrequest.cxx b/binaryurp/source/incomingrequest.cxx
index 63ecf649d0ba..95e85a3f5808 100644
--- a/binaryurp/source/incomingrequest.cxx
+++ b/binaryurp/source/incomingrequest.cxx
@@ -213,7 +213,7 @@ bool IncomingRequest::execute_throw(
css::uno::TypeDescription(
mtd->pParams[j].pTypeRef).
get()->nSize));
- p = &outBufs.back()[0];
+ p = outBufs.back().data();
}
args.push_back(p);
if (mtd->pParams[j].bOut) {
@@ -234,8 +234,8 @@ bool IncomingRequest::execute_throw(
uno_Any exc;
uno_Any * pexc = &exc;
(*object_.get()->pDispatcher)(
- object_.get(), member_.get(), retBuf.empty() ? nullptr : &retBuf[0],
- args.empty() ? nullptr : &args[0], &pexc);
+ object_.get(), member_.get(), retBuf.empty() ? nullptr : retBuf.data(),
+ args.empty() ? nullptr : args.data(), &pexc);
isExc = pexc != nullptr;
if (isExc) {
*returnValue = BinaryAny(
@@ -245,8 +245,8 @@ bool IncomingRequest::execute_throw(
uno_any_destruct(&exc, nullptr);
} else {
if (!retBuf.empty()) {
- *returnValue = BinaryAny(retType, &retBuf[0]);
- uno_destructData(&retBuf[0], retType.get(), nullptr);
+ *returnValue = BinaryAny(retType, retBuf.data());
+ uno_destructData(retBuf.data(), retType.get(), nullptr);
}
if (!outArguments->empty()) {
assert(
@@ -268,7 +268,7 @@ bool IncomingRequest::execute_throw(
}
if (!mtd->pParams[k].bIn) {
uno_type_destructData(
- &(*j++)[0], mtd->pParams[k].pTypeRef, nullptr);
+ (j++)->data(), mtd->pParams[k].pTypeRef, nullptr);
}
}
assert(i == outArguments->end());
diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx
index 14b87449926a..585f375d7a58 100644
--- a/binaryurp/source/writer.cxx
+++ b/binaryurp/source/writer.cxx
@@ -415,7 +415,7 @@ void Writer::sendMessage(std::vector< unsigned char > const & buffer) {
Marshal::write32(&header, static_cast< sal_uInt32 >(buffer.size()));
Marshal::write32(&header, 1);
assert(!buffer.empty());
- unsigned char const * p = &buffer[0];
+ unsigned char const * p = buffer.data();
std::vector< unsigned char >::size_type n = buffer.size();
assert(header.size() <= SAL_MAX_INT32);
/*static_*/assert(SAL_MAX_INT32 <= std::numeric_limits<std::size_t>::max());
@@ -425,7 +425,7 @@ void Writer::sendMessage(std::vector< unsigned char > const & buffer) {
}
css::uno::Sequence<sal_Int8> s(header.size() + k);
assert(!header.empty());
- std::memcpy(s.getArray(), &header[0], header.size());
+ std::memcpy(s.getArray(), header.data(), header.size());
for (;;) {
std::memcpy(s.getArray() + s.getLength() - k, p, k);
try {