示例#1
0
文件: lstrlib.c 项目: guodawei/lua
static int arith (lua_State *L, int op, const char *mtname) {
  if (tonum(L, 1) && tonum(L, 2))
    lua_arith(L, op);  /* result will be on the top */
  else
    trymt(L, mtname);
  return 1;
}
	void LuaState::Compute(LuaOperation operation) const
	{
		#ifdef NAZARA_DEBUG
		if (operation > LuaOperation_Max)
		{
			NazaraError("Lua operation out of enum");
			return;
		}
		#endif

		lua_arith(m_state, s_operations[operation]);
	}
示例#3
0
void NzLuaInstance::Compute(nzLuaOperation operation)
{
	#ifdef NAZARA_DEBUG
	if (operation > nzLuaOperation_Max)
	{
		NazaraError("Lua operation out of enum");
		return;
	}
	#endif

	lua_arith(m_state, s_operations[operation]);
}