tag: return after warn

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-10 11:31:16 +01:00
parent 2c71245388
commit 9ceb1a59b4
1 changed files with 12 additions and 0 deletions

12
tag.c
View File

@ -405,7 +405,10 @@ luaA_tag_newindex(lua_State *L)
if(l) if(l)
(*tag)->layout = l; (*tag)->layout = l;
else else
{
luaA_warn(L, "unknown layout: %s", buf); luaA_warn(L, "unknown layout: %s", buf);
return 0;
}
break; break;
case A_TK_SELECTED: case A_TK_SELECTED:
if((*tag)->screen != SCREEN_UNDEF) if((*tag)->screen != SCREEN_UNDEF)
@ -416,21 +419,30 @@ luaA_tag_newindex(lua_State *L)
if(d > 0 && d < 1) if(d > 0 && d < 1)
(*tag)->mwfact = d; (*tag)->mwfact = d;
else else
{
luaA_warn(L, "bad value, must be between 0 and 1"); luaA_warn(L, "bad value, must be between 0 and 1");
return 0;
}
break; break;
case A_TK_NMASTER: case A_TK_NMASTER:
i = luaL_checknumber(L, 3); i = luaL_checknumber(L, 3);
if(i >= 0) if(i >= 0)
(*tag)->nmaster = i; (*tag)->nmaster = i;
else else
{
luaA_warn(L, "bad value, must be greater than 0"); luaA_warn(L, "bad value, must be greater than 0");
return 0;
}
break; break;
case A_TK_NCOL: case A_TK_NCOL:
i = luaL_checknumber(L, 3); i = luaL_checknumber(L, 3);
if(i >= 1) if(i >= 1)
(*tag)->ncol = i; (*tag)->ncol = i;
else else
{
luaA_warn(L, "bad value, must be greater than 1"); luaA_warn(L, "bad value, must be greater than 1");
return 0;
}
break; break;
default: default:
return 0; return 0;