bug 865715 - eliminate uninitialized-variable warning in nsGUIEventIPC.h. r=smaug
authorJonathan Kew <jkew@mozilla.com>
Fri, 26 Apr 2013 08:41:27 +0100
changeset 130038 6a62fb95a40b59def5471576ab90f356e0aa39b7
parent 130037 49ee3d96c62beb9edda172d92947716f4d54462c
child 130039 a9882387762990873b73d4d45a9ed9b270b4c4ac
push id1552
push userttaubert@mozilla.com
push dateSat, 27 Apr 2013 15:33:29 +0000
treeherderfx-team@40dafc376794 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs865715
milestone23.0a1
bug 865715 - eliminate uninitialized-variable warning in nsGUIEventIPC.h. r=smaug
widget/nsGUIEventIPC.h
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -257,27 +257,28 @@ struct ParamTraits<nsKeyEvent>
     WriteParam(aMsg, aParam.keyCode);
     WriteParam(aMsg, aParam.charCode);
     WriteParam(aMsg, aParam.isChar);
     WriteParam(aMsg, aParam.location);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
-    bool rv;
     uint32_t keyNameIndex;
-    rv = ReadParam(aMsg, aIter, static_cast<nsInputEvent*>(aResult)) &&
-         ReadParam(aMsg, aIter, &keyNameIndex) &&
-         ReadParam(aMsg, aIter, &aResult->keyCode) &&
-         ReadParam(aMsg, aIter, &aResult->charCode) &&
-         ReadParam(aMsg, aIter, &aResult->isChar) &&
-         ReadParam(aMsg, aIter, &aResult->location);
-    aResult->mKeyNameIndex =
-      static_cast<mozilla::widget::KeyNameIndex>(keyNameIndex);
-    return rv;
+    if (ReadParam(aMsg, aIter, static_cast<nsInputEvent*>(aResult)) &&
+        ReadParam(aMsg, aIter, &keyNameIndex) &&
+        ReadParam(aMsg, aIter, &aResult->keyCode) &&
+        ReadParam(aMsg, aIter, &aResult->charCode) &&
+        ReadParam(aMsg, aIter, &aResult->isChar) &&
+        ReadParam(aMsg, aIter, &aResult->location)) {
+      aResult->mKeyNameIndex =
+        static_cast<mozilla::widget::KeyNameIndex>(keyNameIndex);
+      return true;
+    }
+    return false;
   }
 };
 
 template<>
 struct ParamTraits<nsTextRangeStyle>
 {
   typedef nsTextRangeStyle paramType;