Commit Graph

1107 Commits

Author SHA1 Message Date
Yann Collet
cd59de7b58 fix altivec.h redefinition issue
fix #426
2020-07-23 16:37:57 -07:00
Yann Collet
c006eb7fbb
Merge pull request #435 from Cyan4973/xxh3_stable
move validated XXH3 prototypes into stable
2020-07-23 16:17:42 -07:00
Yann Collet
b1c22850f4 move validated XXH3 prototypes into stable 2020-07-23 14:14:59 -07:00
Yann Collet
316683659c
Merge pull request #434 from Cyan4973/xxh3_merge
merge xxh3 implementation within xxhash.h
2020-07-23 11:53:47 -07:00
Yann Collet
2c992d0cc7 merge xxh3 implementation within xxhash.h
xxh3.h is no longer necessary
but remains available,
in case some programs do #include "xxh3.h" directly.

Also : bumped version number to v0.8.0
2020-07-23 10:24:51 -07:00
Yann Collet
68da9a254e
Merge pull request #431 from Cyan4973/explicitStdin
Allow reading stdin in console mode
2020-07-21 23:49:43 -07:00
Yann Collet
76ab5f4d1e fix minor warning
strict C90
2020-07-18 22:32:17 -07:00
Yann Collet
a431a77bc4 added check success message 2020-07-18 22:27:31 -07:00
Yann Collet
820c89cc9f Allow reading stdin in console mode
when `stdin` is requested explicitly,
with `xxhsum -`.

updated man page
2020-07-17 21:20:18 -07:00
Yann Collet
0208d72ea2
Merge pull request #427 from Cyan4973/benchStreamSeed
Improves speed of streaming variant on small inputs
2020-07-17 20:08:24 -07:00
Yann Collet
be9d93ed71
Merge pull request #430 from jaki/improve-arg-parsing
Support '--' to signify end of options
2020-07-14 01:14:26 -07:00
Jason Kim
8c1eff0f25
test: describe tests in empty commit
Don't add tests because it looks like a pain, having to create separate
ones for Unix and Windows systems.  Instead, here are some tests in
text:

- Make sure arguments aren't double-interpreted as file names and
  options:

  ```sh
  touch a
  xxhsum a >x
  xxhsum x --check
  ```

- Interpret `--` as "from now on all arguments are filenames":

  ```sh
  touch a b
  xxhsum -- a b
  xxhsum a -- b # expect "Could not open '--'"
  diff <(./xxhsum |& echo) <(./xxhsum -- |& echo)
  ```

- Support filenames starting with '-':

  ```sh
  touch -- -foo --check
  xxhsum -- -foo
  xxhsum -- --check
  ```
2020-07-14 00:12:04 -07:00
Jason Kim
fac98dab6b style: comment on breaks
Comment on the `break`s that we are skipping parsing the rest of the
arguments so that they are treated strictly as file names.
2020-07-13 23:52:28 -07:00
Jason Kim
b4c092cd75 feat: support dash dash
Support dash dash (`--`) to mark the rest of the arguments as filenames.
Note this special case (an expected limitation):

```sh
touch a
./xxhsum a --
```

```
ef46db3751d8e999  a
Error: Could not open '--': No such file or directory.
```
2020-07-13 23:48:33 -07:00
Jason Kim
ad10c2f9a0 fix: don't interpret options in file list
When parsing arguments, the first non-option is treated as the start of
a list of file names.  However, arguments continue to be parsed, so any
later arguments that look like options will have a dual meaning as an
option and file name.  This is unexpected behavior, and here are two
solutions:

- Treat later option-like arguments as options
- Treat later option-like arguments as file names

Go with the latter solution for now because it is easier.  The former
solution is preferred because it is more flexible and similar to how
`shasum` parses its arguments.
2020-07-13 21:57:39 -07:00
Yann Collet
662b223eef slightly improved streaming speed on small
by reducing memset() even more

note : required re-organizing members order
2020-07-10 23:34:17 -07:00
Yann Collet
186a3dfb61 fix minor c++ cast warning 2020-07-10 23:20:16 -07:00
Yann Collet
18f0991cef do not regenerate secret from seed
when state was already used with the same `seed` previously.
This skips secret generation when `seed` remains constant.

