Hello community,

here is the log from the commit of package ghc-pinch for openSUSE:Factory 
checked in at 2017-06-21 13:55:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-pinch (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-pinch.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-pinch"

Wed Jun 21 13:55:46 2017 rev:5 rq:504675 version:0.3.2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-pinch/ghc-pinch.changes      2017-06-04 
01:58:29.151585744 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-pinch.new/ghc-pinch.changes 2017-06-21 
13:55:48.863026609 +0200
@@ -1,0 +2,5 @@
+Mon Jun 12 09:41:33 UTC 2017 - psim...@suse.com
+
+- Update to version 0.3.2.0.
+
+-------------------------------------------------------------------

Old:
----
  pinch-0.3.1.0.tar.gz

New:
----
  pinch-0.3.2.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-pinch.spec ++++++
--- /var/tmp/diff_new_pack.Y2PbQo/_old  2017-06-21 13:55:51.686628315 +0200
+++ /var/tmp/diff_new_pack.Y2PbQo/_new  2017-06-21 13:55:51.686628315 +0200
@@ -19,7 +19,7 @@
 %global pkg_name pinch
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.3.1.0
+Version:        0.3.2.0
 Release:        0
 Summary:        An alternative implementation of Thrift for Haskell
 License:        BSD-3-Clause

++++++ pinch-0.3.1.0.tar.gz -> pinch-0.3.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pinch-0.3.1.0/CHANGES.md new/pinch-0.3.2.0/CHANGES.md
--- old/pinch-0.3.1.0/CHANGES.md        2017-05-14 02:10:22.000000000 +0200
+++ new/pinch-0.3.2.0/CHANGES.md        2017-06-03 23:33:39.000000000 +0200
@@ -1,3 +1,9 @@
+0.3.2.0 (2017-06-03)
+====================
+
+-   Compact: Fixed bug which caused incorrect encoding of doubles.
+
+
 0.3.1.0 (2017-05-13)
 ====================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pinch-0.3.1.0/pinch.cabal 
new/pinch-0.3.2.0/pinch.cabal
--- old/pinch-0.3.1.0/pinch.cabal       2017-05-14 02:12:31.000000000 +0200
+++ new/pinch-0.3.2.0/pinch.cabal       2017-06-03 23:33:27.000000000 +0200
@@ -3,7 +3,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           pinch
-version:        0.3.1.0
+version:        0.3.2.0
 cabal-version:  >= 1.10
 build-type:     Simple
 license:        BSD3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pinch-0.3.1.0/src/Pinch/Internal/Builder.hs 
new/pinch-0.3.2.0/src/Pinch/Internal/Builder.hs
--- old/pinch-0.3.1.0/src/Pinch/Internal/Builder.hs     2016-07-13 
06:08:03.000000000 +0200
+++ new/pinch-0.3.2.0/src/Pinch/Internal/Builder.hs     2017-06-03 
23:33:00.000000000 +0200
@@ -21,7 +21,9 @@
     , int16BE
     , int32BE
     , int64BE
+    , int64LE
     , doubleBE
+    , doubleLE
     , byteString
     ) where
 
