Skip to content

Commit

Permalink
db_berkeley: clean gcc warnings
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
linuxmaniac committed May 21, 2015
1 parent 70ad498 commit 21f4378
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
6 changes: 0 additions & 6 deletions modules/db_berkeley/bdb_cmd.c
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions modules/db_berkeley/bdb_con.c
Expand Up @@ -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
*/
Expand Down
4 changes: 4 additions & 0 deletions modules/db_berkeley/km_bdb_res.c
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
2 changes: 2 additions & 0 deletions modules/db_berkeley/km_bdb_val.c
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions modules/db_berkeley/km_db_berkeley.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 21f4378

Please sign in to comment.