Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6578/wxLua/modules/wxluasocket/src
Modified Files:
wxldtarg.cpp wxluasocket_bind.cpp
Log Message:
Use the correct length of the char buffer from wx2lua, not the original wxString.
use better names for the parameters to wxLuaDebuggerServer::Run
Index: wxldtarg.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxldtarg.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** wxldtarg.cpp 26 Mar 2008 05:01:34 -0000 1.46
--- wxldtarg.cpp 26 Mar 2008 05:23:48 -0000 1.47
***************
*** 132,136 ****
wxString buf = luaBuffer.AfterFirst(wxT('\0'));
! int rc = m_wxlState.LuaDoBuffer(wx2lua(buf), buf.Length(),
wx2lua(bufFilename));
--- 132,137 ----
wxString buf = luaBuffer.AfterFirst(wxT('\0'));
! wxLuaCharBuffer char_buf(buf);
! int rc = m_wxlState.LuaDoBuffer(char_buf, char_buf.Length(),
wx2lua(bufFilename));
Index: wxluasocket_bind.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxluasocket_bind.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** wxluasocket_bind.cpp 29 Jan 2008 04:22:54 -0000 1.31
--- wxluasocket_bind.cpp 26 Mar 2008 05:23:48 -0000 1.32
***************
*** 232,246 ****
static int LUACALL wxLua_wxLuaDebuggerServer_Run(lua_State *L);
static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaDebuggerServer_Run[1] = {{ wxLua_wxLuaDebuggerServer_Run, WXLUAMETHOD_METHOD, 3, 3, s_wxluatypeArray_wxLua_wxLuaDebuggerServer_Run }};
! // bool Run(const wxString &file, const wxString &fileName)
static int LUACALL wxLua_wxLuaDebuggerServer_Run(lua_State *L)
{
// const wxString fileName
! const wxString fileName = wxlua_getwxStringtype(L, 3);
! // const wxString file
! const wxString file = wxlua_getwxStringtype(L, 2);
// get this
wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaDebuggerServer);
// call Run
! bool returns = (self->Run(file, fileName));
// push the result flag
lua_pushboolean(L, returns);
--- 232,246 ----
static int LUACALL wxLua_wxLuaDebuggerServer_Run(lua_State *L);
static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaDebuggerServer_Run[1] = {{ wxLua_wxLuaDebuggerServer_Run, WXLUAMETHOD_METHOD, 3, 3, s_wxluatypeArray_wxLua_wxLuaDebuggerServer_Run }};
! // bool Run(const wxString &fileName, const wxString &buffer)
static int LUACALL wxLua_wxLuaDebuggerServer_Run(lua_State *L)
{
+ // const wxString buffer
+ const wxString buffer = wxlua_getwxStringtype(L, 3);
// const wxString fileName
! const wxString fileName = wxlua_getwxStringtype(L, 2);
// get this
wxLuaDebuggerServer * self = (wxLuaDebuggerServer *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaDebuggerServer);
// call Run
! bool returns = (self->Run(fileName, buffer));
// push the result flag
lua_pushboolean(L, returns);
|