Kelson has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/296752 )

Change subject: Revert "Use explicit LZMA_STREAM_INIT initializer, instead of 
memset."
......................................................................


Revert "Use explicit LZMA_STREAM_INIT initializer, instead of memset."

This reverts commit 498539d869bbb9add9e795432520f305523e09bf.

Turns out that the clang compiler doesn't like this form of initializer:
it must be a GCC extension of some kind.  There's nothing technically
wrong with the previous `memset` way of initializing the variable,
it just looks kind of gross.  But functionality trumps aesthetics.

Change-Id: I1d5a12c6eb40706023f81323c04a356da3356f42
---
M zimlib/src/lzmastream.cpp
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Kelson: Verified; Looks good to me, approved



diff --git a/zimlib/src/lzmastream.cpp b/zimlib/src/lzmastream.cpp
index bd02bd8..d880933 100644
--- a/zimlib/src/lzmastream.cpp
+++ b/zimlib/src/lzmastream.cpp
@@ -58,10 +58,11 @@
   }
 
   LzmaStreamBuf::LzmaStreamBuf(std::streambuf* sink_, uint32_t preset, 
lzma_check check, unsigned bufsize_)
-    : stream(LZMA_STREAM_INIT),
-      obuffer(bufsize_),
+    : obuffer(bufsize_),
       sink(sink_)
   {
+    std::memset(reinterpret_cast<void*>(&stream), 0, sizeof(stream));
+
     checkError(
       ::lzma_easy_encoder(&stream, preset, check));
 

-- 
To view, visit https://gerrit.wikimedia.org/r/296752
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1d5a12c6eb40706023f81323c04a356da3356f42
Gerrit-PatchSet: 1
Gerrit-Project: openzim
Gerrit-Branch: master
Gerrit-Owner: C. Scott Ananian <canan...@wikimedia.org>
Gerrit-Reviewer: Kelson <kel...@kiwix.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to