From: Wolfgang Rosenauer <stark@suse.de>
Subject: Fix compiler warnings which disturb autobuild
References:

### autobuild
... testing for serious compiler warnings
Program is using uninitialized variables. Note the difference between "is used" 
and "may be used". Please investigate and fix.
Problematic file(s) and their linenumbers:
  nsUnicodeToJamoTTF.cpp: 855
  nsObjectFrame.cpp: 1933
###

### autobuild
... testing for serious compiler warnings
Program returns random data in a function. Please fix.
Problematic file(s) and their linenumbers:
  nsWebShell.cpp: 562
  nsOperaProfileMigrator.cpp: 831
  Program is using uninitialized variables. Note the difference between "is used" and "may be used".
  Please investigate and fix.
  Problematic file(s) and their linenumbers:
  nsFrame.cpp: 3536
###

--- gfx/src/gtk/nsFontMetricsUtils.cpp.old	2005-03-24 07:27:33.000000000 +0100
+++ gfx/src/gtk/nsFontMetricsUtils.cpp	2005-03-24 07:28:26.000000000 +0100
@@ -75,6 +75,7 @@ NS_FontMetricsGetHints(void)
 #ifdef MOZ_ENABLE_COREXFONTS
     return nsFontMetricsGTK::GetHints();
 #endif
+    return 1;
 }
 
 nsresult
@@ -95,6 +96,7 @@ NS_FontMetricsFamilyExists(nsIDeviceCont
 #ifdef MOZ_ENABLE_COREXFONTS
     return nsFontMetricsGTK::FamilyExists(aDevice, aName);
 #endif
+    return 1;
 }
 
 #ifdef MOZ_ENABLE_XFT
