Skip to content

Commit 6f77d67

Browse files
committed
Fix gcc warnings
1 parent 45c2ed1 commit 6f77d67

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/async.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,9 @@ static int valkeyGetSubscribeCallback(valkeyAsyncContext *ac, valkeyReply *reply
520520
c->flags &= ~VALKEY_SUBSCRIBED;
521521

522522
/* Move ongoing regular command callbacks. */
523-
valkeyCallback cb;
524-
while (valkeyShiftCallback(&ac->sub.replies, &cb) == VALKEY_OK) {
525-
valkeyPushCallback(&ac->replies, &cb);
523+
valkeyCallback reply_cb;
524+
while (valkeyShiftCallback(&ac->sub.replies, &reply_cb) == VALKEY_OK) {
525+
valkeyPushCallback(&ac->replies, &reply_cb);
526526
}
527527
}
528528
}
@@ -941,9 +941,9 @@ void valkeySsubscribeCallback(struct valkeyAsyncContext *ac, void *reply, void *
941941
}
942942
}
943943

944-
valkeyCallback cb = {0};
945-
valkeyGetSubscribeCallback(ac, reply, &cb);
946-
valkeyRunCallback(ac, &cb, reply);
944+
valkeyCallback sub_cb = {0};
945+
valkeyGetSubscribeCallback(ac, reply, &sub_cb);
946+
valkeyRunCallback(ac, &sub_cb, reply);
947947
vk_free(data->command);
948948
vk_free(privdata);
949949
return;

src/sds.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static inline char sdsReqType(size_t string_size) {
8484
* end of the string. However the string is binary safe and can contain
8585
* \0 characters in the middle, as the length is stored in the sds header. */
8686
sds sdsnewlen(const void *init, size_t initlen) {
87-
void *sh;
87+
void *s_hdr;
8888
sds s;
8989
char type = sdsReqType(initlen);
9090
/* Empty strings are usually created in order to append. Use type 8
@@ -96,12 +96,12 @@ sds sdsnewlen(const void *init, size_t initlen) {
9696

9797
if (hdrlen + initlen + 1 <= initlen)
9898
return NULL; /* Catch size_t overflow */
99-
sh = s_malloc(hdrlen + initlen + 1);
100-
if (sh == NULL)
99+
s_hdr = s_malloc(hdrlen + initlen + 1);
100+
if (s_hdr == NULL)
101101
return NULL;
102102
if (!init)
103-
memset(sh, 0, hdrlen + initlen + 1);
104-
s = (char *)sh + hdrlen;
103+
memset(s_hdr, 0, hdrlen + initlen + 1);
104+
s = (char *)s_hdr + hdrlen;
105105
fp = ((unsigned char *)s) - 1;
106106
switch (type) {
107107
case SDS_TYPE_5: {

0 commit comments

Comments
 (0)