Bug #10669 2007-03-18 15:02

ondra_holub

file global.h, function cbU2C should return const value

Function is implemented in src/sdk/global.cpp as

// Return multibyte (C string) representation of the string
wxWX2MBbuf cbU2C(const wxString& str)
{
    if(platform::unicode)
        return str.mb_str(wxConvUTF8);
    else
        return str.mb_str();
}

So it tries to convert const value to non-const. Function should return const wxWX2MBbuf - then everything seems ok. Without this change I am not able to compile on SUSE Linux 10.1/64bit with gcc 4.1.0.
Category
Application::Error
Group
 
Status
Closed
Close date
2007-03-27 10:47
Assigned to
 
ondra_holub 2007-03-18 15:11

Also file src/plugins/contrib/wxSmith/wxwidgets/wxsitemresdataobject.cpp needs to be updated after update of cbU2C on lines 47 and 55 to assign result of cbU2C to const value:

bool wxsItemResDataObject::GetDataHere(const wxDataFormat& format,void *buf) const

{

wxString XmlData = GetXmlData();

const wxWX2MBbuf str = cbU2C(XmlData);

memcpy(buf,str,strlen(str)+1);

return true;

}

size_t wxsItemResDataObject::GetDataSize(const wxDataFormat& format) const

{

wxString XmlData = GetXmlData();

const wxWX2MBbuf str = cbU2C(XmlData);

return strlen(str)+1;

}

ondra_holub 2007-03-22 07:47
ondra_holub 2007-03-25 15:15

Added patch Patch #1929

mandrav 2007-03-27 10:47

This bug is now fixed in HEAD.

Thank you for reporting it.