@@ -116,11 +118,22 @@
 int64BE = primFixed BP.int64BE
 {-# INLINE int64BE #-}
 
+-- | Serialize a signed 64-bit integer in little endian format.
+int64LE :: Int64 -> Builder
+int64LE = primFixed BP.int64LE
+{-# INLINE int64LE #-}
+
 -- | Serialize a signed 64-bit floating point number in big endian format.
 doubleBE :: Double -> Builder
 doubleBE = primFixed BP.doubleBE
 {-# INLINE doubleBE #-}
 
+-- | Serialize a signed 64-bit floating point number in little endian format.
+doubleLE :: Double -> Builder
+doubleLE = primFixed BP.doubleLE
+{-# INLINE doubleLE #-}
+
+
 -- | Inlcude the given ByteString as-is in the builder.
 --
 -- Note that because this operation is applied lazily, we will maintain a
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pinch-0.3.1.0/src/Pinch/Internal/Parser.hs 
new/pinch-0.3.2.0/src/Pinch/Internal/Parser.hs
--- old/pinch-0.3.1.0/src/Pinch/Internal/Parser.hs      2017-01-12 
17:34:48.000000000 +0100
+++ new/pinch-0.3.2.0/src/Pinch/Internal/Parser.hs      2017-06-03 
23:33:00.000000000 +0200
@@ -22,7 +22,9 @@
     , int16
     , int32
     , int64
+    , int64LE
     , double
+    , doubleLE
     , take
     ) where
 
@@ -177,12 +179,34 @@
          fromIntegral (b `BU.unsafeIndex` 7)
 {-# INLINE int64 #-}
 
+-- | Produces a signed 64-bit integer (parsed in little endian byte ordering)
+-- and advances the parser.
+int64LE :: Parser Int64
+int64LE = mk <$> take 8
+  where
+    {-# INLINE mk #-}
+    mk b = fromIntegral $
+        (fromIntegral (b `BU.unsafeIndex` 7) `w64ShiftL` 56) .|.
+        (fromIntegral (b `BU.unsafeIndex` 6) `w64ShiftL` 48) .|.
+        (fromIntegral (b `BU.unsafeIndex` 5) `w64ShiftL` 40) .|.
+        (fromIntegral (b `BU.unsafeIndex` 4) `w64ShiftL` 32) .|.
+        (fromIntegral (b `BU.unsafeIndex` 3) `w64ShiftL` 24) .|.
+        (fromIntegral (b `BU.unsafeIndex` 2) `w64ShiftL` 16) .|.
+        (fromIntegral (b `BU.unsafeIndex` 1) `w64ShiftL`  8) .|.
+         fromIntegral (b `BU.unsafeIndex` 0)
+{-# INLINE int64LE #-}
 
 -- | Produces a 64-bit floating point number and advances the parser.
 double :: Parser Double
 double = int64 >>= \i -> return (ST.runST (cast i))
 {-# INLINE double #-}
 
+-- | Produces a 64-bit floating point number (parsed in little endian byte
+-- ordering) and advances the parser.
+doubleLE :: Parser Double
+doubleLE = int64LE >>= \i -> return (ST.runST (cast i))
+{-# INLINE doubleLE #-}
+
 
 cast :: (A.MArray (A.STUArray s) a (ST s),
          A.MArray (A.STUArray s) b (ST s)) => a -> ST s b
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pinch-0.3.1.0/src/Pinch/Protocol/Compact.hs 
new/pinch-0.3.2.0/src/Pinch/Protocol/Compact.hs
--- old/pinch-0.3.1.0/src/Pinch/Protocol/Compact.hs     2017-01-12 
17:34:48.000000000 +0100
+++ new/pinch-0.3.2.0/src/Pinch/Protocol/Compact.hs     2017-06-03 
23:33:00.000000000 +0200
@@ -145,7 +145,7 @@
 parseByte = VByte <$> P.int8
 
 parseDouble :: Parser (Value TDouble)
-parseDouble = VDouble <$> P.double
+parseDouble = VDouble <$> P.doubleLE
 
 parseInt16 :: Parser (Value TInt16)
 parseInt16 = VInt16 . fromIntegral . zigZagToInt <$> parseVarint
@@ -253,7 +253,7 @@
 {-# INLINE serializeByte #-}
 
 serializeDouble :: Value TDouble -> Builder
-serializeDouble (VDouble x) = BB.doubleBE x
+serializeDouble (VDouble x) = BB.doubleLE x
 {-# INLINE serializeDouble #-}
 
 serializeVarint :: Int64 -> Builder
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pinch-0.3.1.0/tests/Pinch/Internal/BuilderParserSpec.hs 
new/pinch-0.3.2.0/tests/Pinch/Internal/BuilderParserSpec.hs
--- old/pinch-0.3.1.0/tests/Pinch/Internal/BuilderParserSpec.hs 2015-12-27 
19:42:48.000000000 +0100
+++ new/pinch-0.3.2.0/tests/Pinch/Internal/BuilderParserSpec.hs 2017-06-03 
23:33:00.000000000 +0200
@@ -37,9 +37,15 @@
     prop "can round trip 64-bit integers" $
         roundTrip P.int64 BB.int64BE
 
+    prop "can round trip 64-bit little endian integers" $
+        roundTrip P.int64LE BB.int64LE
+
     prop "can round trip doubles" $
         roundTrip P.double BB.doubleBE
 
+    prop "can round trip little endian doubles" $
+        roundTrip P.doubleLE BB.doubleLE
+
     prop "can round trip bytestrings" $ \(SomeByteString bs) ->
         roundTrip (P.take (B.length bs)) BB.byteString bs
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pinch-0.3.1.0/tests/Pinch/Internal/BuilderSpec.hs 
new/pinch-0.3.2.0/tests/Pinch/Internal/BuilderSpec.hs
--- old/pinch-0.3.1.0/tests/Pinch/Internal/BuilderSpec.hs       2015-12-27 
09:09:02.000000000 +0100
+++ new/pinch-0.3.2.0/tests/Pinch/Internal/BuilderSpec.hs       2017-06-03 
23:33:00.000000000 +0200
@@ -78,6 +78,22 @@
             , ([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], 
-9223372036854775808)
             ]
 
+    it "can serialize 64-bit little endian integers" $
+        builderCases BB.int64LE
+            [ ([0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], 1)
+            , ([0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00], 4294967295)
+            , ([0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00], 1099511627775)
+            , ([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00], 
281474976710655)
+            , ([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00], 
72057594037927935)
+            , ([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f], 
9223372036854775807)
+            , ([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], -1)
+            , ([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff], -4294967296)
+            , ([0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff], 
-1099511627776)
+            , ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff], 
-281474976710656)
+            , ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff], 
-72057594037927936)
+            , ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80], 
-9223372036854775808)
+            ]
+
     it "can serialize doubles" $
         builderCases BB.doubleBE
             [ ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], 0.0)
@@ -89,6 +105,17 @@
             , ([0xbf, 0xf0, 0x00, 0x00, 0x00, 0x06, 0xdf, 0x38], -1.0000000001)
             ]
 
+    it "can serialize little endian doubles" $
+        builderCases BB.doubleLE
+            [ ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], 0.0)
+            , ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f], 1.0)
+            , ([0x38, 0xdf, 0x06, 0x00, 0x00, 0x00, 0xf0, 0x3f], 1.0000000001)
+            , ([0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xf1, 0x3f], 1.1)
+            , ([0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xf1, 0xbf], -1.1)
+            , ([0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40], 
3.141592653589793)
+            , ([0x38, 0xdf, 0x06, 0x00, 0x00, 0x00, 0xf0, 0xbf], -1.0000000001)
+            ]
+
     prop "can serialize byte strings" $ \(SomeByteString bs) ->
         BB.runBuilder (BB.byteString bs) `shouldBe` bs
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pinch-0.3.1.0/tests/Pinch/Internal/ParserSpec.hs 
new/pinch-0.3.2.0/tests/Pinch/Internal/ParserSpec.hs
--- old/pinch-0.3.1.0/tests/Pinch/Internal/ParserSpec.hs        2015-11-27 
08:57:26.000000000 +0100
+++ new/pinch-0.3.2.0/tests/Pinch/Internal/ParserSpec.hs        2017-06-03 
23:33:00.000000000 +0200
@@ -94,6 +94,22 @@
             , ([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], 
-9223372036854775808)
             ]
 
