diff options
author | 2013-05-22 15:43:21 +0000 | |
---|---|---|
committer | 2013-05-22 15:43:21 +0000 | |
commit | 88c9ec968f682ebcc4ec13fe76f4d24d1e05633b (patch) | |
tree | 52449ec354997253aa91ede717ae81afb2183e6b /src/utils/SkLua.cpp | |
parent | 74ce6f046c8c8990172cebcfa830c8e5f5e42a1e (diff) |
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
Diffstat (limited to 'src/utils/SkLua.cpp')
-rw-r--r-- | src/utils/SkLua.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp index dff79eedb0..05da5cb195 100644 --- a/src/utils/SkLua.cpp +++ b/src/utils/SkLua.cpp @@ -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; } |