if test "x$INTELCC" = "xyes" ; then
dnl Warnings which can't be easily suppressed in C code are disabled:
dnl
- dnl remark #810: conversion from "x" to "y" may lose significant bits
- dnl remark #869: parameter "foo" was never referenced
- dnl remark #1572: floating-point equality and inequality comparisons
- dnl are unreliable
- dnl remark #1684: conversion from pointer to same-sized integral type
- dnl
- dnl (for others see below)
- CWARNINGS="-Wall -wd810,869,981,1418,1572,1684"
+ dnl #810: conversion from "x" to "y" may lose significant bits
+ dnl #869: parameter "foo" was never referenced
+ dnl #1572: floating-point equality and inequality comparisons
+ dnl are unreliable
+ dnl #1684: conversion from pointer to same-sized integral type
+ dnl #2259: non-pointer conversion from "x" to "y" may lose significant
+ dnl bits
+ CWARNINGS="-Wall -wd810,869,981,1418,1572,1684,2259"
elif test "$GCC" = yes ; then
CWARNINGS="-Wall -Wundef"
fi
dnl (279) are generated for standard macros and so there is nothing we can
dnl do about them
dnl
- dnl remark #279: controlling expression is constant
- dnl remark #383: value copied to temporary, reference to temporary used
- dnl remark #444: destructor for base class "xxx" is not virtual
- dnl remark #810: conversion from "x" to "y" may lose significant bits
- dnl remark #869: parameter "foo" was never referenced
- dnl remark #981: operands are evaluated in unspecified order
- dnl remark #1418: external definition with no prior declaration
- dnl remark #1419: external declaration in primary source file
- CXXWARNINGS="-Wall -wd279,383,444,810,869,981,1418,1419"
+ dnl #279: controlling expression is constant
+ dnl #383: value copied to temporary, reference to temporary used
+ dnl #444: destructor for base class "xxx" is not virtual
+ dnl #981: operands are evaluated in unspecified order
+ dnl #1418: external definition with no prior declaration
+ dnl #1419: external declaration in primary source file
+ dnl #1881: argument must be a constant null pointer value
+ dnl
+ dnl (for others see CWARNINGS above)
+ CXXWARNINGS="-Wall -wd279,383,444,810,869,981,1418,1419,1881,2259"
elif test "$GXX" = yes ; then
CXXWARNINGS="-Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy"
AX_CXXFLAGS_GCC_OPTION(-Woverloaded-virtual, CXXWARNINGS)
private:
// reference-counted data
- struct Data : wxPrivate::UntypedBufferData
+ struct Data : public wxPrivate::UntypedBufferData
{
Data(CharType *str, Kind kind = Owned)
: UntypedBufferData(str, kind)
#pragma warning(disable: 1682)
/* conversion from "X" to "T" may lose significant bits */
#pragma warning(disable: 810)
+ /* non-pointer conversion from "foo" to "bar" may lose significant bits */
+ #pragma warning(disable: 2259)
return x;
// the current decoder state: this is only used by ToWChar() if srcLen
// parameter is not wxNO_LEN, when working on the entire NUL-terminated
// strings we neither update nor use the state
- class DecoderState : StateMode
+ class DecoderState : private StateMode
{
private:
// current state: this one is private as we want to enforce the use of
// encoder state is simpler as we always receive entire Unicode characters
// on input
- class EncoderState : StateMode
+ class EncoderState : private StateMode
{
private:
Mode mode;
// FIXME-UTF8: which one is better default in absence of fmt string
// (i.e. when used like e.g. Foo("foo", "bar", 'c', NULL)?
if ( !fmt || fmt->GetArgumentType(index) == wxFormatString::Arg_Char )
- m_value = wxUniChar(value).GetValue();
+ m_value = wx_truncate_cast(T, wxUniChar(value).GetValue());
else
m_value = value;
}
{
#if wxUSE_UNICODE
if ( c < 0x80 )
- return c;
+ return wx_truncate_cast(char, c);
return ToHi8bit(c);
#else
// JPEG error manager:
-struct wx_error_mgr : jpeg_error_mgr
+struct wx_error_mgr : public jpeg_error_mgr
{
jmp_buf setjmp_buffer; /* for return to caller */
};
#define WX_DEFINE_GLOBAL_CONV(klass, name, ctor_args) \
WX_DEFINE_GLOBAL_CONV2(klass, klass, name, ctor_args)
+#ifdef __INTELC__
+ // disable warning "variable 'xxx' was declared but never referenced"
+ #pragma warning(disable: 177)
+#endif // Intel C++
+
#ifdef __WINDOWS__
WX_DEFINE_GLOBAL_CONV2(wxMBConv, wxMBConv_win32, wxConvLibc, wxEMPTY_PARAMETER_VALUE);
#else
wxUString &wxUString::assignFromAscii( const char *str )
{
size_type len = wxStrlen( str );
-
+
wxU32CharBuffer buffer( len );
wxChar32 *ptr = buffer.data();
-
+
size_type i;
for (i = 0; i < len; i++)
{
ptr++;
str++;
}
-
+
return assign( buffer );
}
len++;
s++;
}
-
+
wxU32CharBuffer buffer( len );
wxChar32 *ptr = buffer.data();
-
+
size_type i;
for (i = 0; i < len; i++)
{
ptr++;
str++;
}
-
+
return *this;
}
// UTF-8
// ----------------------------------------------------------------------------
-static const wxUint32 utf8_max[]=
- { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff, 0xffffffff };
-
// this table gives the length of the UTF-8 encoding from its first character:
const unsigned char tableUtf8Lengths[256] = {
// single-byte sequences (ASCII):
{
if (!str)
return assign( wxUString() );
-
+
size_type ucs4_len = 0;
const char *p = str;
while (*p)
wxU32CharBuffer buffer( ucs4_len );
wxChar32 *out = buffer.data();
-
+
p = str;
while (*p)
{
code <<= 6;
code |= c & 0x3F;
}
-
+
*out = code;
p++;
}
{
if (!str)
return assign( wxUString() );
-
+
size_type ucs4_len = 0;
size_type utf8_pos = 0;
const char *p = str;
ucs4_len ++;
p += len;
}
-
+
wxU32CharBuffer buffer( ucs4_len );
wxChar32 *out = buffer.data();
-
+
utf8_pos = 0;
p = str;
while (*p)
if (utf8_pos + 1 > n)
break;
utf8_pos++;
-
+
*out = c;
p++;
}
code <<= 6;
code |= c & 0x3F;
}
-
+
*out = code;
p++;
}
out++;
}
-
+
*out = 0;
return assign( buffer.data() );
{
if (!str)
return assign( wxUString() );
-
+
size_type ucs4_len = 0;
size_type utf16_pos = 0;
const wxChar16 *p = str;
{
len = 2;
}
-
+
if (utf16_pos + len > n)
break;
-
+
ucs4_len++;
p += len;
utf16_pos += len;
wxChar32 *out = buffer.data();
utf16_pos = 0;
-
+
p = str;
while (*p)
{
{
if (utf16_pos + 1 > n)
break;
-
+
*out = *p;
p++;
utf16_pos++;
{
if (utf16_pos + 2 > n)
break;
-
+
*out = ((p[0] - 0xd7c0) << 10) + (p[1] - 0xdc00);
p += 2;
utf16_pos += 2;
}
out++;
}
-
+
return assign( buffer.data() );
}
{
if (!str)
return assign( wxUString() );
-
+
size_type ucs4_len = 0;
const wxChar16 *p = str;
while (*p)
{
len = 2;
}
-
+
ucs4_len++;
p += len;
}
wxU32CharBuffer buffer( ucs4_len );
wxChar32 *out = buffer.data();
-
+
p = str;
while (*p)
{
}
out++;
}
-
+
return assign( buffer.data() );
}
{
if (!str)
return assign( wxUString() );
-
+
wxWCharBuffer buffer = wxConvLibc.cMB2WC( str );
-
+
return assign( buffer );
}
{
if (!str)
return assign( wxUString() );
-
+
wxWCharBuffer buffer = conv.cMB2WC( str );
-
+
return assign( buffer );
}
{
size_type utf8_length = 0;
const wxChar32 *ptr = data();
-
+
while (*ptr)
{
wxChar32 code = *ptr;
ptr++;
-
+
if ( code <= 0x7F )
{
utf8_length++;
// invalid range, skip
}
}
-
+
wxCharBuffer result( utf8_length );
-
+
char *out = result.data();
-
+
ptr = data();
while (*ptr)
{
wxChar32 code = *ptr;
ptr++;
-
+
if ( code <= 0x7F )
{
out[0] = (char)code;
wxPrintf( "utf8_str %s len %d\n", result, wxStrlen( result.data() ) );
wxPrintf( "utf8_str %s len %d\n", result, wxStrlen( result.data() ) );
-
+
return result;
}
-
+
wxU16CharBuffer wxUString::utf16_str() const
{
size_type utf16_length = 0;
const wxChar32 *ptr = data();
-
+
while (*ptr)
{
wxChar32 code = *ptr;
ptr++;
-
+
// TODO: error range checks
-
+
if (code < 0x10000)
utf16_length++;
else
utf16_length += 2;
}
-
+
wxU16CharBuffer result( utf16_length );
wxChar16 *out = result.data();
-
+
ptr = data();
-
+
while (*ptr)
{
wxChar32 code = *ptr;
ptr++;
-
+
// TODO: error range checks
-
+
if (code < 0x10000)
{
out[0] = code;
out += 2;
}
}
-
- return result;
+
+ return result;
}
double bluePS = (double)(blue) / 255.0;
double greenPS = (double)(green) / 255.0;
- wxString buffer;
buffer.Printf( "%f %f %f setrgbcolor\n", redPS, greenPS, bluePS );
buffer.Replace( ",", "." );
PsPrint( buffer );
m_msg = new wxStaticText(this, wxID_ANY, message);
sizerTop->Add(m_msg, 0, wxLEFT | wxTOP, 2*LAYOUT_MARGIN);
- wxSize sizeLabel = m_msg->GetSize();
if ( maximum > 0 )
{
int gauge_style = wxGA_HORIZONTAL;
// this is defined in src/gtk/toplevel.cpp
extern int wxOpenModalDialogsCount;
-wxDEFINE_TIED_SCOPED_PTR_TYPE(wxGUIEventLoop);
+wxDEFINE_TIED_SCOPED_PTR_TYPE(wxGUIEventLoop)
//-----------------------------------------------------------------------------
{
if (textfile.GetLine(i).Find(wxT("=")) != wxNOT_FOUND)
{
- wxString mimeType = textfile.GetVerb(i);
wxString desktopFile = textfile.GetCmd(i);
if (deskTopFilesSeen.Index(desktopFile) == wxNOT_FOUND)