Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1095)

Unified Diff: src/utils/SkLua.cpp

Issue 15737012: fix int -> bool warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkLua.cpp
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index dff79eedb00f0ad14aac055a5ea50a95128ee2c3..05da5cb195de1f883f6660f623c9a2fd15e3adae 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698