Review Request 125974: Make KTar KCompressionDevice-friendly
Luiz Romário Santana Rios
luizromario at gmail.com
Wed Nov 25 17:54:49 UTC 2015
2015-11-25 13:08 GMT-03:00 David Faure <faure at kde.org>:
> On Wednesday 25 November 2015 12:21:11 Luiz Romário Santana Rios wrote:
>>
>> Btw, the commit 0f0230f7d2feeca7ed00072e7b17b24c14f53698 ("Fix clang
>> warnings") makes the compilation fail in my machine. In the
>> KGzipFilter::setInBuffer() method, you change a C-cast to (Bytef *) to
>> a reinterpret_cast<const Bytef *>, but you're attributing it to
>> d->zStream.next_in, which is a char *. To make it work, I had to
>> change it to const_cast<Bytef *>(reinterpret_cast<const Bytef
>> *>(data)). Is there a better way to do this.
>
> d->zStream.next_in is not a char * when ZLIB_CONST is defined.
>
> My /usr/include/zconf.h says
>
> #if defined(ZLIB_CONST) && !defined(z_const)
> # define z_const const
> #else
> # define z_const
> #endif
Mine doesn't define anything like that.
>
> and /usr/include/zlib.h says
> z_const Bytef *next_in;
Mine says:
typedef struct z_stream_s {
Bytef *next_in; /* next input byte */
>
> That's zlib-devel-1.2.8, what's your zlib version?
Mine is 1.2.3.4.
> I saw other projects defining ZLIB_CONST when googling so I assumed
> it had been there for a very very long time, but maybe I'm wrong about that.
> In that case I'll revert that const stuff indeed.
>
> --
> David Faure, faure at kde.org, http://www.davidfaure.fr
> Working on KDE Frameworks 5
>
--
Luiz Romário Santana Rios
More information about the Kde-frameworks-devel
mailing list