summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2020-04-10 16:10:42 -0700
committerSteven Moreland <smoreland@google.com>2020-04-10 16:10:42 -0700
commitb4c3aad3aae6310a3a4ff0daea3108167242a545 (patch)
treea48d37f7e25e4c2f0cfe4334eccab0b713e7edd1 /base
parent07b8e0653167c89c25091d5b182247fd3982291c (diff)
downloadlibhidl-b4c3aad3aae6310a3a4ff0daea3108167242a545.tar.gz
Fix incorrect hidl_vec comments.
This type value initializes primitives these days, but these comments were written when it didn't. Fixes: 153745259 Test: n/A Change-Id: I0970e8fb830e94f5ca26f70291d127e85b7dbd59
Diffstat (limited to 'base')
-rw-r--r--base/include/hidl/HidlSupport.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 0a0beeb..1bb38e8 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -342,7 +342,6 @@ struct hidl_vec {
memset(mPad, 0, sizeof(mPad));
}
- // Note, does not initialize primitive types.
hidl_vec(size_t size) : hidl_vec() { resize(size); }
hidl_vec(const hidl_vec<T> &other) : hidl_vec() {
@@ -507,7 +506,7 @@ struct hidl_vec {
return mBuffer[index];
}
- // Does not initialize primitive types if new size > old size.
+ // Copies over old elements fitting in new size. Value initializes the rest.
void resize(size_t size) {
if (size > UINT32_MAX) {
details::logAlwaysFatal("hidl_vec can't hold more than 2^32 elements.");