]> 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>
Wed, 23 Nov 2022 16:17:15 +0000 (17:17 +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) {
          |                                                  ^

contrib/dlz/modules/sqlite3/dlz_sqlite3_dynamic.c

index 40d18206166a0f6f45f4d6055ea460df386498e8..be6c6d7664879d192dcaaa1f2f7e63862aed00a8 100644 (file)
@@ -75,11 +75,11 @@ typedef struct {
  * SQLite3 result set
  */
 typedef struct {
-       char **pazResult;    /* Result of the query */
-       int pnRow;           /* Number of result rows */
-       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 */
@@ -444,7 +444,7 @@ static char **
 dlz_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++;