summaryrefslogtreecommitdiff
path: root/libs/shaders/shaders.cpp
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2022-09-27 21:04:06 +0000
committer Prabir Pradhan <prabirmsp@google.com> 2022-10-31 21:55:37 +0000
commitd6ccedb2282b6653f60de94d8924ecd6f2cd72e7 (patch)
treef9415a3e3b1f67a00e44ee9284689d4e9648169d /libs/shaders/shaders.cpp
parent211ba627f011fb25c4457a12bee7919c93334361 (diff)
TouchInputMapper: Rely on default c'tor and copy c'tors for structs
Manually defining copyFrom(), reset(), and clear() operations on structs that should be POD types is errorprone, since each member must be copied or reinitialized correctly in all of them. Also, default-initialization can leave many of these non-class values in an undefined state. Instead, we can rely on initializing members wherever they are defined, which allows us to remove manually added c'tors and copy functions and rely on the compiler generated equivalents. This also reduces the liklihood of issues arising because of uninitialized data. We prefer brace initialization over other forms of initialization. Using braces for all types results in the most consistent behavior of calling the default c'tor for class types, and 0-initializing non class types. Bug: 245989146 Test: atest inputflinger_tests Change-Id: I0b34480ec441bd06097a626ff4c6dc5d2e046e38
Diffstat (limited to 'libs/shaders/shaders.cpp')
0 files changed, 0 insertions, 0 deletions