]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix compilation warnings in dlz_sqlite3_dynamic.c
authorMichal Nowak <mnowak@isc.org>
Mon, 30 May 2022 13:23:45 +0000 (15:23 +0200)
committerMichal Nowak <mnowak@isc.org>
Mon, 5 Dec 2022 15:00:35 +0000 (16:00 +0100)
    dlz_sqlite3_dynamic.c: In function ‘dlz_sqlite3_fetch_row’:
    dlz_sqlite3_dynamic.c:447:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
      447 |                 if (rs->pnRow > 0U && rs->curRow < rs->pnRow) {
          |                               ^
    dlz_sqlite3_dynamic.c:447:50: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
      447 |                 if (rs->pnRow > 0U && rs->curRow < rs->pnRow) {
          |                                                  ^

(cherry picked from commit 60f68dc0d62a87c44c20afbdb8ccdf93bc0826db)

contrib/dlz/modules/sqlite3/dlz_sqlite3_dynamic.c

index 26921ae0a0c05c23187273a9883c41c78dc8a99a..8a920ffd7d9e831fe93b03bb3dcd67c1242a6a60 100644 (file)
@@ -79,11 +79,11 @@ typedef struct {
  * SQLite3 result set
  */
 typedef struct {
-       char **pazResult;      /* Result of the query */
-       unsigned int pnRow;    /* Number of result rows */
-       unsigned int pnColumn; /* Number of result columns */
-       unsigned int curRow;   /* Current row */
-       char *pzErrmsg;        /* Error message */
+       char **pazResult; /* Result of the query */
+       int pnRow;        /* Number of result rows */
+       int pnColumn;     /* Number of result columns */
+       int curRow;       /* Current row */
+       char *pzErrmsg;   /* Error message */
 } sqlite3_res_t;
 
 /* forward references */
@@ -240,8 +240,6 @@ sqlite3_get_resultset(const char *zone, const char *record, const char *client,
        sqlite3_instance_t *db = (sqlite3_instance_t *)dbdata;
        char *querystring = NULL;
        sqlite3_res_t *rs = NULL;
-       unsigned int i = 0;
-       unsigned int j = 0;
        int qres = 0;
 
        if ((query == COUNTZONE && rsp != NULL) ||
@@ -460,7 +458,7 @@ char **
 sqlite3_fetch_row(sqlite3_res_t *rs) {
        char **retval = NULL;
        if (rs != NULL) {
-               if (rs->pnRow > 0U && rs->curRow < rs->pnRow) {
+               if (rs->pnRow > 0 && rs->curRow < rs->pnRow) {
                        int index = (rs->curRow + 1) * rs->pnColumn;
                        retval = &rs->pazResult[index];
                        rs->curRow++;
@@ -501,7 +499,7 @@ sqlite3_process_rs(sqlite3_instance_t *db, dns_sdlzlookup_t *lookup,
        isc_result_t result = ISC_R_NOTFOUND;
        char **row;
        unsigned int fields;
-       unsigned int i, j;
+       unsigned int j;
        char *tmpString;
        char *endp;
        int ttl;