Fix JavaScriptGlue, WebCore and WebKit to build without warnings using GCC 4.2.
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Nov 2007 04:32:46 +0000 (04:32 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Nov 2007 04:32:46 +0000 (04:32 +0000)
Reviewed by Eric.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27951 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
JavaScriptGlue/ChangeLog
JavaScriptGlue/Configurations/Base.xcconfig
JavaScriptGlue/JSRun.h
WebCore/ChangeLog
WebCore/Configurations/Base.xcconfig
WebCore/css/CSSRuleList.cpp
WebCore/css/CSSStyleSelector.cpp
WebCore/html/HTMLParser.cpp
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderLayer.cpp
WebCore/rendering/RenderStyle.cpp
WebCore/rendering/RenderText.cpp
WebCore/rendering/bidi.cpp
WebKit/mac/ChangeLog
WebKit/mac/Configurations/Base.xcconfig

index 57df5cf..c89c309 100644 (file)
@@ -1,3 +1,12 @@
+2007-11-21  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Eric.
+
+        Fix JavaScriptGlue to build without warnings using GCC 4.2.
+
+        * Configurations/Base.xcconfig:
+        * JSRun.h:
+
 2007-11-17  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Darin Adler.
index 9078d60..15bbbea 100644 (file)
@@ -23,7 +23,7 @@ LINKER_DISPLAYS_MANGLED_NAMES = YES;
 PREBINDING = NO;
 VALID_ARCHS = i386 ppc x86_64 ppc64;
 WARNING_CFLAGS = $(WARNING_CFLAGS_$(CURRENT_ARCH));
-WARNING_CFLAGS_BASE = -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wno-long-double -Wundef -Wno-strict-aliasing;
+WARNING_CFLAGS_BASE = -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wundef -Wno-strict-aliasing;
 WARNING_CFLAGS_ = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
 WARNING_CFLAGS_i386 = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
 WARNING_CFLAGS_ppc = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
index 98f38b1..52217a5 100644 (file)
@@ -40,7 +40,7 @@ class JSInterpreter : public Interpreter {
         JSFlags Flags() const { return fJSFlags; }
 
     protected:
-        virtual JSInterpreter::~JSInterpreter() { } // only deref on the base class should delete us
+        virtual ~JSInterpreter() { } // only deref on the base class should delete us
 
     private:
         JSFlags fJSFlags;
index 12fbe23..0120093 100644 (file)
@@ -1,3 +1,31 @@
+2007-11-21  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Eric.
+
+        Fix WebCore to build without warnings under GCC 4.2.
+
+        * Configurations/Base.xcconfig:
+        * css/CSSRuleList.cpp:
+        (WebCore::CSSRuleList::deleteRule):
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::locateSharedStyle):
+        * html/HTMLParser.cpp:
+        (WebCore::HTMLParser::allowNestedRedundantTag):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::fillInlineSelectionGaps):
+        (WebCore::RenderBlock::fillBlockSelectionGaps):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::stackingContext):
+        (WebCore::RenderLayer::enclosingPositionedAncestor):
+        (WebCore::RenderLayer::transparentAncestor):
+        * rendering/RenderStyle.cpp:
+        (WebCore::BackgroundLayer::fillUnsetProperties):
+        (WebCore::Transition::fillUnsetProperties):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::containsOnlyWhitespace):
+        * rendering/bidi.cpp:
+        (WebCore::RenderBlock::determineStartPosition):
+
 2007-11-21  Alp Toker  <alp@atoker.com>
 
         Reviewed by Mark Rowe.
index a85e171..d1b8fad 100644 (file)
@@ -21,7 +21,7 @@ LINKER_DISPLAYS_MANGLED_NAMES = YES;
 PREBINDING = NO;
 VALID_ARCHS = i386 ppc x86_64 ppc64;
 WARNING_CFLAGS = $(WARNING_CFLAGS_$(CURRENT_ARCH));
