Skip to content

Commit

Permalink
Merge pull request #81 from Cyan4973/dev
Browse files Browse the repository at this point in the history
fixed minor conversion warnings
  • Loading branch information
Cyan4973 authored Aug 11, 2016
2 parents 4ab17c7 + cb11ac8 commit 88c6ee1
Show file tree
Hide file tree
Showing 5 changed files with 381 additions and 333 deletions.
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ LIBVER_PATCH:=`sed -n '/define XXH_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\
LIBVER := $(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH)

CFLAGS ?= -O3
CFLAGS += -std=c99 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
-Wstrict-prototypes -Wundef -pedantic
-Wstrict-prototypes -Wundef
FLAGS := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(MOREFLAGS)
XXHSUM_VERSION=$(LIBVER)
MD2ROFF = ronn
Expand Down Expand Up @@ -107,7 +107,7 @@ clean-xxhsum-c:

armtest: clean
@echo ---- test ARM compilation ----
$(MAKE) xxhsum CC=arm-linux-gnueabi-gcc MOREFLAGS="-Werror"
$(MAKE) xxhsum CC=arm-linux-gnueabi-gcc MOREFLAGS="-Werror -static"

clangtest: clean
@echo ---- test clang compilation ----
Expand All @@ -117,7 +117,12 @@ gpptest: clean
@echo ---- test g++ compilation ----
$(MAKE) all CC=g++ CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"

sanitize: clean
c90test: clean
@echo ---- test strict C90 compilation [xxh32 only] ----
$(CC) -std=c90 -Werror -pedantic -DXXH_NO_LONG_LONG -c xxhash.c
$(RM) xxhash.o

usan: clean
@echo ---- check undefined behavior - sanitize ----
$(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=undefined"

Expand All @@ -142,7 +147,8 @@ clean-man:
preview-man: clean-man man
man ./xxhsum.1

test-all: clean all namespaceTest test test32 test-xxhsum-c clean-xxhsum-c armtest clangtest gpptest sanitize staticAnalyze
test-all: clean all namespaceTest test test32 test-xxhsum-c clean-xxhsum-c \
armtest clangtest gpptest c90test usan staticAnalyze

clean: clean-xxhsum-c
@$(RM) -f core *.o xxhsum$(EXT) xxhsum32$(EXT) xxhsum_inlinedXXH$(EXT) xxh32sum xxh64sum
Expand Down
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ xxHash - Extremely fast hash algorithm
======================================

xxHash is an Extremely fast Hash algorithm, running at RAM speed limits.
It successfully completes the [SMHasher](http://code.google.com/p/smhasher/wiki/SMHasher) test suite
It successfully completes the [SMHasher](http://code.google.com/p/smhasher/wiki/SMHasher) test suite
which evaluates collision, dispersion and randomness qualities of hash functions.
Code is highly portable, and hashes are identical on all platforms (little / big endian).

|Branch |Status |
|------------|---------|
Expand Down Expand Up @@ -38,8 +39,8 @@ It depends on successfully passing SMHasher test set.
10 is a perfect score.
Algorithms with a score < 5 are not listed on this table.

A new version, XXH64, has been created thanks to [Mathias Westerdahl]'s contribution,
which offers superior speed and dispersion for 64-bits systems.
A new version, XXH64, has been created thanks to [Mathias Westerdahl]'s contribution,
which offers superior speed and dispersion for 64-bits systems.
Note however that 32-bits applications will still run faster using the 32-bits version.
[Mathias Westerdahl]: https://github.com/JCash

Expand All @@ -60,6 +61,28 @@ The library files `xxhash.c` and `xxhash.h` are BSD licensed.
The utility `xxhsum` is GPL licensed.


### Build modifiers

The following macros influence xxhash behavior. They are all disabled by default.

- `XXH_FORCE_NATIVE_FORMAT` : on big-endian systems : use native number representation,
resulting in system-specific results.
Breaks consistency with little-endian results.
- `XXH_ACCEPT_NULL_INPUT_POINTER` : if presented with a null-pointer,
xxhash result is the same as a null-length key,
instead of a dereference segfault.
- `XXH_NO_LONG_LONG` : removes support for XXH64,
useful for targets without 64-bits support.
- `XXH_STATIC_LINKING_ONLY` : gives access to state definition for static allocation.
Incompatible with dynamic linking, due to risks of ABI changes.
- `XXH_PRIVATE_API` : Make all functions `static` and accessible through `xxhash.h` for inlining.
Do not compile `xxhash.c` as a separate module in this case.
- `XXH_NAMESPACE` : prefix all symbols with the value of `XXH_NAMESPACE`,
in order to evade symbol naming collisions,
in case of multiple inclusions of xxHash library
(typically via intermediate libraries).


### Other languages

Beyond the C reference version,
Expand Down
Loading

0 comments on commit 88c6ee1

Please sign in to comment.