Browse code

db_redis: fix printf type mismatch on size_t

Richard Fuchs authored on 24/11/2019 13:16:37
Showing 1 changed files
... ...
@@ -38,7 +38,7 @@ static void db_redis_dump_reply(redisReply *reply) {
38 38
     } else if (reply->type == REDIS_REPLY_NIL) {
39 39
         LM_DBG("<null>\n");
40 40
     } else if (reply->type == REDIS_REPLY_ARRAY) {
41
-        LM_DBG("printing %lu elements in array reply\n", reply->elements);
41
+        LM_DBG("printing %lu elements in array reply\n", (unsigned long) reply->elements);
42 42
         for(i = 0; i < reply->elements; ++i) {
43 43
             db_redis_dump_reply(reply->element[i]);
44 44
         }
... ...
@@ -850,12 +850,12 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc
850 850
             redisReply *key = keys_list->element[j];
851 851
             if (!key) {
852 852
                 LM_ERR("Invalid null key at cursor result index %lu while scanning table '%.*s'\n",
853
-                        j, match_pattern->len, match_pattern->s);
853
+                        (unsigned long) j, match_pattern->len, match_pattern->s);
854 854
                 goto err;
855 855
             }
856 856
             if (key->type != REDIS_REPLY_STRING) {
857 857
                 LM_ERR("Invalid key type at cursor result index %lu while scanning table '%.*s', expected string\n",
858
-                        j, match_pattern->len, match_pattern->s);
858
+                        (unsigned long) j, match_pattern->len, match_pattern->s);
859 859
                 goto err;
860 860
             }
861 861
             if (db_redis_key_prepend_string(query_keys, key->str, strlen(key->str)) != 0) {
... ...
@@ -897,7 +897,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc
897 897
         db_redis_free_reply(&reply);
898 898
     }
899 899
 
900
-    LM_DBG("got %lu entries by scan\n", i);
900
+    LM_DBG("got %lu entries by scan\n", (unsigned long) i);
901 901
     return 0;
902 902
 
903 903
 err:
... ...
@@ -1364,7 +1364,7 @@ static int db_redis_convert_row(km_redis_con_t *con, db1_res_t* _r, const db_key
1364 1364
             LM_DBG("manually filtering key '%.*s'\n",
1365 1365
                     k->len, k->s);
1366 1366
             if (db_redis_compare_column(k, &v, o, reply->element[col]) != 0) {
1367
-                LM_DBG("column %lu does not match, ignore row\n", col);
1367
+                LM_DBG("column %lu does not match, ignore row\n", (unsigned long) col);
1368 1368
                 return 0;
1369 1369
             }
1370 1370
         }
... ...
@@ -1380,7 +1380,7 @@ static int db_redis_convert_row(km_redis_con_t *con, db1_res_t* _r, const db_key
1380 1380
 
1381 1381
     if (reply->elements - manual_keys_count > RES_COL_N(_r)) {
1382 1382
         LM_ERR("Invalid number of columns at row %d/%d, expecting %d, got %lu\n",
1383
-                RES_NUM_ROWS(_r), RES_ROW_N(_r), RES_COL_N(_r), reply->elements - manual_keys_count);
1383
+                RES_NUM_ROWS(_r), RES_ROW_N(_r), RES_COL_N(_r), (unsigned long) reply->elements - manual_keys_count);
1384 1384
         return -1;
1385 1385
     }
1386 1386
     for (col = manual_keys_count; col < reply->elements; ++col) {
... ...
@@ -1390,7 +1390,7 @@ static int db_redis_convert_row(km_redis_con_t *con, db1_res_t* _r, const db_key
1390 1390
         redisReply *col_val = reply->element[redisidx];
1391 1391
         str *col_name = _c[colidx];
1392 1392
 
1393
-        LM_DBG("converting column #%lu of row #%d", colidx, RES_ROW_N(_r));
1393
+        LM_DBG("converting column #%lu of row #%d", (unsigned long) colidx, RES_ROW_N(_r));
1394 1394
 
1395 1395
         if (col_val->type != REDIS_REPLY_STRING &&
1396 1396
             col_val->type != REDIS_REPLY_NIL) {
... ...
@@ -1736,7 +1736,7 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
1736 1736
                 LM_DBG("manually filtering key '%.*s'\n",
1737 1737
                         k->len, k->s);
1738 1738
                 if (db_redis_compare_column(k, &v, o, reply->element[col]) != 0) {
1739
-                    LM_DBG("column %lu does not match, ignore row\n", col);
1739
+                    LM_DBG("column %lu does not match, ignore row\n", (unsigned long) col);
1740 1740
                     row_match = 0;
1741 1741
                     break;
1742 1742
                 }
... ...
@@ -2043,7 +2043,7 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
2043 2043
                 LM_DBG("manually filtering key '%.*s'\n",
2044 2044
                         k->len, k->s);
2045 2045
                 if (db_redis_compare_column(k, &v, o, reply->element[col]) != 0) {
2046
-                    LM_DBG("column %lu does not match, ignore row\n", col);
2046
+                    LM_DBG("column %lu does not match, ignore row\n", (unsigned long) col);
2047 2047
                     row_match = 0;
2048 2048
                     break;
2049 2049
                 }