-WARNING_CFLAGS_BASE = -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wno-long-double -Wundef;
+WARNING_CFLAGS_BASE = -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wundef;
 WARNING_CFLAGS_ = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
 WARNING_CFLAGS_i386 = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
 WARNING_CFLAGS_ppc = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
index 5dc8158..ce30344 100644 (file)
@@ -57,8 +57,7 @@ void CSSRuleList::deleteRule(unsigned index)
     CSSRule* rule = m_lstCSSRules.take(index);
     if (rule)
         rule->deref();
-    else
-        ; // FIXME: Throw INDEX_SIZE_ERR exception here
+    // FIXME: Throw INDEX_SIZE_ERR exception here if !rule
 }
 
 void CSSRuleList::append(CSSRule* rule)
index 4a1c3a7..1867145 100644 (file)
@@ -741,13 +741,13 @@ RenderStyle* CSSStyleSelector::locateSharedStyle()
         // Check previous siblings.
         unsigned count = 0;
         Node* n;
-        for (n = element->previousSibling(); n && !n->isElementNode(); n = n->previousSibling());
+        for (n = element->previousSibling(); n && !n->isElementNode(); n = n->previousSibling()) { }
         while (n) {
             if (canShareStyleWithElement(n))
                 return n->renderStyle();
             if (count++ == cStyleSearchThreshold)
                 return 0;
-            for (n = n->previousSibling(); n && !n->isElementNode(); n = n->previousSibling());
+            for (n = n->previousSibling(); n && !n->isElementNode(); n = n->previousSibling()) { }
         }
         if (!n) 
             n = locateCousinList(static_cast<Element*>(element->parentNode()));
@@ -756,7 +756,7 @@ RenderStyle* CSSStyleSelector::locateSharedStyle()
                 return n->renderStyle();
             if (count++ == cStyleSearchThreshold)
                 return 0;
-            for (n = n->previousSibling(); n && !n->isElementNode(); n = n->previousSibling());
+            for (n = n->previousSibling(); n && !n->isElementNode(); n = n->previousSibling()) { }
         }        
     }
     return 0;
index 8d94913..87fcef6 100644 (file)
@@ -838,7 +838,7 @@ bool HTMLParser::allowNestedRedundantTag(const AtomicString& tagName)
     unsigned i = 0;
     for (HTMLStackElem* curr = blockStack;
          i < cMaxRedundantTagDepth && curr && curr->tagName == tagName;
-         curr = curr->next, i++);
+         curr = curr->next, i++) { }
     return i != cMaxRedundantTagDepth;
 }
 
index 39e8d42..33feb66 100644 (file)
@@ -1851,7 +1851,7 @@ GapRects RenderBlock::fillInlineSelectionGaps(RenderBlock* rootBlock, int blockX
 
     RootInlineBox* lastSelectedLine = 0;
     RootInlineBox* curr;
-    for (curr = firstRootBox(); curr && !curr->hasSelectedChildren(); curr = curr->nextRootBox());
+    for (curr = firstRootBox(); curr && !curr->hasSelectedChildren(); curr = curr->nextRootBox()) { }
 
     // Now paint the gaps for the lines.
     for (; curr && curr->hasSelectedChildren(); curr = curr->nextRootBox()) {
@@ -1889,7 +1889,7 @@ GapRects RenderBlock::fillBlockSelectionGaps(RenderBlock* rootBlock, int blockX,
 
     // Go ahead and jump right to the first block child that contains some selected objects.
     RenderObject* curr;
-    for (curr = firstChild(); curr && curr->selectionState() == SelectionNone; curr = curr->nextSibling());
+    for (curr = firstChild(); curr && curr->selectionState() == SelectionNone; curr = curr->nextSibling()) { }
 
     for (bool sawSelectionEnd = false; curr && !sawSelectionEnd; curr = curr->nextSibling()) {
         SelectionState childState = curr->selectionState();
index b5bdba8..852dee9 100644 (file)
@@ -407,7 +407,7 @@ RenderLayer *RenderLayer::stackingContext() const
     RenderLayer* curr = parent();
     for ( ; curr && !curr->m_object->isRenderView() && !curr->m_object->isRoot() &&
           curr->m_object->style()->hasAutoZIndex();
-          curr = curr->parent());
+          curr = curr->parent()) { }
     return curr;
 }
 
@@ -417,7 +417,7 @@ RenderLayer::enclosingPositionedAncestor() const
     RenderLayer* curr = parent();
     for ( ; curr && !curr->m_object->isRenderView() && !curr->m_object->isRoot() &&
          !curr->m_object->isPositioned() && !curr->m_object->isRelPositioned();
-         curr = curr->parent());
+         curr = curr->parent()) { }
          
     return curr;
 }
