From: John L. <jr...@us...> - 2007-11-08 23:47:18
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10188/wxLua/modules/wxluasocket/src Modified Files: wxlsock.cpp Log Message: Add storage for key and value datatype in wxLuaDebugItem and show it in the stack dialog Index: wxlsock.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxlsock.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** wxlsock.cpp 26 Jul 2007 18:56:40 -0000 1.31 --- wxlsock.cpp 8 Nov 2007 23:47:15 -0000 1.32 *************** *** 182,196 **** pMemory += sizeof(wxInt32); ! const char *pNamePtr = pMemory; ! pMemory += strlen(pNamePtr) + 1; ! const char *pTypePtr = pMemory; ! pMemory += strlen(pTypePtr) + 1; const char *pValuePtr = pMemory; pMemory += strlen(pValuePtr) + 1; const char *pSourcePtr = pMemory; ! wxLuaDebugItem *pItem = new wxLuaDebugItem(lua2wx(pNamePtr), ! lua2wx(pTypePtr), ! lua2wx(pValuePtr), lua2wx(pSourcePtr), nReference, --- 182,199 ---- pMemory += sizeof(wxInt32); ! wxInt32 keyType = *(wxInt32 *) pMemory; ! pMemory += sizeof(wxInt32); ! ! wxInt32 valueType = *(wxInt32 *) pMemory; ! pMemory += sizeof(wxInt32); ! ! const char *pKeyPtr = pMemory; ! pMemory += strlen(pKeyPtr) + 1; const char *pValuePtr = pMemory; pMemory += strlen(pValuePtr) + 1; const char *pSourcePtr = pMemory; ! wxLuaDebugItem *pItem = new wxLuaDebugItem(lua2wx(pKeyPtr), keyType, ! lua2wx(pValuePtr), valueType, lua2wx(pSourcePtr), nReference, *************** *** 257,272 **** const wxLuaDebugItem *item = debugData.Item(idx); ! wxLuaCharBuffer nameBuffer(item->GetName()); ! wxLuaCharBuffer typeBuffer(item->GetType()); wxLuaCharBuffer valueBuffer(item->GetValue()); wxLuaCharBuffer sourceBuffer(item->GetSource()); ! int nameLength = nameBuffer.Length() + 1; // add 1 for terminating \0 ! int typeLength = typeBuffer.Length() + 1; ! int valueLength = valueBuffer.Length() + 1; int sourceLength = sourceBuffer.Length() + 1; ! wxInt32 bufferLength = (3 * sizeof(wxInt32)) + ! nameLength + typeLength + valueLength + sourceLength; unsigned char *pBuffer = new unsigned char[bufferLength]; --- 260,273 ---- const wxLuaDebugItem *item = debugData.Item(idx); ! wxLuaCharBuffer keyBuffer(item->GetKey()); wxLuaCharBuffer valueBuffer(item->GetValue()); wxLuaCharBuffer sourceBuffer(item->GetSource()); ! int keyLength = keyBuffer.Length() + 1; // add 1 for terminating \0 ! int valueLength = valueBuffer.Length() + 1; int sourceLength = sourceBuffer.Length() + 1; ! wxInt32 bufferLength = (5 * sizeof(wxInt32)) + ! keyLength + valueLength + sourceLength; unsigned char *pBuffer = new unsigned char[bufferLength]; *************** *** 285,293 **** pMemory += sizeof(wxInt32); ! memcpy(pMemory, nameBuffer.GetData(), nameLength); ! pMemory += nameLength; ! memcpy(pMemory, typeBuffer.GetData(), typeLength); ! pMemory += typeLength; memcpy(pMemory, valueBuffer.GetData(), valueLength); --- 286,297 ---- pMemory += sizeof(wxInt32); ! *(wxInt32 *) pMemory = (wxInt32)item->GetKeyType(); ! pMemory += sizeof(wxInt32); ! *(wxInt32 *) pMemory = (wxInt32)item->GetValueType(); ! pMemory += sizeof(wxInt32); ! ! memcpy(pMemory, keyBuffer.GetData(), keyLength); ! pMemory += keyLength; memcpy(pMemory, valueBuffer.GetData(), valueLength); |