[sr-dev] git:master:6e376ee2: db_berkeley: fix compilation warning

Victor Seva linuxmaniac at torreviejawireless.org
Tue Jun 7 12:19:47 CEST 2016


Module: kamailio
Branch: master
Commit: 6e376ee273cb95afae31b0183e3b7bf3468c4520
URL: https://github.com/kamailio/kamailio/commit/6e376ee273cb95afae31b0183e3b7bf3468c4520

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2016-06-06T12:05:39+02:00

db_berkeley: fix compilation warning

> km_db_berkeley.c:486:58: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
>                 if ((ret = bdb_get_columns(_tbc->dtp, *_r, lres, _nc)) < 0)
>                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
> km_db_berkeley.c:513:50: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
>                         if ((ret=bdb_append_row( *_r, dbuf, lres, i)) < 0)
>                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
> km_db_berkeley.c:567:58: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
>                 if ((ret = bdb_get_columns(_tbc->dtp, *_r, lres, _nc)) < 0)
>                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
> km_db_berkeley.c:572:47: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
>                 if ((ret=bdb_convert_row( *_r, dbuf, lres)) < 0)
>                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
> 4 warnings generated.

---

Modified: modules/db_berkeley/km_db_berkeley.c

---

Diff:  https://github.com/kamailio/kamailio/commit/6e376ee273cb95afae31b0183e3b7bf3468c4520.diff
Patch: https://github.com/kamailio/kamailio/commit/6e376ee273cb95afae31b0183e3b7bf3468c4520.patch

---

diff --git a/modules/db_berkeley/km_db_berkeley.c b/modules/db_berkeley/km_db_berkeley.c
index 9b0806e..e7e05f5 100644
--- a/modules/db_berkeley/km_db_berkeley.c
+++ b/modules/db_berkeley/km_db_berkeley.c
@@ -362,9 +362,10 @@ int km_bdb_query(db1_con_t* _con, db_key_t* _k, db_op_t* _op, db_val_t* _v,
 	table_p _tp = NULL;
 	char kbuf[MAX_ROW_SIZE];
 	char dbuf[MAX_ROW_SIZE];
-	u_int32_t i, len, ret; 
+	u_int32_t i, len;
 	int klen=MAX_ROW_SIZE;
 	int *lkey=NULL, *lres=NULL;
+	int ret;
 	DBT key, data;
 	DB *db;
 	DBC *dbcp;




More information about the sr-dev mailing list