diff options
| author | Glenn Kasten <gkasten@google.com> | 2012-01-30 10:15:48 -0800 |
|---|---|---|
| committer | Glenn Kasten <gkasten@google.com> | 2012-01-30 10:31:09 -0800 |
| commit | 1f812f720f50787469e5866abb92326e4c707334 (patch) | |
| tree | c64e3a3041c92832e9ae800a75907ccd3cdfc1e1 /opengl/tests/gl_basic/gl_basic.cpp | |
| parent | acabf488674e0f5a6d0fa6d1da5e36b417a681a0 (diff) | |
Fix const sp<>& in parameter list and return value
EffectModule::addHandle and Client::heap() were declared incorrectly.
As a parameter, an sp<> should be & for efficiency, and for input
parameters it should also be const to protect the caller's value.
But as a return value, an sp<> should have neither const or &. The "e"
in "return e;" might be located on the stack, and if there is "&" then
the caller would see the address of a variable which no longer exists.
Also, an & would make it hard to do "return 0;".
A "const" without & is meaningless in the return type.
(In this particular case, the "e" is a member field, so it was safe.)
Change-Id: I3df5f294214eb15a9d4d596c6d5ef29de97b5c27
Diffstat (limited to 'opengl/tests/gl_basic/gl_basic.cpp')
0 files changed, 0 insertions, 0 deletions
