| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix #248 by putting `#include "config.h"` in all src/*.c files.
The iwyu tool doesn't handle `config.h` files well, and these includes were
incorrectly removed, which breaks things on some platforms. Add them back to
most `src/*.c` files with `/* IWYU pragma: keep */` to make iwyu ignore them.
We skip `src/hashtable.c` because it is a standalone tool that is platform
independent.
Also add `/* IWYU pragma: keep */` to includes in `src/fileutil.c` that are
needed on some platforms but not others. This means we can remove the special
exemptions to skip this file for the `iwyu` and `iwyu-fix` targets in
`CMakeLists.txt`.
Add some explicit typecasts to `rollsum.[ch]` and `patch.c` to silence warnings on windows.
Update NEWS.md for `config.h` include fixes and added typecasts.
|
|
|
|
|
|
|
|
|
|
|
| |
This was mostly done by piping iwyu_tool output to `fix_include
--noblank_lines` with the exception of hashtable.h and its unittest which
required manual tweaking, plus a few manual tweaks in some places.
For fileutil.c it was excluded and only manually tweaked a tiny bit. It has
conditional includes based on config.h settings which seems to confuse
iwyu_tool and fix_includes to the point where it recommended removing several
of them which wouldn't compile any more.
|
|
|
|
|
| |
The checksum_test.c showed it makes more sense to put the checksum length
constants into checksum.c where they are most useful.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The RabinKarp weaksums are already very well distributed so mix32() is just an
overhead we don't need. However, we still need mix32() for Rollsums.
In sumset.c set HASHTABLE_NMIX32 to turn off mix32() in the hashtable. Instead
apply mix32() in rs_signature_add_block() for Rollsums when they are added
into the signature.
In checksum.h apply mix32() to Rollsum digests in weaksum_digest(). Change
rs_calc_weak_sum() to directly call Rollsum or rabinkarp methods to avoid
switching on kind for each weaksum method, and so that we can avoid having
mix32() applied for Rollsums. Document that rs_calc_weak_sum() does not apply
mix32() but weaksum_digest() does.
|
|
|
|
|
|
|
|
|
|
| |
In checksum.[hc] remove the specific md4 and blake2 strongsum calculators and
replace them with a rs_calc_strong_sum() method that takes the kind as an
argument.
In sumset.h use rs_signature_*_kind() methods to simplify the
rs_signature_calc_strong_sum() and rs_signature_calc_weak_sum() methods, using
the new rs_calc_strong_sum().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In checksum.h add strongsum_kind_t enum for the strongsum kinds.
in sumset.h add rs_signature_weaksum_kind() and rs_signature_strongsum_kind()
to get the sum kinds used by a signature. Improve rs_signature_check() using
bitmasks against magic to validate different pieces.
In job.h change the weak_sum field to be a weaksum_t.
In delta.c use weaksum_*() methods instead of Rollsum*() methods. Use
rs_signature_weaksum_kind() to get and initialize job->weak_sum to the right
kind.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In checksum.[ch] implement a weaksum_t wrapper around Rollsum and RabinKarp
rollsums.
In sumset.[ch] add support for RabinKarp magic's and add
rs_signature_calc_weak_sum() that uses the weaksum_t wrapper to calculate the
right kind of weaksum for the signature magic value.
In mksum.c use rs_signature_calc_weak_sum() to calculate the correct weaksum
type.
Update tests/signature.test to include testing of RabinKarp signature types.
Update tests/sumset_test.c to include testing of new magic types.
Note that although this adds support for generating RabinKarp compatible
signatures, delta calculation doesn't yet use them correctly. It will appear
to work, but will find no matches.
|
| |
|
|
|
|
| |
Multiple runs of tidyc seem to have eventually stabilised to this.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In checksum.c make rs_calc_weak_sum() use the implementation in
rollsum.[hc]. Tidy checksum.h removing now unused RS_CHAR_OFFSET.
In librsync.h change rs_weak_sum_t from "unsigned int" to uint32_t.
In mksum.c use rs_weak_sum_t instead of "unsigned int" as the type of
a calculated weaksum.
|
| |
|
|
|