forked from premiere/premiere-libtorrent
make puff const correct instead of const-casting
This commit is contained in:
parent
3664c7c137
commit
a1f59f6cf1
|
@ -29,5 +29,5 @@
|
||||||
|
|
||||||
int puff(unsigned char *dest, /* pointer to destination pointer */
|
int puff(unsigned char *dest, /* pointer to destination pointer */
|
||||||
boost::uint32_t *destlen, /* amount of output space */
|
boost::uint32_t *destlen, /* amount of output space */
|
||||||
unsigned char *source, /* pointer to source data pointer */
|
const unsigned char *source, /* pointer to source data pointer */
|
||||||
boost::uint32_t *sourcelen); /* amount of input available */
|
boost::uint32_t *sourcelen); /* amount of input available */
|
||||||
|
|
|
@ -220,8 +220,7 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = puff(reinterpret_cast<unsigned char*>(&buffer[0]), &destlen
|
ret = puff(reinterpret_cast<unsigned char*>(&buffer[0]), &destlen
|
||||||
, const_cast<unsigned char*>(
|
, reinterpret_cast<const unsigned char*>(in), &srclen);
|
||||||
reinterpret_cast<const unsigned char*>(in)), &srclen);
|
|
||||||
|
|
||||||
// if the destination buffer wasn't large enough, double its
|
// if the destination buffer wasn't large enough, double its
|
||||||
// size and try again. Unless it's already at its max, in which
|
// size and try again. Unless it's already at its max, in which
|
||||||
|
|
|
@ -99,7 +99,7 @@ struct state {
|
||||||
boost::uint32_t outcnt; /* bytes written to out so far */
|
boost::uint32_t outcnt; /* bytes written to out so far */
|
||||||
|
|
||||||
/* input state */
|
/* input state */
|
||||||
unsigned char *in; /* input buffer */
|
const unsigned char *in; /* input buffer */
|
||||||
boost::uint32_t inlen; /* available input at in */
|
boost::uint32_t inlen; /* available input at in */
|
||||||
boost::uint32_t incnt; /* bytes read so far */
|
boost::uint32_t incnt; /* bytes read so far */
|
||||||
int bitbuf; /* bit buffer */
|
int bitbuf; /* bit buffer */
|
||||||
|
@ -748,7 +748,7 @@ local int dynamic(struct state *s)
|
||||||
*/
|
*/
|
||||||
int puff(unsigned char *dest, /* pointer to destination pointer */
|
int puff(unsigned char *dest, /* pointer to destination pointer */
|
||||||
boost::uint32_t *destlen, /* amount of output space */
|
boost::uint32_t *destlen, /* amount of output space */
|
||||||
unsigned char *source, /* pointer to source data pointer */
|
const unsigned char *source, /* pointer to source data pointer */
|
||||||
boost::uint32_t *sourcelen) /* amount of input available */
|
boost::uint32_t *sourcelen) /* amount of input available */
|
||||||
{
|
{
|
||||||
struct state s; /* input/output state */
|
struct state s; /* input/output state */
|
||||||
|
|
Loading…
Reference in New Issue