Hello community,
here is the log from the commit of package ghc-streaming-commons for
openSUSE:Factory checked in at 2019-06-12 13:18:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-streaming-commons (Old)
and /work/SRC/openSUSE:Factory/.ghc-streaming-commons.new.4811 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-streaming-commons"
Wed Jun 12 13:18:45 2019 rev:17 rq:709203 version:0.2.1.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-streaming-commons/ghc-streaming-commons.changes
2018-10-25 09:05:14.926544737 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-streaming-commons.new.4811/ghc-streaming-commons.changes
2019-06-12 13:18:45.980566258 +0200
@@ -1,0 +2,10 @@
+Thu Jun 6 02:01:25 UTC 2019 - [email protected]
+
+- Update streaming-commons to version 0.2.1.1.
+ # ChangeLog for streaming-commons
+
+ ## 0.2.1.1
+
+ * Fix a failing test case (invalid `ByteString` copying), does not affect
library itself
+
+-------------------------------------------------------------------
Old:
----
streaming-commons-0.2.1.0.tar.gz
New:
----
streaming-commons-0.2.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-streaming-commons.spec ++++++
--- /var/tmp/diff_new_pack.G1P6ui/_old 2019-06-12 13:18:46.560565993 +0200
+++ /var/tmp/diff_new_pack.G1P6ui/_new 2019-06-12 13:18:46.564565991 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-streaming-commons
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name streaming-commons
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.2.1.0
+Version: 0.2.1.1
Release: 0
Summary: Common lower-level functions needed by various streaming data
libraries
License: MIT
++++++ streaming-commons-0.2.1.0.tar.gz -> streaming-commons-0.2.1.1.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.2.1.0/ChangeLog.md
new/streaming-commons-0.2.1.1/ChangeLog.md
--- old/streaming-commons-0.2.1.0/ChangeLog.md 2018-06-27 09:12:16.000000000
+0200
+++ new/streaming-commons-0.2.1.1/ChangeLog.md 2019-06-05 14:57:19.000000000
+0200
@@ -1,3 +1,9 @@
+# ChangeLog for streaming-commons
+
+## 0.2.1.1
+
+* Fix a failing test case (invalid `ByteString` copying), does not affect
library itself
+
## 0.2.1.0
* Change `bindRandomPortGen` to use binding to port 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.2.1.0/Data/Streaming/Network.hs
new/streaming-commons-0.2.1.1/Data/Streaming/Network.hs
--- old/streaming-commons-0.2.1.0/Data/Streaming/Network.hs 2018-06-27
09:10:50.000000000 +0200
+++ new/streaming-commons-0.2.1.1/Data/Streaming/Network.hs 2018-06-28
18:01:46.000000000 +0200
@@ -200,9 +200,6 @@
-- | Bind to a random port number. Especially useful for writing network tests.
--
--- This will attempt 30 different port numbers before giving up and throwing an
--- exception.
---
-- Since 0.1.1
bindRandomPortGen :: SocketType -> HostPreference -> IO (Int, Socket)
bindRandomPortGen sockettype s = do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.2.1.0/cbits/text-helper.c
new/streaming-commons-0.2.1.1/cbits/text-helper.c
--- old/streaming-commons-0.2.1.0/cbits/text-helper.c 2015-11-24
11:15:28.000000000 +0100
+++ new/streaming-commons-0.2.1.1/cbits/text-helper.c 2019-06-05
14:56:43.000000000 +0200
@@ -14,13 +14,17 @@
void _hs_streaming_commons_memcpy(void *dest, size_t doff, const void *src,
size_t soff,
size_t n)
{
- memcpy(dest + (doff<<1), src + (soff<<1), n<<1);
+ char *cdest = dest;
+ const char *csrc = src;
+ memcpy(cdest + (doff<<1), csrc + (soff<<1), n<<1);
}
int _hs_streaming_commons_memcmp(const void *a, size_t aoff, const void *b,
size_t boff,
size_t n)
{
- return memcmp(a + (aoff<<1), b + (boff<<1), n<<1);
+ const char *ca = a;
+ const char *cb = b;
+ return memcmp(ca + (aoff<<1), cb + (boff<<1), n<<1);
}
#define UTF8_ACCEPT 0
@@ -68,8 +72,8 @@
* an UTF16 array
*/
void
-_hs_streaming_commons_decode_latin1(uint16_t *dest, const uint8_t const *src,
- const uint8_t const *srcend)
+_hs_streaming_commons_decode_latin1(uint16_t *dest, const uint8_t *src,
+ const uint8_t *srcend)
{
const uint8_t *p = src;
@@ -130,14 +134,14 @@
#if defined(__GNUC__) || defined(__clang__)
static inline uint8_t const *
_hs_streaming_commons_decode_utf8_int(uint16_t *const dest, size_t *destoff,
- const uint8_t const **src, const uint8_t const *srcend,
+ const uint8_t **src, const uint8_t *srcend,
uint32_t *codepoint0, uint32_t *state0)
__attribute((always_inline));
#endif
static inline uint8_t const *
_hs_streaming_commons_decode_utf8_int(uint16_t *const dest, size_t *destoff,
- const uint8_t const **src, const uint8_t const *srcend,
+ const uint8_t **src, const uint8_t *srcend,
uint32_t *codepoint0, uint32_t *state0)
{
uint16_t *d = dest + *destoff;
@@ -158,7 +162,7 @@
if (state == UTF8_ACCEPT) {
while (s < srcend - 4) {
- codepoint = *((uint32_t *) s);
+ codepoint = *((const uint32_t *) s);
if ((codepoint & 0x80808080) != 0)
break;
s += 4;
@@ -202,8 +206,8 @@
uint8_t const *
_hs_streaming_commons_decode_utf8_state(uint16_t *const dest, size_t *destoff,
- const uint8_t const **src,
- const uint8_t const *srcend,
+ const uint8_t **src,
+ const uint8_t *srcend,
uint32_t *codepoint0, uint32_t *state0)
{
uint8_t const *ret = _hs_streaming_commons_decode_utf8_int(dest, destoff,
src, srcend,
@@ -243,7 +247,7 @@
ascii:
#if defined(__x86_64__)
while (srcend - src >= 4) {
- uint64_t w = *((uint64_t *) src);
+ uint64_t w = *((const uint64_t *) src);
if (w & 0xFF80FF80FF80FF80ULL) {
if (!(w & 0x000000000000FF80ULL)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.2.1.0/cbits/zlib-helper.c
new/streaming-commons-0.2.1.1/cbits/zlib-helper.c
--- old/streaming-commons-0.2.1.0/cbits/zlib-helper.c 2015-11-24
11:15:28.000000000 +0100
+++ new/streaming-commons-0.2.1.1/cbits/zlib-helper.c 2019-06-05
14:56:43.000000000 +0200
@@ -27,14 +27,14 @@
return deflateInit2(stream, level, Z_DEFLATED, methodBits, memlevel,
strategy);
}
-int streaming_commons_inflate_set_dictionary(z_stream *stream, const char*
dictionary,
+int streaming_commons_inflate_set_dictionary(z_stream *stream, const char*
dictionary,
unsigned int dictLength) {
- return inflateSetDictionary(stream, dictionary, dictLength);
+ return inflateSetDictionary(stream, (const Bytef *)dictionary,
dictLength);
}
-int streaming_commons_deflate_set_dictionary(z_stream *stream, const char*
dictionary,
+int streaming_commons_deflate_set_dictionary(z_stream *stream, const char*
dictionary,
unsigned int dictLength) {
- return deflateSetDictionary(stream, dictionary, dictLength);
+ return deflateSetDictionary(stream, (const Bytef *)dictionary,
dictLength);
}
void streaming_commons_free_z_stream_inflate (z_stream *stream)
@@ -45,13 +45,13 @@
void streaming_commons_set_avail_in (z_stream *stream, char *buff, unsigned
int avail)
{
- stream->next_in = buff;
+ stream->next_in = (Bytef *)buff;
stream->avail_in = avail;
}
void streaming_commons_set_avail_out (z_stream *stream, char *buff, unsigned
int avail)
{
- stream->next_out = buff;
+ stream->next_out = (Bytef *)buff;
stream->avail_out = avail;
}
@@ -72,7 +72,7 @@
char* streaming_commons_get_next_in (z_stream *stream)
{
- return stream->next_in;
+ return (char *)stream->next_in;
}
void streaming_commons_free_z_stream_deflate (z_stream *stream)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.2.1.0/streaming-commons.cabal
new/streaming-commons-0.2.1.1/streaming-commons.cabal
--- old/streaming-commons-0.2.1.0/streaming-commons.cabal 2018-06-27
09:12:13.000000000 +0200
+++ new/streaming-commons-0.2.1.1/streaming-commons.cabal 2019-06-05
14:57:19.000000000 +0200
@@ -1,5 +1,5 @@
name: streaming-commons
-version: 0.2.1.0
+version: 0.2.1.1
synopsis: Common lower-level functions needed by various streaming
data libraries
description: Provides low-dependency functionality commonly needed by
various streaming data libraries, such as conduit and pipes.
homepage: https://github.com/fpco/streaming-commons
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/streaming-commons-0.2.1.0/test/Data/Streaming/ByteString/BuilderSpec.hs
new/streaming-commons-0.2.1.1/test/Data/Streaming/ByteString/BuilderSpec.hs
--- old/streaming-commons-0.2.1.0/test/Data/Streaming/ByteString/BuilderSpec.hs
2018-06-27 09:09:10.000000000 +0200
+++ new/streaming-commons-0.2.1.1/test/Data/Streaming/ByteString/BuilderSpec.hs
2019-06-05 14:57:19.000000000 +0200
@@ -7,7 +7,6 @@
import qualified Data.ByteString as S
import Data.ByteString.Char8 ()
-import qualified Data.ByteString.Unsafe as S
import qualified Data.ByteString.Builder as B
import Data.ByteString.Builder (Builder)
import qualified Data.ByteString.Builder.Internal as B
@@ -107,12 +106,20 @@
builderSpec
- prop "toByteStringIO idempotent to toLazyByteString" $ \bss' -> do
+ let prop_idempotent i bss' = do
let bss = mconcat (map (B.byteString . S.pack) bss')
ior <- newIORef []
toByteStringIOWith 16
- (\s -> do s' <- S.useAsCStringLen s
S.unsafePackCStringLen
- modifyIORef ior (s' :))
+ (\s -> do let s' = S.copy s
+ s' `seq` modifyIORef ior (s' :))
bss
chunks <- readIORef ior
- L.fromChunks (reverse chunks) `shouldBe` B.toLazyByteString bss
+ let have = L.unpack (L.fromChunks (reverse chunks))
+ want = L.unpack (B.toLazyByteString bss)
+ (i, have) `shouldBe` (i, want)
+
+ prop "toByteStringIO idempotent to toLazyByteString" (prop_idempotent
(0::Int))
+
+ it "toByteStringIO idempotent to toLazyBytestring, specific case" $ do
+ let bss' = replicate 10 [0..255]
+ mapM_ (\i -> prop_idempotent i bss') [(1::Int)..100]