• Binbin's avatar
    Fix some nonsense came from LGTM (#9962) · 0fb1aa06
    Binbin authored
    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.
    0fb1aa06
quicklist.h 9.31 KB