Skip to content

Commit

Permalink
try to close some compile warnings; update xcode sets & log;
Browse files Browse the repository at this point in the history
  • Loading branch information
housisong committed Dec 1, 2024
1 parent c7c2897 commit 7ca43da
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 39 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ full changelog at: https://github.com/sisong/HDiffPatch/commits
(hpatchz now default closed libdeflate decompressor)
* add plugin ldefCompressPlugin, pldefCompressPlugin, ldefDecompressPlugin;
### Changed
* released Android libhpatchz.so support Android 15 with 16KB page size;
* released Android libhpatchz.so support Android 15+ with 16KB page size;

## [v4.7.0](https://github.com/sisong/HDiffPatch/tree/v4.7.0) - 2024-07-12
### Added
* cmdline hdiffz support option "-BSD -SD", to create diffFile compatible with another BSDIFF format "ENDSLEY/BSDIFF43", https://github.com/mendsley/bsdiff ; patch support this format from v4.6.7
* cmdline hdiffz support option "-neq"; if opened, hdiffz will refuse to created diffFile when oldData==newData.
* cmdline hdiffz support option "-neq"; if opened, hdiffz will refuse to create diffFile when oldData==newData.
### Fixed
* fixed SFX auto extract logic (SFX executable file is hpatchz file + diffFile)
SFX extract with default option `$selfExtractArchive -f ".\" -X ".\"` when diffFile created by directories;
Expand Down
4 changes: 4 additions & 0 deletions _clock_for_demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef HDiffPatch_clock_h
#define HDiffPatch_clock_h

// #include <time.h>
// static double clock_s(){ return clock()*1.0/CLOCKS_PER_SEC; }
Expand Down Expand Up @@ -53,3 +55,5 @@
return 0;
}
#endif