Also : improves streaming speed on small data
thanks to lighter memset() during reset().
2020-07-10 22:11:45 -07:00
Yann Collet
289813fab9 added benchmark tests for streaming with seed 2020-07-10 16:09:02 -07:00
Yann Collet
0a7508e80b
Merge pull request #425 from devpow112/patch-1
Remove uninitialized local variable warning
2020-07-06 23:40:46 -07:00
Yann Collet
96d2649d50
Merge pull request #424 from Cyan4973/skipDir
can skip over directory
2020-07-06 23:39:37 -07:00
Devon Powell
0c3c6c9e85
Remove uninitialized local variable warning
Can generate a `potentially uninitialized local variable 'finalHash' used` warning.
2020-07-06 21:35:33 -04:00
Yann Collet
cf4ac6b6a8 can skip over directory
`xxhsum *` would choke over directory entries.
This is because such a name still `fopen()` correctly,
but then reading its content fails.
This patch detects this situation, and just skip it, with a message.
`xxhsum` will also return an error code 1.
2020-07-06 18:20:07 -07:00
Yann Collet
bf45b4d5b5
Merge pull request #423 from WayneD/allow-multi
Allow multiple hash types per file
2020-07-06 18:00:54 -07:00
Wayne Davison
63cbb8b715 Say "line is" and "lines are". 2020-07-06 14:13:41 -07:00
Wayne Davison
5d6c150401 Don't reject multiple hash types per file; add more xxhsum tests. 2020-07-06 14:10:52 -07:00
Yann Collet
c8a02add24
Merge pull request #422 from WayneD/xxhsum-comments
Fix & improve some comments
2020-07-06 14:08:53 -07:00
Yann Collet
065a1ac693 added --tag check tests 2020-07-06 13:49:44 -07:00
Wayne Davison
62c7912c26 Fix & improve some comments
Also ensure the ParsedLine values are reset before returning an error.
2020-07-06 13:38:50 -07:00
Yann Collet
f2b41dd51e
Merge pull request #420 from WayneD/dev
Add the ability to parse BSD style --check lines.
2020-07-06 12:41:49 -07:00
Yann Collet
28d58ef563
Merge pull request #421 from devpow112/devpow112/remove-duplicate-warning
Remove pre-processor already defined warning
2020-07-05 23:19:33 -07:00
Devon Powell
bca0ce8a2f
Remove pre-processor already defined warning
When including into other source code (especially when using cmake or the like)
the declaration of _CRT_SECURE_NO_WARNINGS in `xxhsum.c` can cause a compiler
warning about already defined pre-processor symbols. Wrap the symbol definition
in a check to see if it's already defined and not try to define it again.
2020-07-05 23:29:50 -04:00
Wayne Davison
7032ced649 Change reverseDigits -> reverseBytes. 2020-07-05 19:25:15 -07:00
Wayne Davison
cfed37c9c3 Also allow --check --little-endian for non-tag. 2020-07-05 18:27:50 -07:00
Wayne Davison
eb13bcf1c9 Handle the --check of a --tag --little-endian output. 2020-07-05 18:18:59 -07:00
Wayne Davison
e37535169e Cast pointer difference to size_t. 2020-07-05 17:09:32 -07:00
Wayne Davison
d6222723bd Declare hash_len as a size_t. 2020-07-05 16:50:34 -07:00
Wayne Davison
213f72ecd3 Reject a too-short line that ends after the first space.
The prior code accepted a --check line that ends after the first space
and returned the filename from the prior line.  The new code rejects the
line as invalid.
2020-07-05 16:46:21 -07:00
Wayne Davison
5ffd33ef3a Add the ability to parse BSD style --check lines. 2020-07-05 15:49:48 -07:00
Yann Collet
26fded0503
Merge pull request #418 from Cyan4973/dispatch_cxx
fixed dispatcher compilation in c++ mode
2020-07-05 01:58:15 -07:00
Yann Collet
56e03e7562
Merge pull request #419 from Cyan4973/welcomeMessage
minor welcome message tweaks
2020-07-05 00:27:38 -07:00
Yann Collet
26b7fdff4c Merge branch 'dev' into dispatch_cxx 2020-07-05 00:26:11 -07:00
Yann Collet
b694f972dd
Merge pull request #417 from Cyan4973/shuffle_avx512
fix _mm512_shuffle_epi32 in c++ mode
2020-07-05 00:22:43 -07:00
Yann Collet
be54f1f793 minor welcome message tweaks
- display binary name without path
- only provide binary name and version by default
- print extended compilation information on benchmark and --version
2020-07-02 17:02:38 -07:00
Yann Collet
9caf801b67 fixed CI test 2020-07-02 16:39:47 -07:00
Yann Collet
e4ecae117c fixed dispatcher compilation in c++ mode 2020-07-02 16:35:52 -07:00
Yann Collet
6379a93461 fix _mm512_shuffle_epi32 in c++ mode
added relevant test in CI
2020-07-02 15:50:49 -07:00
Yann Collet
c77920d92e
Merge pull request #414 from martinetd/defaultalgo
xxh*sum: print correct default algo for symlinked helpers
2020-06-28 00:44:55 -07:00
Yann Collet
f171e87f33
Merge pull request #413 from easyaspi314/wpedantic-hotfix
Fix C99isms in XXH3_initCustomSecret_avx512
2020-06-28 00:40:53 -07:00
Dominique Martinet
3b0668ee52 xxh*sum: print correct default algo for symlinked helpers
Printing xxh128sum's help for example would say default algo is xxh64,
which is not correct. Adjust g_defaultAlgo accordingly as well as the
currently selected algorithm.
2020-06-28 07:21:01 +02:00