Index: intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp
===================================================================
RCS file: /cvsroot/mozilla/intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp,v
retrieving revision 1.10
diff -u -p -6 -r1.10 nsUnicodeToJamoTTF.cpp
--- intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp	19 Feb 2005 07:27:54 -0000	1.10
+++ intl/uconv/ucvko/nsUnicodeToJamoTTF.cpp	7 Jun 2005 07:21:10 -0000
@@ -842,12 +842,13 @@ PRInt16 JamoSrchReplace (const JamoNormM
   // we don't need a separate range check here because the one in 
   // for-loop is sufficient.
   for (PRInt32 i = start; i <= end - clusterLen; i++)
   {
     const JamoNormMap *match;
     JamoNormMap key;
+    key.liga = 0;
 
     // cluster array is made up of PRUint8's to save memory
     // and we have to subtract aOffset from the input before looking it up.
     key.seq[0] = aIn[i] - aOffset;
     key.seq[1] = aIn[i + 1] - aOffset;
     key.seq[2] = clusterLen == 3 ? (aIn[i + 2] - aOffset) : 0;
Index: layout/generic/nsObjectFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/generic/nsObjectFrame.cpp,v
retrieving revision 1.505
diff -u -p -6 -r1.505 nsObjectFrame.cpp
--- layout/generic/nsObjectFrame.cpp	6 May 2005 03:14:31 -0000	1.505
+++ layout/generic/nsObjectFrame.cpp	7 Jun 2005 07:23:27 -0000
@@ -1850,12 +1850,13 @@ nsObjectFrame::Paint(nsPresContext*     
     // now we need to setup the correct location for printing
     nsresult rv;
     nsPluginWindow    window;
     nsPoint           origin;
     float             t2p;
     window.window =   nsnull;
+    window.ws_info =  nsnull;
 
     // prepare embedded mode printing struct
     nsPluginPrint npprint;
     npprint.mode = nsPluginMode_Embedded;
 
     // we need to find out if we are windowless or not
Index: docshell/base/nsWebShell.cpp
===================================================================
RCS file: /cvsroot/mozilla/docshell/base/nsWebShell.cpp,v
retrieving revision 1.656.2.1
diff -u -p -6 -r1.656.2.1 nsWebShell.cpp
--- docshell/base/nsWebShell.cpp	16 Sep 2005 19:11:52 -0000	1.656.2.1
+++ docshell/base/nsWebShell.cpp	22 Sep 2005 06:30:30 -0000
@@ -556,12 +556,13 @@ nsWebShell::OnLinkClickSync(nsIContent *
       // XXX TODO Should be similar to the HTML IMG ALT attribute handling
       //          in NS 4.x
     default:
       NS_ABORT_IF_FALSE(0,"unexpected link verb");
       return NS_ERROR_UNEXPECTED;
   }
+  return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
 nsWebShell::OnOverLink(nsIContent* aContent,
                        nsIURI* aURI,
                        const PRUnichar* aTargetSpec)
Index: layout/generic/nsFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/generic/nsFrame.cpp,v
retrieving revision 3.574.2.4
diff -u -p -6 -r3.574.2.4 nsFrame.cpp
--- layout/generic/nsFrame.cpp	20 Sep 2005 06:32:09 -0000	3.574.2.4
+++ layout/generic/nsFrame.cpp	22 Sep 2005 06:31:42 -0000
@@ -3528,13 +3528,13 @@ nsresult
 nsFrame::PeekOffsetParagraph(nsPresContext* aPresContext,
                              nsPeekOffsetStruct *aPos)
 {
 #ifdef DEBUG_paragraph
   printf("Selecting paragraph\n");
 #endif
-  nsIFrame* blockFrame;
+  nsIFrame* blockFrame = NULL;
   nsCOMPtr<nsILineIterator> iter (getter_AddRefs(GetBlockFrameAndLineIter(this, &blockFrame)));
   if (!blockFrame || !iter)
     return NS_ERROR_UNEXPECTED;
 
   PRInt32 thisLine;
   nsresult result = iter->FindLineContaining(this, &thisLine);
--- layout/base/nsCSSRendering.cpp.orig	2006-10-25 23:59:19.000000000 +0200
+++ layout/base/nsCSSRendering.cpp	2006-10-26 00:00:04.000000000 +0200
@@ -1000,14 +1000,14 @@
             FillOrInvertRect(aContext,  dashRect.x, borderOutside.y,dashRect.width, dashRect.height-adjust,isInvert);
             FillOrInvertRect(aContext,dashRect.x,(borderOutside.YMost()-(dashRect.height-adjust)),dashRect.width, dashRect.height-adjust,isInvert);
             currRect.y += (dashRect.height-adjust);
-            temp = temp-= (dashRect.height-adjust);
+            temp -= (dashRect.height-adjust);
           } else {
             adjust = (temp%dashRect.width)/2;                   // adjust a tad longer
             // draw in the left and right
             FillOrInvertRect(aContext, dashRect.x, borderOutside.y,dashRect.width, dashRect.height+adjust,isInvert);
             FillOrInvertRect(aContext, dashRect.x,(borderOutside.YMost()-(dashRect.height+adjust)),dashRect.width, dashRect.height+adjust,isInvert);
             currRect.y += (dashRect.height+adjust);
-            temp = temp-= (dashRect.height+adjust);
+            temp -= (dashRect.height+adjust);
           }
         
           if( temp > ywidth)
@@ -1066,14 +1066,14 @@
             FillOrInvertRect(aContext, borderOutside.x,dashRect.y,dashRect.width-adjust,dashRect.height,isInvert);
             FillOrInvertRect(aContext, (borderOutside.XMost()-(dashRect.width-adjust)),dashRect.y,dashRect.width-adjust,dashRect.height,isInvert);
             currRect.x += (dashRect.width-adjust);
-            temp = temp-= (dashRect.width-adjust);
+            temp -= (dashRect.width-adjust);
           } else {
             adjust = (temp%dashRect.width)/2;
             // draw in the left and right
             FillOrInvertRect(aContext, borderOutside.x,dashRect.y,dashRect.width+adjust,dashRect.height,isInvert);
             FillOrInvertRect(aContext, (borderOutside.XMost()-(dashRect.width+adjust)),dashRect.y,dashRect.width+adjust,dashRect.height,isInvert);
             currRect.x += (dashRect.width+adjust);
-            temp = temp-= (dashRect.width+adjust);
+            temp -= (dashRect.width+adjust);
           }
        
 
--- layout/xul/base/src/nsBox.cpp.orig	2006-10-26 00:00:26.000000000 +0200
+++ layout/xul/base/src/nsBox.cpp	2006-10-26 00:01:30.000000000 +0200
@@ -863,7 +863,7 @@
       while (box) {
         nsRect* overflowArea = box->GetOverflowAreaProperty();
         nsRect bounds = overflowArea ? *overflowArea + box->GetPosition() :
-                                         bounds = box->GetRect();
+                                         box->GetRect();
         rect.UnionRect(rect, bounds);
 
         box->GetNextBox(&box);
--- intl/unicharutil/src/nsEntityConverter.cpp.orig	2005-04-02 20:44:00.000000000 +0200
+++ intl/unicharutil/src/nsEntityConverter.cpp	2006-10-26 00:07:24.000000000 +0200
@@ -236,7 +236,8 @@
     if (IS_HIGH_SURROGATE(inString[i]) &&
         i + 2 < len &&
         IS_LOW_SURROGATE(inString[i + 1])) {
-      key.AppendInt(SURROGATE_TO_UCS4(inString[i], inString[++i]), 10);
+      key.AppendInt(SURROGATE_TO_UCS4(inString[i], inString[i + 1]), 10);
+      ++i;
     }
     else {
       key.AppendInt(inString[i],10);
--- content/events/src/nsEventStateManager.cpp.orig	2006-08-06 00:19:17.000000000 +0200
+++ content/events/src/nsEventStateManager.cpp	2006-10-26 00:11:16.000000000 +0200
@@ -4301,7 +4301,7 @@
               do_QueryInterface(GetDocumentOuterWindow(mDocument));
             if (newWindow) {
               nsIFocusController *newFocusController =
-                newFocusController = newWindow->GetRootFocusController();
+                newWindow->GetRootFocusController();
               nsCOMPtr<nsPIDOMWindow> oldWindow =
                 do_QueryInterface(GetDocumentOuterWindow(gLastFocusedDocument));
               if (oldWindow) {
--- netwerk/cache/src/nsDiskCacheMap.h.orig	2006-02-04 23:01:22.000000000 +0100
+++ netwerk/cache/src/nsDiskCacheMap.h	2006-10-26 00:15:09.000000000 +0200
@@ -168,7 +168,7 @@
         
         // set blockCount
         NS_ASSERTION( (blockCount>=1) && (blockCount<=4),"invalid block count");
-        blockCount = --blockCount;
+        --blockCount;
         mDataLocation |= (blockCount << eExtraBlocksOffset) & eExtraBlocksMask;
         
         mDataLocation |= eLocationInitializedMask;
@@ -236,7 +236,7 @@
         
         // set blockCount
         NS_ASSERTION( (blockCount>=1) && (blockCount<=4),"invalid block count");
-        blockCount = --blockCount;
+        --blockCount;
         mMetaLocation |= (blockCount << eExtraBlocksOffset) & eExtraBlocksMask;
         
         mMetaLocation |= eLocationInitializedMask;
Index: mailnews/local/src/nsMailboxService.cpp
===================================================================
--- mailnews/local/src/nsMailboxService.cpp.orig
+++ mailnews/local/src/nsMailboxService.cpp
@@ -228,7 +228,7 @@ nsresult nsMailboxService::FetchMessage(
 
     // this happens with forward inline of message/rfc822 attachment
     // opened in a stand-alone msg window.
-    PRInt32 typeIndex = typeIndex = uriString.Find("&type=application/x-message-display");
+    PRInt32 typeIndex = uriString.Find("&type=application/x-message-display");
     if (typeIndex != kNotFound)
     {
       uriString.Cut(typeIndex, sizeof("&type=application/x-message-display") - 1);
