From 88360d515a06ef08fd3e16f462fe0a869b55ca1d Mon Sep 17 00:00:00 2001 From: Sergey Potapov Date: Mon, 17 Oct 2011 11:54:39 +0000 Subject: Плагин Compress не собирался в Gentoo после обновления системного ZLib. git-svn-id: http://vacuum-im.googlecode.com/svn/trunk@1636 8ee3b2d0-dc07-11de-995a-ab19b33c1a40 --- diff --git a/src/plugins/compress/compression.cpp b/src/plugins/compress/compression.cpp index b59b95d..3ca6bd4 100644 --- a/src/plugins/compress/compression.cpp +++ b/src/plugins/compress/compression.cpp @@ -138,30 +138,20 @@ void Compression::stopZlib() void Compression::processData(QByteArray &AData, bool ADataOut) { - if (AData.size()>0) + if (AData.size() > 0) { - z_streamp zstream; - int (*zfunc) OF((z_streamp strm, int flush)); - if (ADataOut) - { - zstream = &FDefStruc; - zfunc = deflate; - } - else - { - zstream = &FInfStruc; - zfunc = inflate; - } - int ret; int dataPosOut = 0; + + z_streamp zstream = ADataOut ? &FDefStruc : &FInfStruc; zstream->avail_in = AData.size(); zstream->next_in = (Bytef *)(AData.constData()); + do { zstream->avail_out = FOutBuffer.capacity() - dataPosOut; zstream->next_out = (Bytef *)(FOutBuffer.data() + dataPosOut); - ret = zfunc(zstream,Z_SYNC_FLUSH); + ret = ADataOut ? deflate(zstream,Z_SYNC_FLUSH) : inflate(zstream,Z_SYNC_FLUSH); switch (ret) { case Z_OK: -- cgit v0.9.0.2