summaryrefslogtreecommitdiff
path: root/src/quicklist.h
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2021-12-19 23:52:23 +0800
committerGitHub <noreply@github.com>2021-12-19 17:52:23 +0200
commit0fb1aa0645fd1e31d12c8d57d4326ded0aa4d555 (patch)
treea997d5739941b6036dc21fa57d489c273148669a /src/quicklist.h
parent6add1b7217458dab90b2458e4bac3fa9a2c15e1b (diff)
downloadredis-0fb1aa0645fd1e31d12c8d57d4326ded0aa4d555.tar.gz
Fix some nonsense came from LGTM (#9962)
1. Local variable 's' hides a parameter of the same name. ``` int anetTcpAccept(char *err, int s, char *ip, size_t ip_len, int *port) { if ((fd = anetGenericAccept(err,s,(struct sockaddr*)&sa,&salen)) == ANET_ERR){} } ``` Change the parameter name from `s` to `serversock`, also unified with the header file definition. 2. Comparison is always false because i <= 48. ``` for (i = 0; i < DICT_STATS_VECTLEN-1; i++) { // i < 49 (i == DICT_STATS_VECTLEN-1)?">= ":"", // i == 49 } ``` `i == DICT_STATS_VECTLEN-1` always result false, it is a dead code. 3. Empty block without comment. `else if (!strcasecmp(opt,"ch")) {}`, add a comment to avoid warnings. 4. Bit field fill of type int should have explicitly unsigned integral, explicitly signed integral, or enumeration type. Modify `int fill: QL_FILL_BITS;` to `unsigned int fill: QL_FILL_BITS;` 5. The result of this call to reconnectingRedisCommand is not checked for null, but 80% of calls to reconnectingRedisCommand check for null. Just a cleanup job like others.
Diffstat (limited to 'src/quicklist.h')
-rw-r--r--src/quicklist.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quicklist.h b/src/quicklist.h
index 14c53ca4c..04136a733 100644
--- a/src/quicklist.h
+++ b/src/quicklist.h
@@ -107,7 +107,7 @@ typedef struct quicklist {
quicklistNode *tail;
unsigned long count; /* total count of all entries in all listpacks */
unsigned long len; /* number of quicklistNodes */
- int fill : QL_FILL_BITS; /* fill factor for individual nodes */
+ unsigned int fill : QL_FILL_BITS; /* fill factor for individual nodes */
unsigned int compress : QL_COMP_BITS; /* depth of end nodes not to compress;0=off */
unsigned int bookmark_count: QL_BM_BITS;
quicklistBookmark bookmarks[];