summaryrefslogtreecommitdiff
blob: 46df1062e0e4700746eea1bffbc5365c9f652210 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 88360d515a06ef08fd3e16f462fe0a869b55ca1d Mon Sep 17 00:00:00 2001
From: Sergey Potapov <potapov.s.a@gmail.com>
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