fix int -> bool warning

BUG=

Review URL: https://codereview.chromium.org/15737012

git-svn-id: http://skia.googlecode.com/svn/trunk@9243 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2013-05-22 15:43:21 +00:00
parent 74ce6f046c
commit 88c9ec968f

View File

@ -52,6 +52,10 @@ template <typename T> T* get_obj(lua_State* L, int index) {
return (T*)luaL_checkudata(L, index, get_mtname(*obj));
}
static bool lua2bool(lua_State* L, int index) {
return !!lua_toboolean(L, index);
}
///////////////////////////////////////////////////////////////////////////////
static void setfield_string(lua_State* L, const char key[], const char value[]) {
@ -244,7 +248,7 @@ static int lpaint_isAntiAlias(lua_State* L) {
}
static int lpaint_setAntiAlias(lua_State* L) {
get_obj<SkPaint>(L, 1)->setAntiAlias(lua_toboolean(L, 2));
get_obj<SkPaint>(L, 1)->setAntiAlias(lua2bool(L, 2));
return 0;
}