@@ -436,7 +436,7 @@ RenderLayer*
 RenderLayer::transparentAncestor()
 {
     RenderLayer* curr = parent();
-    for ( ; curr && !curr->isTransparent(); curr = curr->parent());
+    for ( ; curr && !curr->isTransparent(); curr = curr->parent()) { }
     return curr;
 }
 
index fa48d2b..a52dc48 100644 (file)
@@ -200,7 +200,7 @@ bool BackgroundLayer::operator==(const BackgroundLayer& o) const
 void BackgroundLayer::fillUnsetProperties()
 {
     BackgroundLayer* curr;
-    for (curr = this; curr && curr->isBackgroundImageSet(); curr = curr->next());
+    for (curr = this; curr && curr->isBackgroundImageSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (BackgroundLayer* pattern = this; curr; curr = curr->next()) {
@@ -211,7 +211,7 @@ void BackgroundLayer::fillUnsetProperties()
         }
     }
     
-    for (curr = this; curr && curr->isBackgroundXPositionSet(); curr = curr->next());
+    for (curr = this; curr && curr->isBackgroundXPositionSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (BackgroundLayer* pattern = this; curr; curr = curr->next()) {
@@ -222,7 +222,7 @@ void BackgroundLayer::fillUnsetProperties()
         }
     }
     
-    for (curr = this; curr && curr->isBackgroundYPositionSet(); curr = curr->next());
+    for (curr = this; curr && curr->isBackgroundYPositionSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (BackgroundLayer* pattern = this; curr; curr = curr->next()) {
@@ -233,7 +233,7 @@ void BackgroundLayer::fillUnsetProperties()
         }
     }
     
-    for (curr = this; curr && curr->isBackgroundAttachmentSet(); curr = curr->next());
+    for (curr = this; curr && curr->isBackgroundAttachmentSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (BackgroundLayer* pattern = this; curr; curr = curr->next()) {
@@ -244,7 +244,7 @@ void BackgroundLayer::fillUnsetProperties()
         }
     }
     
-    for (curr = this; curr && curr->isBackgroundClipSet(); curr = curr->next());
+    for (curr = this; curr && curr->isBackgroundClipSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (BackgroundLayer* pattern = this; curr; curr = curr->next()) {
@@ -255,7 +255,7 @@ void BackgroundLayer::fillUnsetProperties()
         }
     }
 
-    for (curr = this; curr && curr->isBackgroundCompositeSet(); curr = curr->next());
+    for (curr = this; curr && curr->isBackgroundCompositeSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (BackgroundLayer* pattern = this; curr; curr = curr->next()) {
@@ -266,7 +266,7 @@ void BackgroundLayer::fillUnsetProperties()
         }
     }
 
-    for (curr = this; curr && curr->isBackgroundOriginSet(); curr = curr->next());
+    for (curr = this; curr && curr->isBackgroundOriginSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (BackgroundLayer* pattern = this; curr; curr = curr->next()) {
@@ -277,7 +277,7 @@ void BackgroundLayer::fillUnsetProperties()
         }
     }
 
-    for (curr = this; curr && curr->isBackgroundRepeatSet(); curr = curr->next());
+    for (curr = this; curr && curr->isBackgroundRepeatSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (BackgroundLayer* pattern = this; curr; curr = curr->next()) {
@@ -288,7 +288,7 @@ void BackgroundLayer::fillUnsetProperties()
         }
     }
     
-    for (curr = this; curr && curr->isBackgroundSizeSet(); curr = curr->next());
+    for (curr = this; curr && curr->isBackgroundSizeSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (BackgroundLayer* pattern = this; curr; curr = curr->next()) {
@@ -598,7 +598,7 @@ bool Transition::operator==(const Transition& o) const
 void Transition::fillUnsetProperties()
 {
     Transition* curr;
-    for (curr = this; curr && curr->isTransitionDurationSet(); curr = curr->next());
+    for (curr = this; curr && curr->isTransitionDurationSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (Transition* pattern = this; curr; curr = curr->next()) {
@@ -609,7 +609,7 @@ void Transition::fillUnsetProperties()
         }
     }
     
-    for (curr = this; curr && curr->isTransitionRepeatCountSet(); curr = curr->next());
+    for (curr = this; curr && curr->isTransitionRepeatCountSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (Transition* pattern = this; curr; curr = curr->next()) {
@@ -620,7 +620,7 @@ void Transition::fillUnsetProperties()
         }
     }
     
-    for (curr = this; curr && curr->isTransitionTimingFunctionSet(); curr = curr->next());
+    for (curr = this; curr && curr->isTransitionTimingFunctionSet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (Transition* pattern = this; curr; curr = curr->next()) {
@@ -631,7 +631,7 @@ void Transition::fillUnsetProperties()
         }
     }
 
-    for (curr = this; curr && curr->isTransitionPropertySet(); curr = curr->next());
+    for (curr = this; curr && curr->isTransitionPropertySet(); curr = curr->next()) { }
     if (curr && curr != this) {
         // We need to fill in the remaining values with the pattern specified.
         for (Transition* pattern = this; curr; curr = curr->next()) {
index 1072508..de754b0 100644 (file)
@@ -702,7 +702,7 @@ bool RenderText::containsOnlyWhitespace(unsigned from, unsigned len) const
     unsigned currPos;
     for (currPos = from;
          currPos < from + len && ((*m_text)[currPos] == '\n' || (*m_text)[currPos] == ' ' || (*m_text)[currPos] == '\t');
-         currPos++);
+         currPos++) { }
     return currPos >= (from + len);
 }
 
index 97bfe1d..1a834a3 100644 (file)
@@ -1104,7 +1104,7 @@ RootInlineBox* RenderBlock::determineStartPosition(bool fullLayout, BidiIterator
             ASSERT(!firstLineBox() && !lastLineBox());
         }
     } else {
-        for (curr = firstRootBox(); curr && !curr->isDirty(); curr = curr->nextRootBox());
+        for (curr = firstRootBox(); curr && !curr->isDirty(); curr = curr->nextRootBox()) { }
         if (curr) {
             // We have a dirty line.
             if (RootInlineBox* prevRootBox = curr->prevRootBox()) {
index 5c32b35..79849f2 100644 (file)
@@ -1,5 +1,13 @@
 2007-11-21  Mark Rowe  <mrowe@apple.com>
 
+        Reviewed by Eric.
+
+        Fix WebKit to build without warnings under GCC 4.2.
+
+        * Configurations/Base.xcconfig:
+
+2007-11-21  Mark Rowe  <mrowe@apple.com>
+
         Reviewed by Tim Hatcher.
 
         Changes due to <rdar://problem/5602936> Need to resolve new GCC 4.2 warnings
index 8bed2dc..ad1ad95 100644 (file)
@@ -21,7 +21,7 @@ LINKER_DISPLAYS_MANGLED_NAMES = YES;
 PREBINDING = NO;
 VALID_ARCHS = i386 ppc x86_64 ppc64;
 // FIXME: <rdar://problem/5070292> WebKit should build with -Wshorten-64-to-32
-WARNING_CFLAGS = -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wno-long-double -Wundef;
+WARNING_CFLAGS = -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wundef;
 
 
 // <rdar://problem/5488678>: Production builds on 10.4 PowerPC need to have debugging symbols disabled to prevent a huge STABS section being generated.