mirror of
https://github.com/wangyu-/UDPspeeder.git
synced 2025-11-26 22:55:37 +08:00
Merge bf30a9af8f into 3ac5e6b40d
This commit is contained in:
@@ -24,7 +24,7 @@ set(SOURCE_FILES
|
||||
tunnel_server.cpp
|
||||
my_ev.cpp
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -O2 -g -fsanitize=address,undefined")
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -O2 -g -fsanitize=address,undefined -fno-sanitize=shift")
|
||||
|
||||
#target_include_directories(speederv2 PRIVATE .)
|
||||
#set(CMAKE_LINK_LIBRARY_FLAG "-lrt")
|
||||
|
||||
@@ -896,7 +896,7 @@ u32_t djb2(unsigned char *str, int len) {
|
||||
u32_t hash = 5381;
|
||||
int c;
|
||||
int i = 0;
|
||||
while (c = *str++, i++ != len) {
|
||||
while (c = *str++, ++i != len) {
|
||||
hash = ((hash << 5) + hash) ^ c; /* (hash * 33) ^ c */
|
||||
}
|
||||
|
||||
@@ -908,7 +908,7 @@ u32_t sdbm(unsigned char *str, int len) {
|
||||
u32_t hash = 0;
|
||||
int c;
|
||||
int i = 0;
|
||||
while (c = *str++, i++ != len) {
|
||||
while (c = *str++, ++i != len) {
|
||||
hash = c + (hash << 6) + (hash << 16) - hash;
|
||||
}
|
||||
// hash=htonl(hash);
|
||||
|
||||
Reference in New Issue
Block a user