Commit Graph

109 Commits

Author SHA1 Message Date
Yann Collet
a6c1ff95d9 updated a few links to https 2020-03-02 14:26:49 -08:00
Yann Collet
7e7d65260b make partial bitfield collision tester compatible with 32-bit 2020-02-28 17:41:33 -08:00
easyaspi314 (Devin)
f0627bc321 Add explicit rules for object files to include FLAGS
This fixes the Clang appveyor build.

Now, FLAGS will always be applied to the object files and linker files.
2020-02-14 19:44:30 -05:00
easyaspi314 (Devin)
cac3ca4d5d Implement a safer Unicode test
This new test doesn't use any Unicode in the source files, instead
encoding all UTF-8 and UTF-16 as hex.

The test script will be generated from a C file, in which both a shell
script and a batch script will be generated, as well as the Unicode file
to test.

On Cygwin, MinGW, and MSYS, we will automatically bail from the shell
script to the batch script, as cmd.exe has more reliable Unicode
support, at least on Windows 7 and later.

When the make rule is called, it first checks if `$LANG` contains UTF-8,
defining the (overridable) ENABLE_UNICODE flag. If so, it will skip the
test with a warning.

Also fixed an issue with printf in multiInclude.c causing warnings on
old MinGW versions which expect %I64, and updated the .gitignore.
2020-02-14 19:08:09 -05:00
easyaspi314 (Devin)
dbe2addcc1 Move test-unicode to test-all.
There are some theoretical systems which don't handle Unicode well, and
test is designed to be pretty much universal.

This locks it behind test-all.
2020-02-12 20:58:10 -05:00
easyaspi314 (Devin)
e460437a9d Fix typo 2020-02-12 20:54:13 -05:00
easyaspi314 (Devin)
3593758487 Fix minor typo 2020-02-12 20:46:50 -05:00
easyaspi314 (Devin)
261c28b676 Fix Unicode support on Windows, minor Windows tweaks
- Unicode filenames should now work, with a method that works with
and without Unicode mode on Windows.
   - Added a test in the Makefile
 - Use unbuffered stderr output on Windows, fixes output not updating
immediately on MinGW.
 - Fix some missing $(EXT)s in the Makefile, causing Clang to emit
xxhsum instead of xxhsum.exe on Windows, as well as xxhsum's rule
ignoring $(FLAGS).
2020-02-12 20:37:34 -05:00
Yann Collet
b8d761e5a7 Merge branch 'dev' into inline_all 2020-02-12 14:19:13 -08:00
Yann Collet
160e37d349 Merge branch 'dev' into s390x 2020-02-12 12:12:46 -08:00
Yann Collet
19cd4ffed3 xxhash can be inlined even if it was previously included
Inlining hash functions is generally beneficial for performance.
It becomes extremely beneficial whenever input size is a compile-time constant.

To inline xxhash functions, one just needs to include it this way :

One potential issue is that "xxhash.h" may have already been included previously,
typically as part of another included `*.h` .
In which case, the second `#include` statement will have no effect.

This patch fixes this situation :
now, when XXH_INLINE_ALL is defined, all identifiers are renamed,
in order to avoid name collision and confusion with already included indentifiers.

The renaming process uses XXH_NAMESPACE.
XXH_NAMESPACE must be available (i.e. not already used) for renaming to work.

A test has been added in `tests/` to ensure this scenario works correctly.
2020-02-12 11:43:33 -08:00
Yann Collet
549c24d09a updated man page
so that it better reflects advanced functionalities.
fix #286
Reported by @LEARAX
2019-12-27 15:21:26 -08:00
Yann Collet
8f6e9c92e6 fixed mingw+clang compilation test
which do not work using c90 strict mode,
due to the (incorrect) presence of `inline` keyword
in some standard library's header files.

The previous method was disabling the `inline` keyword,
but this introduces other problems with more complex multi-files project,
such as benchHash, which has been recently added as part of `make test`.

Added a new environment variable to disable the c90 compatibility test :
NO_C90_TEST=true

note : apparently, Appveyor doesn't like comments inside () sub-blocks :(
2019-12-02 17:32:56 -08:00
Yann Collet
d3a76b3a28 attempt to reconcile usan and benchHash 2019-11-04 17:25:42 -08:00
Yann Collet
a642aba0f5 transferred implementation inside xxhash.h
instead of xxhash.c .

This seems preferable for some build systems,
which don't like the `#include "xxhash.c"` statement
when inlining xxhash, as reported by @pdillinger .

