From: Krisztian Litkey Date: Thu, 29 Nov 2012 12:43:29 +0000 (+0200) Subject: lua-decision: get rid of uninitialized usage warning. X-Git-Tag: accepted/2.0alpha/20121203.182640~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04acf33b6f51c58fc63d4c1a07bae5f95f88ae06;p=profile%2Fivi%2Fmurphy.git lua-decision: get rid of uninitialized usage warning. --- diff --git a/src/core/lua-decision/mdb.c b/src/core/lua-decision/mdb.c index 0c4f972..c05e38d 100644 --- a/src/core/lua-decision/mdb.c +++ b/src/core/lua-decision/mdb.c @@ -672,10 +672,14 @@ static int table_update(lua_State *L) sts = table_row_getvalues(L, tbl, 2, false, desc, values); cond = NULL; - if (!sts) + if (!sts) { luaL_error(L, "update failed: no values"); - else if (narg > 2 && !(cond = condition_check(L, 3, tbl))) + updated = FALSE; /* not reached, avoid uninitialized usage warning */ + } + else if (narg > 2 && !(cond = condition_check(L, 3, tbl))) { luaL_error(L, "update failed: invalid condition"); + updated = FALSE; /* not reached, avoid uninitialized usage warning */ + } else { th = mqi_begin_transaction(); @@ -710,8 +714,10 @@ static int table_delete(lua_State *L) tbl = mrp_lua_table_check(L, 1); cond = NULL; - if (narg > 1 && !(cond = condition_check(L, 2, tbl))) + if (narg > 1 && !(cond = condition_check(L, 2, tbl))) { luaL_error(L, "delete failed: invalid condition"); + deleted = FALSE; /* not reached, avoid uninitialized usage warning */ + } else { th = mqi_begin_transaction();