Module: kamailio
Branch: master
Commit: 21f437840123471daa65da65999ff108ad11b33b
URL:
https://github.com/kamailio/kamailio/commit/21f437840123471daa65da65999ff10…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2015-05-21T22:08:25+02:00
db_berkeley: clean gcc warnings
pg_cmd.c:183:17: warning: variable âpcmdâ set but not used
[-Wunused-but-set-variable]
pg_cmd.c:372:17: warning: variable âpcmdâ set but not used
[-Wunused-but-set-variable]
pg_cmd.c:396:17: warning: variable âpcmdâ set but not used
[-Wunused-but-set-variable]
bdb_cmd.c:512:13: warning: variable âbconâ set but not used
[-Wunused-but-set-variable]
bdb_cmd.c:511:13: warning: variable âbresâ set but not used
[-Wunused-but-set-variable]
bdb_con.c:52:13: warning: variable âburiâ set but not used
[-Wunused-but-set-variable]
km_bdb_res.c:405:2: warning: enumeration value âDB1_UNKNOWNâ not handled in switch
[-Wswitch]
km_bdb_res.c:498:2: warning: enumeration value âDB1_UNKNOWNâ not handled in switch
[-Wswitch]
km_bdb_val.c:105:2: warning: enumeration value âDB1_UNKNOWNâ not handled in switch
[-Wswitch]
km_db_berkeley.c:779:6: warning: variable âiâ set but not used
[-Wunused-but-set-variable]
km_db_berkeley.c:907:6: warning: variable âiâ set but not used
[-Wunused-but-set-variable]
---
Modified: modules/db_berkeley/bdb_cmd.c
Modified: modules/db_berkeley/bdb_con.c
Modified: modules/db_berkeley/km_bdb_res.c
Modified: modules/db_berkeley/km_bdb_val.c
Modified: modules/db_berkeley/km_db_berkeley.c
---
Diff:
https://github.com/kamailio/kamailio/commit/21f437840123471daa65da65999ff10…
Patch:
https://github.com/kamailio/kamailio/commit/21f437840123471daa65da65999ff10…
---
diff --git a/modules/db_berkeley/bdb_cmd.c b/modules/db_berkeley/bdb_cmd.c
index a53d5e9..682d4e3 100644
--- a/modules/db_berkeley/bdb_cmd.c
+++ b/modules/db_berkeley/bdb_cmd.c
@@ -507,17 +507,11 @@ int bdb_cmd_first(db_res_t* res)
int bdb_cmd_next(db_res_t* res)
{
- db_con_t *con;
- bdb_res_t *bres;
- bdb_con_t *bcon;
bdb_cmd_t *bcmd;
DBT key, data;
int ret;
static char dbuf[MAX_ROW_SIZE];
- con = res->cmd->ctx->con[db_payload_idx];
- bres = DB_GET_PAYLOAD(res);
- bcon = DB_GET_PAYLOAD(con);
bcmd = DB_GET_PAYLOAD(res->cmd);
if (bcmd->next_flag == 2 || bcmd->next_flag == -2) return 1;
diff --git a/modules/db_berkeley/bdb_con.c b/modules/db_berkeley/bdb_con.c
index 4e410d6..73b94c6 100644
--- a/modules/db_berkeley/bdb_con.c
+++ b/modules/db_berkeley/bdb_con.c
@@ -49,12 +49,9 @@
*/
static void bdb_con_free(db_con_t* con, bdb_con_t *payload)
{
- bdb_uri_t *buri;
if (!payload)
return;
- buri = DB_GET_PAYLOAD(con->uri);
-
/* Delete the structure only if there are no more references
* to it in the connection pool
*/
diff --git a/modules/db_berkeley/km_bdb_res.c b/modules/db_berkeley/km_bdb_res.c
index 3d46483..44b945a 100644
--- a/modules/db_berkeley/km_bdb_res.c
+++ b/modules/db_berkeley/km_bdb_res.c
@@ -429,6 +429,8 @@ int bdb_is_neq_type(db_type_t _t0, db_type_t _t1)
case DB1_BITMAP:
if (_t0==DB1_INT)
return 0;
+ default:
+ break;
}
return 1;
}
@@ -545,6 +547,8 @@ int bdb_cmp_val(db_val_t* _vp, db_val_t* _v)
case DB1_BITMAP:
return (_vp->val.int_val<_v->val.bitmap_val)?-1:
(_vp->val.int_val>_v->val.bitmap_val)?1:0;
+ default:
+ break;
}
return -2;
}
diff --git a/modules/db_berkeley/km_bdb_val.c b/modules/db_berkeley/km_bdb_val.c
index f77946d..15de46f 100644
--- a/modules/db_berkeley/km_bdb_val.c
+++ b/modules/db_berkeley/km_bdb_val.c
@@ -173,6 +173,8 @@ int bdb_str2val(db_type_t _t, db_val_t* _v, char* _s, int _l)
VAL_TYPE(_v) = DB1_BLOB;
LM_DBG("got blob len %d\n", _l);
return 0;
+ default:
+ break;
}
return -6;
diff --git a/modules/db_berkeley/km_db_berkeley.c b/modules/db_berkeley/km_db_berkeley.c
index 4936bed..9b0806e 100644
--- a/modules/db_berkeley/km_db_berkeley.c
+++ b/modules/db_berkeley/km_db_berkeley.c
@@ -776,13 +776,13 @@ int bdb_delete(db1_con_t* _h, db_key_t* _k, db_op_t* _op, db_val_t*
_v, int _n)
tbl_cache_p _tbc = NULL;
table_p _tp = NULL;
char kbuf[MAX_ROW_SIZE];
- int i, j, ret, klen;
+ int ret, klen;
int *lkey=NULL;
DBT key;
DB *db;
DBC *dbcp;
- i = j = ret = 0;
+ ret = 0;
klen=MAX_ROW_SIZE;
if (_op)
@@ -904,13 +904,13 @@ int _bdb_delete_cursor(db1_con_t* _h, db_key_t* _k, db_op_t* _op,
db_val_t* _v,
db1_res_t* _r = NULL;
char kbuf[MAX_ROW_SIZE];
char dbuf[MAX_ROW_SIZE];
- int i, ret, klen=MAX_ROW_SIZE;
+ int ret, klen=MAX_ROW_SIZE;
DBT key, data;
DB *db;
DBC *dbcp;
int *lkey=NULL;
- i = ret = 0;
+ ret = 0;
if ((!_h) || !CON_TABLE(_h))
return -1;