Note that `xxhash.c` still exists,
it just includes the implementation and instantiates it.
2019-11-04 16:04:28 -08:00
Yann Collet
8e5fdcbe70 added benchHash compilation to test target 2019-10-11 08:12:25 -07:00
Yann Collet
1ea98d6a38 changed strict-overflow warning to level 2
since it inexplicably complains about `main` since 4e4570f751
2019-10-07 10:56:02 -07:00
Yann Collet
c5f72f87af added guard macro in xxhash.c
since it can be included.
2019-10-07 07:56:42 -07:00
Yann Collet
549fca1204 added capability to control XXH128 hashes
added xxh128sum link
2019-09-28 16:49:11 -07:00
Yann Collet
d5336efe31 fixed extraneous ' ' character
failing `-c` verification test
2019-09-28 14:58:07 -07:00
Yann Collet
f2be00e938 update valgrind test 2019-09-27 19:50:40 -07:00
Yann Collet
e098fffe0a fix #259
fix collisions for xxh128 in 9-16 bytes range
2019-09-27 17:55:33 -07:00
Yann Collet
3649220147 added tests for xxh128sum 2019-09-27 17:50:02 -07:00
Yann Collet
d8551d294d xxhsum -q does not display "Loading" notification
fix #251
2019-09-17 18:08:32 -07:00
Yann Collet
4b7daee000 fixed trailingWhiteSpace
so that it doesn't try (and fail) to analyze binary.version.1
2019-07-25 17:19:58 -07:00
Yann Collet
ea71708285 fixed assert()
control their activity with DEBUGLEVEL=#,
automatically test assert() as part of `make test`
2019-07-25 15:37:46 -07:00
Yann Collet
86ff78af51 static analyzer can be provided as environment variables
not just as `make` override
2019-06-14 13:10:14 -07:00
Yann Collet
2745060950 SCANBUILD can be defined before calling make staticAnalyze 2019-06-14 12:44:15 -07:00
Yann Collet
051308c9ce minor Makefile refactoring 2019-05-03 10:29:39 -07:00
Yann Collet
f083d6ed4a added make help target
fixed minor static analyzer warnings (cppcheck)
2019-05-03 10:14:42 -07:00
Yann Collet
ba14aed723 removed cppcheck from test-all
this test is unreliable:
dubious warning messages,
and results vary depending on version.
2019-03-13 10:42:08 -07:00
Yann Collet
79014872e9 separating ARM tests 2019-03-12 18:27:32 -07:00
Yann Collet
30c8fb59c5 added ARM tests on travis 2019-03-12 12:44:42 -07:00
Yann Collet
feedac5cca updated travis tests
to ensure results consistency across scalar/sse2/avx2 on x64/x86
2019-03-12 11:31:57 -07:00
Yann Collet
ed0dbb8fdd ensure xxhash.c and xxhsum.c are recompiled
when their header change
2019-03-08 23:59:02 -05:00
easyaspi314 (Devin)
97952e9029 Workaround for Clang vectorization bug
Inline assembly fences are the only thing I have found that will
prevent Clang from vectorizing XXH32. I explained it in a lot of
detail.
2019-03-07 17:29:26 -05:00
Yann Collet
cd626c344b Makefile : switch default optimization to -O3
because gcc is pretty bad at vectorization with -O2.

Also : documented the clang problem with XXH32 auto-vectorization
which must be prevented for better performance.
2019-02-27 16:05:20 -08:00
Yann Collet
c6c39030fb ensure warnings are blocking during tests
added -Werror flag to target test-all
2019-02-26 16:49:23 -08:00
Yann Collet
43c10239c9 minor C90 adaptation fixes
added -Wconversion flag
2019-02-26 13:45:56 -08:00
Yann Collet
2ec7fddf1c minor optimization : shared xxhash.o compilation 2018-09-29 23:58:07 -07:00
Yann Collet
7a407f64f9 show script lines during lib compilation 2018-09-29 23:13:01 -07:00
Yann Collet
542430e0ec fixed compilation issues under msys2/mingw64 2018-09-29 23:09:23 -07:00
Yann Collet
79b52d94ba added cppcheck test
to Makefile and transitively to .travis.yml
2018-09-17 13:48:10 -07:00
Yann Collet
fbd68c5f09 updated C++ test 2018-09-17 11:45:49 -07:00
Yann Collet
52a97a1a08 minor Makefile improvements
- more warnings enabled (inspired by zstd list)
- -fPIC is a CFLAGS rather than an LDFLAGS flag
(though it doesn't change the outcome, since everything is compiler in a single command line)
2018-09-17 11:26:39 -07:00
Yann Collet
d4eea23960 removed valgrind
and removed code coverage,
which can only work correctly when compiling only once
(here, we have multiple binaries created)
2018-04-01 19:43:36 -07:00
Yann Collet
63c8575d09 hash lib* instead of xxhsum*
to avoid hashing xxhsum.gcda,
which content change while running xxhsum
2018-04-01 15:57:02 -07:00
Yann Collet
dd43ae2100 usan tests can accept externally defined compiler
using CC=
2018-03-20 12:53:25 -07:00
Yann Collet
d0f432ca7b usan tests warnings will now fail 2018-03-20 12:50:23 -07:00
Yann Collet
fd7ea04f49 make clean : added removal of Mac OS-X specific bin directories 2018-03-20 12:49:13 -07:00