Skip to content

Commit f2d35ed

Browse files
committed
Makefile LD_FLAGS, fixes warnings and an ommision
Separates the linker flags in the Makefiles to avoid errors on OSX with clang, as suggested by @neomantra in #5. Resolves a couple of type warnings and fixes and uses a variable as suggested by @neomantra in #6.
1 parent 71affd0 commit f2d35ed

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

rmutil/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ ifndef RM_INCLUDE_DIR
33
RM_INCLUDE_DIR=../
44
endif
55

6-
CFLAGS = -g -fPIC -lc -lm -O3 -std=gnu99 -I$(RM_INCLUDE_DIR) -Wall -Wno-unused-function
6+
CFLAGS = -g -fPIC -O3 -std=gnu99 -I$(RM_INCLUDE_DIR) -Wall -Wno-unused-function
7+
LDFLAGS = -g -lc -lm
78
CC=gcc
89

910
OBJS=util.o strings.o sds.o vector.o heap.o priority_queue.o

src/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ else
1919
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
2020
endif
2121

22-
CFLAGS = -I$(RM_INCLUDE_DIR) -g -fPIC -lc -lm -O3 -std=gnu99
22+
CFLAGS = -I$(RM_INCLUDE_DIR) -g -fPIC -O3 -std=gnu99 -Wall
23+
LDFLAGS = -g -lc -lm
2324
CC=gcc
2425
.SUFFIXES: .c .so .o
2526

src/rxkeys.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int PKeysCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
8787
RedisModule_ReplyWithArray(ctx, REDISMODULE_POSTPONED_ARRAY_LEN);
8888
size_t length = 0;
8989
RedisModuleString *scursor = RedisModule_CreateStringFromLongLong(ctx, 0);
90-
unsigned long long lcursor;
90+
long long lcursor;
9191
do {
9292
RedisModuleCallReply *rep = RedisModule_Call(ctx, "SCAN", "s", scursor);
9393

@@ -139,7 +139,7 @@ int PDelCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
139139

140140
/* Scan the keyspace. */
141141
RedisModuleString *scursor = RedisModule_CreateStringFromLongLong(ctx, 0);
142-
unsigned long long lcursor;
142+
long long lcursor;
143143
unsigned long long deleted = 0;
144144
do {
145145
RedisModuleCallReply *rep = RedisModule_Call(ctx, "SCAN", "s", scursor);
@@ -163,7 +163,7 @@ int PDelCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
163163
while (matched--) {
164164
RedisModuleString *str;
165165
Vector_Get(matches, matched, &str);
166-
(RedisModuleString *)&matches
166+
str = (RedisModuleString *)&matches
167167
->data[matched * sizeof(RedisModuleString *)];
168168
RedisModule_FreeString(ctx, str);
169169
}

0 commit comments

Comments
 (0)