Review Request 125974: Make KTar KCompressionDevice-friendly

David Faure faure at kde.org
Wed Nov 25 16:08:17 UTC 2015


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

and /usr/include/zlib.h says
 z_const Bytef *next_in;  

That's zlib-devel-1.2.8, what's your zlib version?
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



More information about the Kde-frameworks-devel mailing list