+    it "can parse 64-bit little endian integers" $
+        parseCases P.int64LE
+            [ ([0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], 1)
+            , ([0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00], 4294967295)
+            , ([0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00], 1099511627775)
+            , ([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00], 
281474976710655)
+            , ([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00], 
72057594037927935)
+            , ([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f], 
9223372036854775807)
+            , ([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], -1)
+            , ([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff], -4294967296)
+            , ([0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff], 
-1099511627776)
+            , ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff], 
-281474976710656)
+            , ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff], 
-72057594037927936)
+            , ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80], 
-9223372036854775808)
+            ]
+
     it "can parse doubles" $
         parseCases P.double
             [ ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], 0.0)
@@ -105,6 +121,17 @@
             , ([0xbf, 0xf0, 0x00, 0x00, 0x00, 0x06, 0xdf, 0x38], -1.0000000001)
             ]
 
+    it "can parse little endian doubles" $
+        parseCases P.doubleLE
+            [ ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], 0.0)
+            , ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f], 1.0)
+            , ([0x38, 0xdf, 0x06, 0x00, 0x00, 0x00, 0xf0, 0x3f], 1.0000000001)
+            , ([0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xf1, 0x3f], 1.1)
+            , ([0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xf1, 0xbf], -1.1)
+            , ([0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40], 
3.141592653589793)
+            , ([0x38, 0xdf, 0x06, 0x00, 0x00, 0x00, 0xf0, 0xbf], -1.0000000001)
+            ]
+
     describe "take" $ do
 
         prop "returns the requested number of bytes" $
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pinch-0.3.1.0/tests/Pinch/Protocol/CompactSpec.hs 
new/pinch-0.3.2.0/tests/Pinch/Protocol/CompactSpec.hs
--- old/pinch-0.3.1.0/tests/Pinch/Protocol/CompactSpec.hs       2017-01-12 
17:34:48.000000000 +0100
+++ new/pinch-0.3.2.0/tests/Pinch/Protocol/CompactSpec.hs       2017-06-03 
23:33:00.000000000 +0200
@@ -152,12 +152,12 @@
 
     it "can read and write doubles" $ readWriteCases
         [ ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], vdub 0.0)
-        , ([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], vdub 1.0)
-        , ([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x06, 0xdf, 0x38], vdub 1.0000000001)
-        , ([0x3f, 0xf1, 0x99, 0x99, 0x99, 0x99, 0x99, 0x9a], vdub 1.1)
-        , ([0xbf, 0xf1, 0x99, 0x99, 0x99, 0x99, 0x99, 0x9a], vdub -1.1)
-        , ([0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18], vdub 
3.141592653589793)
-        , ([0xbf, 0xf0, 0x00, 0x00, 0x00, 0x06, 0xdf, 0x38], vdub 
-1.0000000001)
+        , ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f], vdub 1.0)
+        , ([0x38, 0xdf, 0x06, 0x00, 0x00, 0x00, 0xf0, 0x3f], vdub 1.0000000001)
+        , ([0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xf1, 0x3f], vdub 1.1)
+        , ([0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xf1, 0xbf], vdub -1.1)
+        , ([0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40], vdub 
3.141592653589793)
+        , ([0x38, 0xdf, 0x06, 0x00, 0x00, 0x00, 0xf0, 0xbf], vdub 
-1.0000000001)
         ]
 
     it "can read and write structs" $ readWriteCases


Reply via email to