Bug 777792 - Initialize the type variable in ParamTraits<nsMouseEvent>::Read; r=cjones
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 26 Jul 2012 15:16:23 -0400
changeset 106101 46ea45da584e54e608780af2720a559df6716c4f
parent 106100 6b4f10c6d5e29a4ff4705b1375d06f98ee8fe9fc
child 106102 b9a1f5cae6ea23dc00c97401caffc9343ab2d65a
push id1490
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 18:29:50 +0000
treeherdermozilla-beta@f335e7dacdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs777792
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 777792 - Initialize the type variable in ParamTraits<nsMouseEvent>::Read; r=cjones This is mostly to silence compiler warnings. The uninitialized type itself won't cause problems because failed Read() prevents dispatch.
widget/nsGUIEventIPC.h
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -131,17 +131,17 @@ struct ParamTraits<nsMouseEvent>
     WriteParam(aMsg, (PRUint8) aParam.context);
     WriteParam(aMsg, (PRUint8) aParam.exit);
     WriteParam(aMsg, aParam.clickCount);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     bool rv;
-    PRUint8 reason, context, exit;
+    PRUint8 reason = 0, context = 0, exit = 0;
     rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
          ReadParam(aMsg, aIter, &aResult->ignoreRootScrollFrame) &&
          ReadParam(aMsg, aIter, &reason) &&
          ReadParam(aMsg, aIter, &context) &&
          ReadParam(aMsg, aIter, &exit) &&
          ReadParam(aMsg, aIter, &aResult->clickCount);
     aResult->reason = static_cast<nsMouseEvent::reasonType>(reason);
     aResult->context = static_cast<nsMouseEvent::contextType>(context);