git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51508
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if ( m2w != ICONV_T_INVALID )
{
char buf[2], *bufPtr;
if ( m2w != ICONV_T_INVALID )
{
char buf[2], *bufPtr;
- wchar_t wbuf[2], *wbufPtr;
size_t insz, outsz;
size_t res;
size_t insz, outsz;
size_t res;
wbuf[0] = 0;
insz = 2;
outsz = SIZEOF_WCHAR_T * 2;
wbuf[0] = 0;
insz = 2;
outsz = SIZEOF_WCHAR_T * 2;
+ char* wbufPtr = (char*)wbuf;
bufPtr = buf;
res = iconv(
m2w, ICONV_CHAR_CAST(&bufPtr), &insz,
bufPtr = buf;
res = iconv(
m2w, ICONV_CHAR_CAST(&bufPtr), &insz,
- (char**)&wbufPtr, &outsz);
if (ICONV_FAILED(res, insz))
{
if (ICONV_FAILED(res, insz))
{
size_t outbuf = n * SIZEOF_WCHAR_T;
size_t res, cres;
size_t outbuf = n * SIZEOF_WCHAR_T;
size_t res, cres;
- // VS: Use these instead of psz, buf because iconv() modifies its arguments:
- wchar_t *bufPtr = buf;
const char *pszPtr = psz;
if (buf)
{
const char *pszPtr = psz;
if (buf)
{
+ char* bufPtr = (char*)buf;
+
// have destination buffer, convert there
cres = iconv(m2w,
ICONV_CHAR_CAST(&pszPtr), &inbuf,
// have destination buffer, convert there
cres = iconv(m2w,
ICONV_CHAR_CAST(&pszPtr), &inbuf,
- (char**)&bufPtr, &outbuf);
res = n - (outbuf / SIZEOF_WCHAR_T);
if (ms_wcNeedsSwap)
res = n - (outbuf / SIZEOF_WCHAR_T);
if (ms_wcNeedsSwap)
+ char* bufPtr = (char*)tbuf;
outbuf = 8 * SIZEOF_WCHAR_T;
cres = iconv(m2w,
ICONV_CHAR_CAST(&pszPtr), &inbuf,
outbuf = 8 * SIZEOF_WCHAR_T;
cres = iconv(m2w,
ICONV_CHAR_CAST(&pszPtr), &inbuf,
- (char**)&bufPtr, &outbuf );
res += 8 - (outbuf / SIZEOF_WCHAR_T);
}
res += 8 - (outbuf / SIZEOF_WCHAR_T);
}
#endif
size_t inlen = wxWcslen(psz);
#endif
size_t inlen = wxWcslen(psz);
- size_t inbuf = inlen * SIZEOF_WCHAR_T;
- size_t outbuf = n;
+ size_t inbuflen = inlen * SIZEOF_WCHAR_T;
+ size_t outbuflen = n;
size_t res, cres;
wchar_t *tmpbuf = 0;
size_t res, cres;
wchar_t *tmpbuf = 0;
// need to copy to temp buffer to switch endianness
// (doing WC_BSWAP twice on the original buffer won't help, as it
// could be in read-only memory, or be accessed in some other thread)
// need to copy to temp buffer to switch endianness
// (doing WC_BSWAP twice on the original buffer won't help, as it
// could be in read-only memory, or be accessed in some other thread)
- tmpbuf = (wchar_t *)malloc(inbuf + SIZEOF_WCHAR_T);
+ tmpbuf = (wchar_t *)malloc(inbuflen + SIZEOF_WCHAR_T);
for ( size_t i = 0; i < inlen; i++ )
tmpbuf[n] = WC_BSWAP(psz[i]);
for ( size_t i = 0; i < inlen; i++ )
tmpbuf[n] = WC_BSWAP(psz[i]);
+ char* inbuf = (char*)psz;
if (buf)
{
// have destination buffer, convert there
if (buf)
{
// have destination buffer, convert there
- cres = iconv( w2m, ICONV_CHAR_CAST(&psz), &inbuf, &buf, &outbuf );
+ cres = iconv(w2m, ICONV_CHAR_CAST(&inbuf), &inbuflen, &buf, &outbuflen);
// NB: iconv was given only wcslen(psz) characters on input, and so
// it couldn't convert the trailing zero. Let's do it ourselves
// NB: iconv was given only wcslen(psz) characters on input, and so
// it couldn't convert the trailing zero. Let's do it ourselves
- cres = iconv( w2m, ICONV_CHAR_CAST(&psz), &inbuf, &buf, &outbuf );
+ cres = iconv(w2m, ICONV_CHAR_CAST(&inbuf), &inbuflen, &buf, &outbuflen);
}
while ((cres == (size_t)-1) && (errno == E2BIG));
}
}
while ((cres == (size_t)-1) && (errno == E2BIG));
}
- if (ICONV_FAILED(cres, inbuf))
+ if (ICONV_FAILED(cres, inbuflen))
{
wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
return wxCONV_FAILED;
{
wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
return wxCONV_FAILED;
Atom type;
int format;
gulong nitems, bytes_after;
Atom type;
int format;
gulong nitems, bytes_after;
success = XGetWindowProperty(
gdk_x11_drawable_get_xdisplay(window),
gdk_x11_drawable_get_xid(window),
success = XGetWindowProperty(
gdk_x11_drawable_get_xdisplay(window),
gdk_x11_drawable_get_xid(window),
0, 4,
false,
XA_CARDINAL,
0, 4,
false,
XA_CARDINAL,
- &type, &format, &nitems, &bytes_after, (guchar**)&data
+ &type, &format, &nitems, &bytes_after, &data
) == Success;
if (success)
{
success = data && nitems == 4;
if (success)
{
) == Success;
if (success)
{
success = data && nitems == 4;
if (success)
{
- if (left) *left = int(data[0]);
- if (right) *right = int(data[1]);
- if (top) *top = int(data[2]);
- if (bottom) *bottom = int(data[3]);
+ long* p = (long*)data;
+ if (left) *left = int(p[0]);
+ if (right) *right = int(p[1]);
+ if (top) *top = int(p[2]);
+ if (bottom) *bottom = int(p[3]);
Atom type;
int format;
gulong nitems, bytes_after;
Atom type;
int format;
gulong nitems, bytes_after;
Status status = XGetWindowProperty(
gdk_x11_drawable_get_xdisplay(event->window),
gdk_x11_drawable_get_xid(event->window),
xproperty,
0, 4, false, XA_CARDINAL,
Status status = XGetWindowProperty(
gdk_x11_drawable_get_xdisplay(event->window),
gdk_x11_drawable_get_xid(event->window),
xproperty,
0, 4, false, XA_CARDINAL,
- &type, &format, &nitems, &bytes_after, (guchar**)&data);
+ &type, &format, &nitems, &bytes_after, &data);
if (status == Success && data && nitems == 4)
{
if (status == Success && data && nitems == 4)
{
- wxSize(int(data[0] + data[1]), int(data[2] + data[3]));
+ wxSize(int(p[0] + p[1]), int(p[2] + p[3]));
if (win->m_decorSize != decorSize)
{
const wxSize diff = decorSize - win->m_decorSize;
if (win->m_decorSize != decorSize)
{
const wxSize diff = decorSize - win->m_decorSize;
{
wxMAKE_ATOM(KWIN_RUNNING, display);
{
wxMAKE_ATOM(KWIN_RUNNING, display);
Atom type;
int format;
unsigned long nitems, after;
if (XGetWindowProperty(display, rootWnd,
KWIN_RUNNING, 0, 1, False, KWIN_RUNNING,
&type, &format, &nitems, &after,
Atom type;
int format;
unsigned long nitems, after;
if (XGetWindowProperty(display, rootWnd,
KWIN_RUNNING, 0, 1, False, KWIN_RUNNING,
&type, &format, &nitems, &after,
- (unsigned char**)&data) != Success)
{
return false;
}
bool retval = (type == KWIN_RUNNING &&
{
return false;
}
bool retval = (type == KWIN_RUNNING &&
- nitems == 1 && data && data[0] == 1);
+ nitems == 1 && data && ((long*)data)[0] == 1);
XFree(data);
return retval;
}
XFree(data);
return retval;
}