diff options
author | Paul Marquess <Paul.Marquess@ntlworld.com> | 2009-04-13 08:23:28 -0500 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2009-04-13 08:23:28 -0500 |
commit | c14f59c3c1b4192dd6126638d5f8a7214c2dd445 (patch) | |
tree | 31f8dd94ff36f1d3c49331ae990d15c9ea1fb51c /ext | |
parent | 6e0da8f3ffa51c3bb7795b79ead8b082afb21a52 (diff) | |
download | perl-c14f59c3c1b4192dd6126638d5f8a7214c2dd445.tar.gz |
[PATCH] Compress-Raw-Bzip2 2.018 (was RE: Compress-Raw-Bzip2 fails for g++)
Diffstat (limited to 'ext')
-rw-r--r-- | ext/Compress-Raw-Bzip2/Bzip2.xs | 15 | ||||
-rw-r--r-- | ext/Compress-Raw-Bzip2/Changes | 5 | ||||
-rw-r--r-- | ext/Compress-Raw-Bzip2/README | 4 | ||||
-rw-r--r-- | ext/Compress-Raw-Bzip2/bzip2-src/bzip2recover.c | 4 | ||||
-rw-r--r-- | ext/Compress-Raw-Bzip2/bzip2-src/bzlib.c | 33 | ||||
-rw-r--r-- | ext/Compress-Raw-Bzip2/bzip2-src/decompress.c | 6 | ||||
-rw-r--r-- | ext/Compress-Raw-Bzip2/lib/Compress/Raw/Bzip2.pm | 2 | ||||
-rw-r--r-- | ext/Compress-Raw-Bzip2/t/01bzip2.t | 2 |
8 files changed, 41 insertions, 30 deletions
diff --git a/ext/Compress-Raw-Bzip2/Bzip2.xs b/ext/Compress-Raw-Bzip2/Bzip2.xs index 6dec48d09d..ba13ab20ed 100644 --- a/ext/Compress-Raw-Bzip2/Bzip2.xs +++ b/ext/Compress-Raw-Bzip2/Bzip2.xs @@ -338,6 +338,9 @@ PROTOTYPES: DISABLE INCLUDE: constants.xs BOOT: +#ifndef NO_WRITEABLE_DATA + trace = TRACE_DEFAULT ; +#endif /* Check this version of bzip2 is == 1 */ if (BZ2_bzlibVersion()[0] != '1') croak(COMPRESS_CLASS " needs bzip2 version 1.x, you have %s\n", BZ2_bzlibVersion()) ; @@ -350,8 +353,8 @@ const char * bzlibversion() void -new(class, appendOut=1, blockSize100k=1, workfactor=0, verbosity=0) - const char * class +new(className, appendOut=1, blockSize100k=1, workfactor=0, verbosity=0) + const char * className int appendOut int blockSize100k int workfactor @@ -387,7 +390,7 @@ new(class, appendOut=1, blockSize100k=1, workfactor=0, verbosity=0) err = BZ_MEM_ERROR ; { - SV* obj = sv_setref_pv(sv_newmortal(), class, (void*)s); + SV* obj = sv_setref_pv(sv_newmortal(), className, (void*)s); XPUSHs(obj); } if(0) @@ -405,8 +408,8 @@ new(class, appendOut=1, blockSize100k=1, workfactor=0, verbosity=0) MODULE = Compress::Raw::Bunzip2 PACKAGE = Compress::Raw::Bunzip2 void -new(class, appendOut=1 , consume=1, small=0, verbosity=0) - const char* class +new(className, appendOut=1 , consume=1, small=0, verbosity=0) + const char* className int appendOut int consume int small @@ -440,7 +443,7 @@ new(class, appendOut=1 , consume=1, small=0, verbosity=0) err = BZ_MEM_ERROR ; { - SV* obj = sv_setref_pv(sv_newmortal(), class, (void*)s); + SV* obj = sv_setref_pv(sv_newmortal(), className, (void*)s); XPUSHs(obj); } if (0) diff --git a/ext/Compress-Raw-Bzip2/Changes b/ext/Compress-Raw-Bzip2/Changes index 928bfcdf67..944eaaaac8 100644 --- a/ext/Compress-Raw-Bzip2/Changes +++ b/ext/Compress-Raw-Bzip2/Changes @@ -1,6 +1,11 @@ CHANGES ------- + 2.018 11 April 2009 + + * Changes to bzip2 source to get the module to build using a C++ + compiler + 2.017 28 March 2009 * Minor changes to allow building in perl core. diff --git a/ext/Compress-Raw-Bzip2/README b/ext/Compress-Raw-Bzip2/README index 559e5c148a..9e70cd7e22 100644 --- a/ext/Compress-Raw-Bzip2/README +++ b/ext/Compress-Raw-Bzip2/README @@ -1,9 +1,9 @@ Compress-Raw-Bzip2 - Version 2.017 + Version 2.018 - 28th March 2009 + 11th April 2009 Copyright (c) 2005-2009 Paul Marquess. All rights reserved. This program is free software; you can redistribute it diff --git a/ext/Compress-Raw-Bzip2/bzip2-src/bzip2recover.c b/ext/Compress-Raw-Bzip2/bzip2-src/bzip2recover.c index 5f6d621809..bdbcd8bfe2 100644 --- a/ext/Compress-Raw-Bzip2/bzip2-src/bzip2recover.c +++ b/ext/Compress-Raw-Bzip2/bzip2-src/bzip2recover.c @@ -153,7 +153,7 @@ typedef /*---------------------------------------------*/ static BitStream* bsOpenReadStream ( FILE* stream ) { - BitStream *bs = malloc ( sizeof(BitStream) ); + BitStream *bs = (BitStream*) malloc ( sizeof(BitStream) ); if (bs == NULL) mallocFail ( sizeof(BitStream) ); bs->handle = stream; bs->buffer = 0; @@ -166,7 +166,7 @@ static BitStream* bsOpenReadStream ( FILE* stream ) /*---------------------------------------------*/ static BitStream* bsOpenWriteStream ( FILE* stream ) { - BitStream *bs = malloc ( sizeof(BitStream) ); + BitStream *bs = (BitStream*) malloc ( sizeof(BitStream) ); if (bs == NULL) mallocFail ( sizeof(BitStream) ); bs->handle = stream; bs->buffer = 0; diff --git a/ext/Compress-Raw-Bzip2/bzip2-src/bzlib.c b/ext/Compress-Raw-Bzip2/bzip2-src/bzlib.c index ef86c91e69..facd2b8458 100644 --- a/ext/Compress-Raw-Bzip2/bzip2-src/bzlib.c +++ b/ext/Compress-Raw-Bzip2/bzip2-src/bzlib.c @@ -165,7 +165,7 @@ int BZ_API(BZ2_bzCompressInit) if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; if (strm->bzfree == NULL) strm->bzfree = default_bzfree; - s = BZALLOC( sizeof(EState) ); + s = (EState*) BZALLOC( sizeof(EState) ); if (s == NULL) return BZ_MEM_ERROR; s->strm = strm; @@ -174,9 +174,9 @@ int BZ_API(BZ2_bzCompressInit) s->ftab = NULL; n = 100000 * blockSize100k; - s->arr1 = BZALLOC( n * sizeof(UInt32) ); - s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) ); - s->ftab = BZALLOC( 65537 * sizeof(UInt32) ); + s->arr1 = (UInt32*) BZALLOC( n * sizeof(UInt32) ); + s->arr2 = (UInt32*) BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) ); + s->ftab = (UInt32*) BZALLOC( 65537 * sizeof(UInt32) ); if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) { if (s->arr1 != NULL) BZFREE(s->arr1); @@ -362,7 +362,7 @@ Bool handle_compress ( bz_stream* strm ) { Bool progress_in = False; Bool progress_out = False; - EState* s = strm->state; + EState* s = (EState*) strm->state; while (True) { @@ -409,7 +409,7 @@ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) Bool progress; EState* s; if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; + s = (EState*) strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; @@ -469,7 +469,7 @@ int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) { EState* s; if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; + s = (EState*) strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; @@ -505,7 +505,7 @@ int BZ_API(BZ2_bzDecompressInit) if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; if (strm->bzfree == NULL) strm->bzfree = default_bzfree; - s = BZALLOC( sizeof(DState) ); + s = (DState*) BZALLOC( sizeof(DState) ); if (s == NULL) return BZ_MEM_ERROR; s->strm = strm; strm->state = s; @@ -684,7 +684,10 @@ Bool unRLE_obuf_to_output_FAST ( DState* s ) /*---------------------------------------------------*/ -__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab ) +#ifndef __cplusplus +__inline__ +#endif +Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab ) { Int32 nb, na, mid; nb = 0; @@ -810,7 +813,7 @@ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm ) Bool corrupt; DState* s; if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; + s = (DState*) strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; @@ -863,7 +866,7 @@ int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ) { DState* s; if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; + s = (DState*) strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; @@ -934,7 +937,7 @@ BZFILE* BZ_API(BZ2_bzWriteOpen) if (ferror(f)) { BZ_SETERR(BZ_IO_ERROR); return NULL; }; - bzf = malloc ( sizeof(bzFile) ); + bzf = (bzFile*) malloc ( sizeof(bzFile) ); if (bzf == NULL) { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; @@ -982,7 +985,7 @@ void BZ_API(BZ2_bzWrite) { BZ_SETERR(BZ_OK); return; }; bzf->strm.avail_in = len; - bzf->strm.next_in = buf; + bzf->strm.next_in = (char*)buf; while (True) { bzf->strm.avail_out = BZ_MAX_UNUSED; @@ -1107,7 +1110,7 @@ BZFILE* BZ_API(BZ2_bzReadOpen) if (ferror(f)) { BZ_SETERR(BZ_IO_ERROR); return NULL; }; - bzf = malloc ( sizeof(bzFile) ); + bzf = (bzFile*) malloc ( sizeof(bzFile) ); if (bzf == NULL) { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; @@ -1179,7 +1182,7 @@ int BZ_API(BZ2_bzRead) { BZ_SETERR(BZ_OK); return 0; }; bzf->strm.avail_out = len; - bzf->strm.next_out = buf; + bzf->strm.next_out = (char*) buf; while (True) { diff --git a/ext/Compress-Raw-Bzip2/bzip2-src/decompress.c b/ext/Compress-Raw-Bzip2/bzip2-src/decompress.c index bba5e0fa36..97cfb70059 100644 --- a/ext/Compress-Raw-Bzip2/bzip2-src/decompress.c +++ b/ext/Compress-Raw-Bzip2/bzip2-src/decompress.c @@ -209,13 +209,13 @@ Int32 BZ2_decompress ( DState* s ) s->blockSize100k -= BZ_HDR_0; if (s->smallDecompress) { - s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) ); - s->ll4 = BZALLOC( + s->ll16 = (UInt16*) BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) ); + s->ll4 = (UChar*) BZALLOC( ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) ); if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR); } else { - s->tt = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) ); + s->tt = (UInt32*) BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) ); if (s->tt == NULL) RETURN(BZ_MEM_ERROR); } diff --git a/ext/Compress-Raw-Bzip2/lib/Compress/Raw/Bzip2.pm b/ext/Compress-Raw-Bzip2/lib/Compress/Raw/Bzip2.pm index 3b4615276b..fabaa2a9b1 100644 --- a/ext/Compress-Raw-Bzip2/lib/Compress/Raw/Bzip2.pm +++ b/ext/Compress-Raw-Bzip2/lib/Compress/Raw/Bzip2.pm @@ -12,7 +12,7 @@ use Carp ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD); -$VERSION = '2.017'; +$VERSION = '2.018'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; diff --git a/ext/Compress-Raw-Bzip2/t/01bzip2.t b/ext/Compress-Raw-Bzip2/t/01bzip2.t index 407d16aa8c..008c0b3492 100644 --- a/ext/Compress-Raw-Bzip2/t/01bzip2.t +++ b/ext/Compress-Raw-Bzip2/t/01bzip2.t @@ -80,7 +80,7 @@ my $len = length $hello ; title "Error Cases" ; eval { new Compress::Raw::Bzip2(1,2,3,4,5,6) }; - like $@, mkErr "Usage: Compress::Raw::Bzip2::new(class, appendOut=1, blockSize100k=1, workfactor=0, verbosity=0)"; + like $@, mkErr "Usage: Compress::Raw::Bzip2::new(className, appendOut=1, blockSize100k=1, workfactor=0, verbosity=0)"; } |