lgtm https://chromiumcodereview.appspot.com/9307114/diff/6001/ppapi/native_client/src/shared/ppapi_proxy/ppp_instance_combined.cc File ppapi/native_client/src/shared/ppapi_proxy/ppp_instance_combined.cc (right): https://chromiumcodereview.appspot.com/9307114/diff/6001/ppapi/native_client/src/shared/ppapi_proxy/ppp_instance_combined.cc#newcode15 ppapi/native_client/src/shared/ppapi_proxy/ppp_instance_combined.cc:15: memset(&instance_1_1_, 0, sizeof(instance_1_1_)); On 2012/02/07 21:09:21, James Hawkins ...
8 years, 10 months ago
(2012-02-07 21:30:19 UTC)
#7
lgtm
https://chromiumcodereview.appspot.com/9307114/diff/6001/ppapi/native_client/...
File ppapi/native_client/src/shared/ppapi_proxy/ppp_instance_combined.cc
(right):
https://chromiumcodereview.appspot.com/9307114/diff/6001/ppapi/native_client/...
ppapi/native_client/src/shared/ppapi_proxy/ppp_instance_combined.cc:15:
memset(&instance_1_1_, 0, sizeof(instance_1_1_));
On 2012/02/07 21:09:21, James Hawkins wrote:
> On 2012/02/06 18:38:07, dmichael wrote:
> > doesn't it suffice to just put instance_1_1_() in the initializer list?
>
> The default constructor doesn't initialize the POD types (in this case, the
> function pointers).
instance_1_1_ is a POD struct. Adding instance_1_1_() to the initializer list
"value-initializes" instance_1_1_, which means the pointers are all set to NULL.
See, e.g.:
http://stackoverflow.com/questions/3803153/what-are-primitive-types-default-i...
That said, not everyone knows that, so memset may be clearer. I'm fine either
way.
Issue 9307114: Coverity: Initialize member variables.
(Closed)
Created 8 years, 10 months ago by James Hawkins
Modified 8 years, 10 months ago
Reviewers: groby-ooo-7-16, Sergey Ulanov, scherkus (not reviewing), dmichael (off chromium)
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 5