summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosias <me@josias.dev>2022-05-26 12:18:04 -0700
committerJosias <me@josias.dev>2022-05-26 12:18:04 -0700
commite7c300987b206c09a1d533f8bf2c92b3e68689d1 (patch)
treefe81ce30f09a310dc556ab52adabce37e6ca6bc1
parent71b68c1dce67a4686402d72267f49c2ef9420ec9 (diff)
Fix cast warning and add -WerrorHEADmaster
-rw-r--r--Makefile2
-rw-r--r--utils.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d4bc213..871c6e9 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ NAME=jw
PREFIX=~/.local
INSTALL=install
-CFLAGS=-Wall -Wextra -Wshadow -Wcast-align -Wunused -Wpedantic -Wconversion -Wsign-conversion -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wnull-dereference -Wdouble-promotion -Wundef -Wpointer-arith -Wunreachable-code -Wwrite-strings -Winit-self -Wstrict-overflow -Wmaybe-uninitialized
+CFLAGS=-Werror -Wall -Wextra -Wshadow -Wcast-align -Wunused -Wpedantic -Wconversion -Wsign-conversion -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wnull-dereference -Wdouble-promotion -Wundef -Wpointer-arith -Wunreachable-code -Wwrite-strings -Winit-self -Wstrict-overflow -Wmaybe-uninitialized
CFILES=main.c write.c utils.c config.c cache.c search.c notebook.c
OFILES=$(CFILES:.c=.o)
diff --git a/utils.c b/utils.c
index 07fb7d7..e6777c1 100644
--- a/utils.c
+++ b/utils.c
@@ -72,7 +72,7 @@ unsigned long utils_djb2_hash(char *str)
int c;
while ((c = *str++))
- hash = ((hash << 5) + hash) + c;
+ hash = ((hash << 5) + hash) + (size_t)c;
return hash;
}