#endif //HDiffPatch_clock_h
31 changes: 1 addition & 30 deletions builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -653,21 +653,6 @@
ARCHS = arm64;
CODE_SIGN_STYLE = Automatic;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Z7_ST,
ZSTD_STATIC_LINKING_ONLY,
"ZSTD_HAVE_WEAK_SYMBOLS=0",
"ZSTD_TRACE=0",
"ZSTD_DISABLE_ASM=1",
"ZSTDLIB_VISIBLE=",
"ZSTDLIB_HIDDEN=",
"_IS_NEED_DEFAULT_CompressPlugin=0",
_CompressPlugin_zlib,
_CompressPlugin_bz2,
_CompressPlugin_lzma,
_CompressPluginlzma2,
_CompressPlugin_zstd,
_CompressPlugn_7zXZ,
Z7_LZMA_DEC_OPT,
USE_CRC_EMU,
"$(inherited)",
Expand All @@ -684,23 +669,9 @@
ARCHS = arm64;
CODE_SIGN_STYLE = Automatic;
GCC_PREPROCESSOR_DEFINITIONS = (
NDEBUG,
Z7_ST,
ZSTD_STATIC_LINKING_ONLY,
"ZSTD_HAVE_WEAK_SYMBOLS=0",
"ZSTD_TRACE=0",
"ZSTD_DISABLE_ASM=1",
"ZSTDLIB_VISIBLE=",
"ZSTDLIB_HIDDEN=",
"_IS_NEED_DEFAULT_CompressPlugin=0",
_CompressPlugin_zlib,
_CompressPlugin_bz2,
_CompressPlugin_lzma,
_CompressPluginlzma2,
_CompressPlugin_zstd,
_CompressPlugn_7zXZ,
Z7_LZMA_DEC_OPT,
USE_CRC_EMU,
"$(inherited)",
);
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
Expand Down
11 changes: 7 additions & 4 deletions decompress_plugin_demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,16 @@ static void __dec_free(void* _, void* address){
static hpatch_inline int _zlib_is_decompress_finish(const hpatch_TDecompress* decompressPlugin,
hpatch_decompressHandle decompressHandle){
_zlib_TDecompress* self=(_zlib_TDecompress*)decompressHandle;
unsigned char _empty=0;
while (self->code_begin!=self->code_end){ //for end tag code
unsigned char _empty=0;
self->d_stream.next_out = &_empty;
self->d_stream.avail_out=0;
if (!__zlib_do_inflate(self))
if (!__zlib_do_inflate(self)){
self->d_stream.next_out=0;
return hpatch_FALSE;//error;
}
}
self->d_stream.next_out=0;
return (self->code_begin==self->code_end)
&(self->d_stream.avail_in==0)
&(self->d_stream.avail_out==0);
Expand Down Expand Up @@ -382,7 +385,7 @@ static void __dec_free(void* _, void* address){
}
return hpatch_TRUE;
}
static hpatch_BOOL _ldef_swap_to_zlib(_ldef_TDecompress* self,size_t dec_state,
static hpatch_BOOL _ldef_swap_to_zlib(_ldef_TDecompress* self,uint16_t dec_state,
unsigned char* out_part_data,size_t out_part_len){
self->is_swap_to_zlib=hpatch_TRUE;
if (self->d_stream.state==0){
Expand Down Expand Up @@ -540,7 +543,7 @@ static void __dec_free(void* _, void* address){
int is_final_block_ret;
size_t actual_in_nbytes_ret;
size_t actual_out_nbytes_ret;
const size_t dec_state=libdeflate_deflate_decompress_get_state(self->d);
const uint16_t dec_state=libdeflate_deflate_decompress_get_state(self->d);
enum libdeflate_result ret=libdeflate_deflate_decompress_block(self->d,
self->code_buf+self->code_cur,self->code_buf_size-self->code_cur,
self->data_buf,self->data_cur,self->data_buf_size-self->data_cur,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class TDigestMatcher{
size_t getSearchThreadNum()const;
void _search_cover(const hpatch_TStreamInput* newData,hpatch_StreamPos_t newOffset,
hpatch_TOutputCovers* out_covers,unsigned char* pmem,
void* dataLocker=0,void* newDataLocker=0);
void* newDataLocker=0,void* dataLocker=0);
public: //private for multi-thread
void _search_cover_thread(hpatch_TOutputCovers* out_covers,unsigned char* pmem,void* mt_data);
};
Expand Down
2 changes: 1 addition & 1 deletion libHDiffPatch/HPatch/patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ hpatch_BOOL hpatch_packUIntWithTag(TByte** out_code,TByte* out_code_end,
++pcode;
while (codeBuf!=codeEnd) {
--codeEnd;
*pcode=(*codeEnd) | (((codeBuf!=codeEnd)?1:0)<<7);
*pcode=(*codeEnd) | (TByte)(((codeBuf!=codeEnd)?1:0)<<7);
++pcode;
}
*out_code=pcode;
Expand Down
1 change: 1 addition & 0 deletions libParallel/parallel_import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ HLocker locker_new(void){
int rt=pthread_mutex_init(self, 0);
if (rt!=0){
delete self;
self=0;
_check_pthread(rt,"pthread_mutex_init");
}
return self;
Expand Down
2 changes: 1 addition & 1 deletion test/testHashClash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void test(const TByte* data,const TByte* data_end){
maps[m].reserve(kMaxMapNodeSize*3/clip_count);
unsigned int rand_seed=7;
_srand(rand_seed);
if (kTestMask!=(TUInt)~(TUInt)0) printf("mask[%08X %08X] ",(int)((uint64_t)kTestMask>>32),(int)kTestMask);
if (kTestMask!=(TUInt)~(TUInt)0) printf("mask[%08X %08X] ",(int)(((uint64_t)kTestMask)>>32),(int)kTestMask);
printf("%s%s ",THash::name(),std::string(12-strlen(THash::name()),' ').c_str());

uint64_t curClashMin=0;
Expand Down

0 comments on commit 7ca43da

Please sign in to comment.