More fixes to printf format specifier. (#7909)

mostly signed / unsigned mismatches.

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
Co-authored-by: Oran Agra <oran@redislabs.com>
This commit is contained in:
Hanif Ariffin 2020-12-17 03:00:48 -08:00 committed by GitHub
parent 407da77ea4
commit a56cbd3036
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -1135,10 +1135,10 @@ size_t _dictGetStatsHt(char *buf, size_t bufsize, dictht *ht, int tableid) {
/* Generate human readable stats. */ /* Generate human readable stats. */
l += snprintf(buf+l,bufsize-l, l += snprintf(buf+l,bufsize-l,
"Hash table %d stats (%s):\n" "Hash table %d stats (%s):\n"
" table size: %ld\n" " table size: %lu\n"
" number of elements: %ld\n" " number of elements: %lu\n"
" different slots: %ld\n" " different slots: %lu\n"
" max chain length: %ld\n" " max chain length: %lu\n"
" avg chain length (counted): %.02f\n" " avg chain length (counted): %.02f\n"
" avg chain length (computed): %.02f\n" " avg chain length (computed): %.02f\n"
" Chain length distribution:\n", " Chain length distribution:\n",

View File

@ -1892,7 +1892,7 @@ void raxShow(rax *rax) {
/* Used by debugnode() macro to show info about a given node. */ /* Used by debugnode() macro to show info about a given node. */
void raxDebugShowNode(const char *msg, raxNode *n) { void raxDebugShowNode(const char *msg, raxNode *n) {
if (raxDebugMsg == 0) return; if (raxDebugMsg == 0) return;
printf("%s: %p [%.*s] key:%d size:%d children:", printf("%s: %p [%.*s] key:%u size:%u children:",
msg, (void*)n, (int)n->size, (char*)n->data, n->iskey, n->size); msg, (void*)n, (int)n->size, (char*)n->data, n->iskey, n->size);
int numcld = n->iscompr ? 1 : n->size; int numcld = n->iscompr ? 1 : n->size;
raxNode **cldptr = raxNodeLastChildPtr(n) - (numcld-1); raxNode **cldptr = raxNodeLastChildPtr(n) - (numcld-1);

View File

@ -5578,7 +5578,7 @@ static int clusterManagerCommandCreate(int argc, char **argv) {
if (last > CLUSTER_MANAGER_SLOTS || i == (masters_count - 1)) if (last > CLUSTER_MANAGER_SLOTS || i == (masters_count - 1))
last = CLUSTER_MANAGER_SLOTS - 1; last = CLUSTER_MANAGER_SLOTS - 1;
if (last < first) last = first; if (last < first) last = first;
printf("Master[%d] -> Slots %lu - %lu\n", i, first, last); printf("Master[%d] -> Slots %ld - %ld\n", i, first, last);
master->slots_count = 0; master->slots_count = 0;
for (j = first; j <= last; j++) { for (j = first; j <= last; j++) {
master->slots[j] = 1; master->slots[j] = 1;