Skip to content

Commit

Permalink
move match_block optimize to HDiffPatch from sfpatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
sisong committed Nov 25, 2021
1 parent de67f7c commit 677b008
Show file tree
Hide file tree
Showing 9 changed files with 499 additions and 15 deletions.
5 changes: 5 additions & 0 deletions builds/codeblocks/HDiffZ.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@
</Unit>
<Unit filename="../../../zstd/lib/decompress/zstd_decompress_block.h" />
<Unit filename="../../../zstd/lib/decompress/zstd_decompress_internal.h" />
<Unit filename="../../bsdiff_wrapper/bsdiff_wrapper.cpp" />
<Unit filename="../../bsdiff_wrapper/bspatch_wrapper.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../compress_parallel.cpp" />
<Unit filename="../../compress_parallel.h" />
<Unit filename="../../dirDiffPatch/dir_diff/dir_diff.cpp" />
Expand Down Expand Up @@ -304,6 +308,7 @@
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../libHDiffPatch/HDiff/diff.cpp" />
<Unit filename="../../libHDiffPatch/HDiff/match_block.cpp" />
<Unit filename="../../libHDiffPatch/HDiff/private_diff/bytes_rle.cpp" />
<Unit filename="../../libHDiffPatch/HDiff/private_diff/compress_detect.cpp" />
<Unit filename="../../libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.c">
Expand Down
3 changes: 3 additions & 0 deletions builds/codeblocks/HPatchZ.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@
<Unit filename="../../../zstd/lib/decompress/zstd_decompress_block.h" />
<Unit filename="../../../zstd/lib/decompress/zstd_decompress_internal.h" />
<Unit filename="../../../zstd/lib/zstd.h" />
<Unit filename="../../bsdiff_wrapper/bspatch_wrapper.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../dirDiffPatch/dir_patch/dir_patch.c">
<Option compilerVar="CC" />
</Unit>
Expand Down
11 changes: 7 additions & 4 deletions builds/vc2019/HDiffZ.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;Z_SOLO;_ChecksumPlugin_md5;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<AdditionalOptions>/wd4819 %(AdditionalOptions)</AdditionalOptions>
<ObjectFileName>$(IntDir)/obj/_/_/_/%(RelativeDir)/</ObjectFileName>
Expand All @@ -122,7 +122,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;Z_SOLO;_ChecksumPlugin_md5;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<AdditionalOptions>/wd4819 %(AdditionalOptions)</AdditionalOptions>
<ObjectFileName>$(IntDir)/obj/_/_/_/%(RelativeDir)/</ObjectFileName>
Expand All @@ -137,7 +137,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;Z_SOLO;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
Expand All @@ -160,7 +160,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;Z_SOLO;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
Expand All @@ -183,6 +183,8 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\libmd5\md5.c" />
<ClCompile Include="..\..\bsdiff_wrapper\bsdiff_wrapper.cpp" />
<ClCompile Include="..\..\bsdiff_wrapper\bspatch_wrapper.c" />
<ClCompile Include="..\..\compress_parallel.cpp" />
<ClCompile Include="..\..\dirDiffPatch\dir_diff\dir_diff.cpp" />
<ClCompile Include="..\..\dirDiffPatch\dir_diff\dir_diff_tools.cpp" />
Expand All @@ -197,6 +199,7 @@
<ClCompile Include="..\..\hdiffz.cpp" />
<ClCompile Include="..\..\hdiffz_import_patch.c" />
<ClCompile Include="..\..\libHDiffPatch\HDiff\diff.cpp" />
<ClCompile Include="..\..\libHDiffPatch\HDiff\match_block.cpp" />
<ClCompile Include="..\..\libHDiffPatch\HDiff\private_diff\bytes_rle.cpp" />
<ClCompile Include="..\..\libHDiffPatch\HDiff\private_diff\compress_detect.cpp" />
<ClCompile Include="..\..\libHDiffPatch\HDiff\private_diff\libdivsufsort\divsufsort.c" />
Expand Down
13 changes: 7 additions & 6 deletions builds/vc2019/HPatchZ.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;Z_SOLO;_ChecksumPlugin_md5;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<AdditionalOptions>/wd4819 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
Expand All @@ -170,7 +170,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;Z_SOLO;_ChecksumPlugin_md5;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<AdditionalOptions>/wd4819 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
Expand All @@ -183,7 +183,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;Z_SOLO;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
Expand All @@ -208,7 +208,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseSFX|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;Z_SOLO;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
Expand All @@ -235,7 +235,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;Z_SOLO;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
Expand All @@ -261,7 +261,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseSFX|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;Z_SOLO;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
Expand All @@ -288,6 +288,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\libmd5\md5.c" />
<ClCompile Include="..\..\bsdiff_wrapper\bspatch_wrapper.c" />
<ClCompile Include="..\..\dirDiffPatch\dir_patch\dir_patch.c" />
<ClCompile Include="..\..\dirDiffPatch\dir_patch\dir_patch_tools.c" />
<ClCompile Include="..\..\dirDiffPatch\dir_patch\new_dir_output.c" />
Expand Down
8 changes: 4 additions & 4 deletions builds/vc2019/zlib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
Expand All @@ -108,7 +108,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
Expand All @@ -123,7 +123,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
Expand All @@ -138,7 +138,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;Z_SOLO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
Expand Down
5 changes: 5 additions & 0 deletions libHDiffPatch/HDiff/diff_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#ifndef HDiff_diff_types_h
#define HDiff_diff_types_h
#include "../HPatch/patch_types.h"
#include <utility> //std::pair
namespace hdiff_private{

template<class TCover>
struct cover_cmp_by_new_t{
Expand All @@ -44,6 +46,9 @@
}
};

typedef std::pair<hpatch_StreamPos_t,hpatch_StreamPos_t> TPairRange;
}

#ifdef __cplusplus
extern "C"
{
Expand Down
Loading

0 comments on commit 677b008

Please sign in to comment.