diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-01-16 09:31:34 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-01-16 09:31:34 +0000 |
commit | 66690d50556a16c0ce56b7c6b9c12c33d24ed158 (patch) | |
tree | 4d9a77eb4cd6107b2e2d6d88c77b5842558ecf1e /plugins | |
parent | dcf8d6da92c7b0873c50317ea74ddebbe54f5055 (diff) |
MirLua: code optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@16098 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/MirLua/src/m_database.cpp | 16 | ||||
-rw-r--r-- | plugins/MirLua/src/mlua_metatable.h | 3 |
2 files changed, 10 insertions, 9 deletions
diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp index d6b7207cfb..e3c6e811fe 100644 --- a/plugins/MirLua/src/m_database.cpp +++ b/plugins/MirLua/src/m_database.cpp @@ -661,21 +661,23 @@ LUAMOD_API int luaopen_m_database(lua_State *L) luaL_newlib(L, databaseApi);
MT<DBCONTACTWRITESETTING>(L, MT_DBCONTACTWRITESETTING)
+ //.Field(LFUNC(DBCONTACTWRITESETTING, [](DBCONTACTWRITESETTING *p) { return p->szModule; }), "Module", LUA_TSTRINGA)
+ //.Field(LFUNC(DBCONTACTWRITESETTING, [](DBCONTACTWRITESETTING *p) { return p->szSetting; }), "Setting", LUA_TSTRINGA)
.Method(dbcw__index, "__index");
lua_pop(L, 1);
MT<DBEVENTINFO>(L, MT_DBEVENTINFO)
- .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return p->szModule; }), "Module", LUA_TSTRINGA)
- .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return (void*)p->timestamp; }), "Timestamp", LUA_TINTEGER)
- .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return (void*)p->eventType; }), "Type", LUA_TINTEGER)
- .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return (void*)p->flags; }), "Flags", LUA_TINTEGER)
- .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return (void*)p->cbBlob; }), "Length", LUA_TINTEGER)
- .Field(std::function<void*(DBEVENTINFO*)>([](DBEVENTINFO* p) { return p->pBlob; }), "Blob", LUA_TLIGHTUSERDATA);
+ .Field(LFUNC(DBEVENTINFO, [](DBEVENTINFO* p) { return p->szModule; }), "Module", LUA_TSTRINGA)
+ .Field(LFUNC(DBEVENTINFO, [](DBEVENTINFO* p) { return (void*)p->timestamp; }), "Timestamp", LUA_TINTEGER)
+ .Field(LFUNC(DBEVENTINFO, [](DBEVENTINFO* p) { return (void*)p->eventType; }), "Type", LUA_TINTEGER)
+ .Field(LFUNC(DBEVENTINFO, [](DBEVENTINFO* p) { return (void*)p->flags; }), "Flags", LUA_TINTEGER)
+ .Field(LFUNC(DBEVENTINFO, [](DBEVENTINFO* p) { return (void*)p->cbBlob; }), "Length", LUA_TINTEGER)
+ .Field(LFUNC(DBEVENTINFO, [](DBEVENTINFO* p) { return p->pBlob; }), "Blob", LUA_TLIGHTUSERDATA);
lua_pop(L, 1);
MT<CONTACTINFO>(L, "CONTACTINFO")
- .Field(std::function<void*(CONTACTINFO*)>([](CONTACTINFO* p) { return (void*)p->hContact; }), "hContact", LUA_TINTEGER)
+ .Field(LFUNC(CONTACTINFO, [](CONTACTINFO* p) { return (void*)p->hContact; }), "hContact", LUA_TINTEGER)
.Method(ci__index, "__index");
lua_pop(L, 1);
diff --git a/plugins/MirLua/src/mlua_metatable.h b/plugins/MirLua/src/mlua_metatable.h index 3ad1ebb5cf..372f8684a3 100644 --- a/plugins/MirLua/src/mlua_metatable.h +++ b/plugins/MirLua/src/mlua_metatable.h @@ -41,7 +41,6 @@ struct MTField : public MZeroedObject return res;
}
}
-
};
template<typename T>
@@ -100,7 +99,7 @@ private: lua_pushboolean(L, field->GetValue<BOOL>(obj));
break;
case LUA_TINTEGER:
- lua_pushinteger(L, field->GetValue<long>(obj));
+ lua_pushinteger(L, field->GetValue<long long>(obj));
break;
case LUA_TNUMBER:
lua_pushnumber(L, field->GetValue<intptr_t>(obj));
|