This commit is contained in:
Toni
2023-06-19 14:23:23 +08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -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")

View File

@@ -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);