Fix debug build with assertions disabled
authorkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Dec 2011 20:37:08 +0000 (20:37 +0000)
committerkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Dec 2011 20:37:08 +0000 (20:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75075

Reviewed by Darin Adler.

Check whether assertions are disabled instead of NDEBUG
where appropriate to avoid "defined but not used" warnings.

Source/JavaScriptCore:

* wtf/DateMath.cpp:
(WTF::initializeDates):

Source/WebCore:

No change in behaviour so no new tests.

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::insertInLRUList):
(WebCore::MemoryCache::removeFromLiveDecodedResourcesList):
(WebCore::MemoryCache::insertInLiveDecodedResourcesList):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlockChild):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wtf/DateMath.cpp
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderLayer.cpp

index 3c365b0..a0100db 100644 (file)
@@ -1,3 +1,16 @@
+2011-12-22  Balazs Kelemen  <kbalazs@webkit.org>
+
+        Fix debug build with assertions disabled
+        https://bugs.webkit.org/show_bug.cgi?id=75075
+
+        Reviewed by Darin Adler.
+
+        Check whether assertions are disabled instead of NDEBUG
+        where appropriate to avoid "defined but not used" warnings.
+
+        * wtf/DateMath.cpp:
+        (WTF::initializeDates):
+
 2011-12-22  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
 
         [EFL] Missing plugins support for efl port
index 04fe805..9be348a 100644 (file)
@@ -448,7 +448,7 @@ double calculateDSTOffset(double ms, double utcOffset)
 
 void initializeDates()
 {
-#ifndef NDEBUG
+#if !ASSERT_DISABLED
     static bool alreadyInitialized;
     ASSERT(!alreadyInitialized);
     alreadyInitialized = true;
index 8c966f4..0c17fe4 100644 (file)
@@ -1,3 +1,24 @@
+2011-12-22  Balazs Kelemen  <kbalazs@webkit.org>
+
+        Fix debug build with assertions disabled
+        https://bugs.webkit.org/show_bug.cgi?id=75075
+
+        Reviewed by Darin Adler.
+
+        Check whether assertions are disabled instead of NDEBUG
+        where appropriate to avoid "defined but not used" warnings.
+
+        No change in behaviour so no new tests.
+
+        * loader/cache/MemoryCache.cpp:
+        (WebCore::MemoryCache::insertInLRUList):
+        (WebCore::MemoryCache::removeFromLiveDecodedResourcesList):
+        (WebCore::MemoryCache::insertInLiveDecodedResourcesList):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutBlockChild):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPositions):
+
 2011-12-22  Anders Carlsson  <andersca@apple.com>
 
         Get rid of didStartAnimatedScroll and didCompleteAnimatedScroll
index 45142a2..7de315e 100644 (file)
@@ -486,7 +486,7 @@ void MemoryCache::insertInLRUList(CachedResource* resource)
     if (!resource->m_nextInAllResourcesList)
         list->m_tail = resource;
         
-#ifndef NDEBUG
+#if !ASSERT_DISABLED
     // Verify that we are in now in the list like we should be.
     list = lruListFor(resource);
     bool found = false;
@@ -552,7 +552,7 @@ void MemoryCache::removeFromLiveDecodedResourcesList(CachedResource* resource)
         return;
     resource->m_inLiveDecodedResourcesList = false;
 
-#ifndef NDEBUG
+#if !ASSERT_DISABLED
     // Verify that we are in fact in this list.
     bool found = false;
     for (CachedResource* current = m_liveDecodedResources.m_head; current; current = current->m_nextInLiveResourcesList) {
@@ -598,7 +598,7 @@ void MemoryCache::insertInLiveDecodedResourcesList(CachedResource* resource)
     if (!resource->m_nextInLiveResourcesList)
         m_liveDecodedResources.m_tail = resource;
         
-#ifndef NDEBUG
+#if !ASSERT_DISABLED
     // Verify that we are in now in the list like we should be.
     bool found = false;
     for (CachedResource* current = m_liveDecodedResources.m_head; current; current = current->m_nextInLiveResourcesList) {
index aeabe1e..7ba6c6a 100755 (executable)
@@ -2043,7 +2043,7 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, Lay
     LayoutRect oldRect(child->x(), child->y() , child->width(), child->height());
     LayoutUnit oldLogicalTop = logicalTopForChild(child);
 
-#ifndef NDEBUG
+#if !ASSERT_DISABLED
     LayoutSize oldLayoutDelta = view()->layoutDelta();
 #endif
     // Go ahead and position the child as though it didn't collapse with the top.
index 7a74e62..db6a4ed 100644 (file)
@@ -310,7 +310,7 @@ LayoutPoint RenderLayer::computeOffsetFromRoot(bool& hasLayerOffset) const
 
 void RenderLayer::updateLayerPositions(LayoutPoint* offsetFromRoot, UpdateLayerPositionsFlags flags)
 {
-#ifndef NDEBUG
+#if !ASSERT_DISABLED
     if (offsetFromRoot) {
         bool hasLayerOffset;
         LayoutPoint computedOffsetFromRoot = computeOffsetFromRoot(hasLayerOffset);