apple-ouyang / gdelta

A delta compression algorithem better than Xdelta
https://ieeexplore.ieee.org/abstract/document/9229609/
MIT License
8 stars 5 forks source link

3 issues #12

Open Philippe91 opened 1 year ago

Philippe91 commented 1 year ago

1) const static uint8_t lenbits = FLAGLEN;

should be:

const static uint8_t lenbits = (7 - FLAGLEN);

2)

uint64_t remaining_length = unit.length >> DeltaHeadUnit::lenbits;
write_varint(buffer, remaining_length);

should be:

if (uint64_t remaining_length = unit.length >> DeltaHeadUnit::lenbits)
    write_varint(buffer, remaining_length);

3)

#ifdef _WIN32
    output_fd = open(cvalue, O_RDWR | O_TRUNC | O_CREAT);
#else

should be (else eof added!):

#ifdef _WIN32
    output_fd = open(cvalue, O_RDWR | O_TRUNC | O_CREAT | O_BINARY);
#else