[commit: packages/containers] cleaned_bugfix394, master, merge-doc-target, merge-fixes-5.9, revert-408-bugfix_394: Data.Sequence.Internal: Fix CPP usage (c5f2897)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:45:57 UTC 2017


Repository : ssh://git@git.haskell.org/containers

On branches: cleaned_bugfix394,master,merge-doc-target,merge-fixes-5.9,revert-408-bugfix_394
Link       : http://git.haskell.org/packages/containers.git/commitdiff/c5f289788373ac85bd3739a1e5a92ac7323cbd2e

>---------------------------------------------------------------

commit c5f289788373ac85bd3739a1e5a92ac7323cbd2e
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Sun Oct 23 12:15:42 2016 +1100

    Data.Sequence.Internal: Fix CPP usage
    
    There was a mixture of `#ifdef TESTING` and `#if TESTING`. The later
    works, but is not really correct. GHC HEAD now has a `-Wcpp-undef`
    warning that we would like to turn on and hence need this fixed.


>---------------------------------------------------------------

c5f289788373ac85bd3739a1e5a92ac7323cbd2e
 Data/Sequence/Internal.hs | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/Data/Sequence/Internal.hs b/Data/Sequence/Internal.hs
index 95c143e..9cacb39 100644
--- a/Data/Sequence/Internal.hs
+++ b/Data/Sequence/Internal.hs
@@ -182,7 +182,7 @@ module Data.Sequence.Internal (
     zipWith3,       -- :: (a -> b -> c -> d) -> Seq a -> Seq b -> Seq c -> Seq d
     zip4,           -- :: Seq a -> Seq b -> Seq c -> Seq d -> Seq (a, b, c, d)
     zipWith4,       -- :: (a -> b -> c -> d -> e) -> Seq a -> Seq b -> Seq c -> Seq d -> Seq e
-#if TESTING
+#ifdef TESTING
     deep,
     node2,
     node3,
@@ -694,7 +694,7 @@ instance Eq a => Eq (Seq a) where
 instance Ord a => Ord (Seq a) where
     compare xs ys = compare (toList xs) (toList ys)
 
-#if TESTING
+#ifdef TESTING
 instance Show a => Show (Seq a) where
     showsPrec p (Seq x) = showsPrec p x
 #else
@@ -762,7 +762,7 @@ data FingerTree a
     = EmptyT
     | Single a
     | Deep {-# UNPACK #-} !Int !(Digit a) (FingerTree (Node a)) !(Digit a)
-#if TESTING
+#ifdef TESTING
     deriving Show
 #endif
 
@@ -854,7 +854,7 @@ data Digit a
     | Two a a
     | Three a a a
     | Four a a a a
-#if TESTING
+#ifdef TESTING
     deriving Show
 #endif
 
@@ -941,7 +941,7 @@ digitToTree' !_n (One a) = Single a
 data Node a
     = Node2 {-# UNPACK #-} !Int a a
     | Node3 {-# UNPACK #-} !Int a a a
-#if TESTING
+#ifdef TESTING
     deriving Show
 #endif
 
@@ -1014,7 +1014,7 @@ nodeToDigit (Node3 _ a b c) = Three a b c
 -- Elements
 
 newtype Elem a  =  Elem { getElem :: a }
-#if TESTING
+#ifdef TESTING
     deriving Show
 #endif
 
@@ -1820,7 +1820,7 @@ lookup i (Seq xs)
 (!?) = flip lookup
 
 data Place a = Place {-# UNPACK #-} !Int a
-#if TESTING
+#ifdef TESTING
     deriving Show
 #endif
 
@@ -3149,7 +3149,7 @@ uncheckedSplitAt i (Seq xs) = case splitTreeE i xs of
   l :*: r -> (Seq l, Seq r)
 
 data Split a = Split !(FingerTree (Node a)) !(Node a) !(FingerTree (Node a))
-#if TESTING
+#ifdef TESTING
     deriving Show
 #endif
 
@@ -4208,7 +4208,7 @@ data PQL e = Nil | {-# UNPACK #-} !(PQueue e) :& PQL e
 
 infixr 8 :&
 
-#if TESTING
+#ifdef TESTING
 
 instance Functor PQueue where
     fmap f (PQueue x ts) = PQueue (f x) (fmap f ts)



More information about the ghc-commits mailing list