Skip to content

Commit

Permalink
recode hpatchz printf log, add _getHDiffInfos() & _printHDiffInfos();
Browse files Browse the repository at this point in the history
  • Loading branch information
housisong committed Dec 1, 2023
1 parent b8ffde5 commit 78a3603
Show file tree
Hide file tree
Showing 3 changed files with 225 additions and 156 deletions.
16 changes: 8 additions & 8 deletions builds/vc/HPatchZ.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<AdditionalOptions>/wd4819 %(AdditionalOptions)</AdditionalOptions>
<ObjectFileName>$(IntDir)/obj/_/_/_/%(RelativeDir)/</ObjectFileName>
Expand All @@ -213,7 +213,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<AdditionalOptions>/wd4819 %(AdditionalOptions)</AdditionalOptions>
<ObjectFileName>$(IntDir)/obj/_/_/_/%(RelativeDir)/</ObjectFileName>
Expand All @@ -232,7 +232,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<AdditionalOptions>/wd4819 %(AdditionalOptions)</AdditionalOptions>
<ObjectFileName>$(IntDir)/obj/_/_/_/%(RelativeDir)/</ObjectFileName>
Expand All @@ -251,7 +251,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<AdditionalOptions>/wd4819 %(AdditionalOptions)</AdditionalOptions>
<ObjectFileName>$(IntDir)/obj/_/_/_/%(RelativeDir)/</ObjectFileName>
Expand All @@ -269,7 +269,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
Expand Down Expand Up @@ -299,7 +299,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
Expand Down Expand Up @@ -329,7 +329,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
Expand Down Expand Up @@ -359,7 +359,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_ChecksumPlugin_md5;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAs>Default</CompileAs>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
Expand Down
11 changes: 5 additions & 6 deletions hdiffz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1841,14 +1841,13 @@ struct DirDiffListener:public IDirDiffListener{
virtual void diffRefInfo(size_t oldPathCount,size_t newPathCount,size_t sameFilePairCount,
hpatch_StreamPos_t sameFileSize,size_t refOldFileCount,size_t refNewFileCount,
hpatch_StreamPos_t refOldFileSize,hpatch_StreamPos_t refNewFileSize){
printf("\n");
printf("DirDiff old path count: %" PRIu64 "\n",(hpatch_StreamPos_t)oldPathCount);
printf(" new path count: %" PRIu64 " (fileCount:%" PRIu64 ")\n",
printf(" old path count: %" PRIu64 "\n",(hpatch_StreamPos_t)oldPathCount);
printf(" new path count: %" PRIu64 " (fileCount:%" PRIu64 ")\n",
(hpatch_StreamPos_t)newPathCount,(hpatch_StreamPos_t)(sameFilePairCount+refNewFileCount));
printf(" same file count: %" PRIu64 " (dataSize: %" PRIu64 ")\n",
printf(" same file count: %" PRIu64 " (dataSize: %" PRIu64 ")\n",
(hpatch_StreamPos_t)sameFilePairCount,sameFileSize);
printf(" ref old file count: %" PRIu64 "\n",(hpatch_StreamPos_t)refOldFileCount);
printf(" diff new file count: %" PRIu64 "\n",(hpatch_StreamPos_t)refNewFileCount);
printf(" ref old file count: %" PRIu64 "\n",(hpatch_StreamPos_t)refOldFileCount);
printf(" diff new file count: %" PRIu64 "\n",(hpatch_StreamPos_t)refNewFileCount);
printf("\nrun hdiffz:\n");
printf(" oldRefSize : %" PRIu64 "\n",refOldFileSize);
printf(" newRefSize : %" PRIu64 " (all newSize: %" PRIu64 ")\n",refNewFileSize,refNewFileSize+sameFileSize);
Expand Down

0 comments on commit 78a3603

Please sign in to comment.