Skip to content

Commit

Permalink
小的说明更新
Browse files Browse the repository at this point in the history
  • Loading branch information
sisong committed Apr 6, 2018
1 parent 66387fa commit 1ab709c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**HDiffPatch**
================
Version 2.3
byte data Diff & Patch C\C++ library.
[![release](https://img.shields.io/badge/release-v2.3-blue.svg)](https://github.com/sisong/HDiffPatch/releases) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sisong/HDiffPatch/blob/master/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg)](https://github.com/sisong/HDiffPatch/pulls)
binary data Diff & Patch C\C++ library.

---
uses:
Expand Down
8 changes: 4 additions & 4 deletions diff_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ void writeFile(const std::vector<TByte>& data,const char* fileName){
int main(int argc, const char * argv[]){
double time0=clock_s();
if (argc!=4) {
std::cout<<"diff command line parameter:\n oldFileName newFileName outDiffFileName\n";
std::cout<<"diff command line parameter:\n oldFileName newFileName outUncompressedDiffFileName\n";
exit(1);
}
const char* oldFileName=argv[1];
const char* newFileName=argv[2];
const char* outDiffFileName=argv[3];
std::cout<<"old:\"" <<oldFileName<< "\"\nnew:\""<<newFileName<<"\"\nout:\""<<outDiffFileName<<"\"\n";
const char* outUncompressedDiffFileName=argv[3];
std::cout<<"old:\"" <<oldFileName<< "\"\nnew:\""<<newFileName<<"\"\nout:\""<<outUncompressedDiffFileName<<"\"\n";

std::vector<TByte> oldData; readFile(oldData,oldFileName);
std::vector<TByte> newData; readFile(newData,newFileName);
Expand Down Expand Up @@ -109,7 +109,7 @@ int main(int argc, const char * argv[]){
oldData0,oldData0+oldDataSize,diffData);
double time2=clock_s();
std::cout<<"diffDataSize: "<<diffData.size()<<"\n";
writeFile(diffData,outDiffFileName);
writeFile(diffData,outUncompressedDiffFileName);
std::cout<<" out diff file ok!\n";
#ifdef _IS_RUN_PATCH_CHECK
if (!check_diff(newData0,newData0+newDataSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
//limit: 255*n*(n+1)/2 + (n+1)(B-1) <= 2^32-1
// => max(n)=5552
// => if (255 to (2^16-1)) then max(n) =360
#define kFNBest (16*22) //<=360
#define kFNBest (16*22) // <=360
#define _adler_append(uint_t,half_bit,BASE,mod,border1, adler,pdata,n){ \
uint_t sum=adler>>half_bit; \
adler&=(((uint_t)1<<half_bit)-1);\
Expand Down
8 changes: 4 additions & 4 deletions patch_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int main(int argc, const char * argv[]){
TByte* temp_cache=0;
#endif
if (argc!=4) {
printf("patch command parameter:\n oldFileName diffFileName outNewFileName\n");
printf("patch command parameter:\n oldFileName uncompressedDiffFileName outNewFileName\n");
return 1;
}
#ifndef _IS_LOAD_OLD_ALL
Expand All @@ -124,9 +124,9 @@ int main(int argc, const char * argv[]){
TByte buf[9];
hpatch_StreamPos_t savedNewSize=0;
const char* oldFileName=argv[1];
const char* diffFileName=argv[2];
const char* uncompressedDiffFileName=argv[2];
const char* outNewFileName=argv[3];
printf("old :\"%s\"\ndiff:\"%s\"\nout :\"%s\"\n",oldFileName,diffFileName,outNewFileName);
printf("old :\"%s\"\ndiff:\"%s\"\nout :\"%s\"\n",oldFileName,uncompressedDiffFileName,outNewFileName);
#ifdef _IS_LOAD_OLD_ALL
if (!readFileAll(&poldData_mem,&oldDataSize,oldFileName))
_error_return("open read oldFile error!");
Expand All @@ -135,7 +135,7 @@ int main(int argc, const char * argv[]){
if (!TFileStreamInput_open(&oldData,oldFileName))
_error_return("open oldFile for read error!");
#endif
if (!TFileStreamInput_open(&diffData,diffFileName))
if (!TFileStreamInput_open(&diffData,uncompressedDiffFileName))
_error_return("open diffFile error!");
//read savedNewSize
if (kNewDataSizeSavedSize>diffData.base.streamSize)
Expand Down

0 comments on commit 1ab709c

Please sign in to comment.