don't suppose that string literals can be casted to non-const char *, newer compilers complain about it (replaces patch 974652)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27952 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-06-22 23:32:29 +00:00
parent 19fe5fd1dc
commit b7b97e7726

View File

@@ -163,7 +163,7 @@ static inline wxString ExtractNotLang(const wxString& langFull)
// Plural forms parser // Plural forms parser
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/* /*
Simplified Grammar Simplified Grammar
Expression: Expression:
@@ -189,7 +189,7 @@ RelationalExpression:
MultiplicativeExpression ">=" MultiplicativeExpression MultiplicativeExpression ">=" MultiplicativeExpression
MultiplicativeExpression "<=" MultiplicativeExpression MultiplicativeExpression "<=" MultiplicativeExpression
MultiplicativeExpression MultiplicativeExpression
MultiplicativeExpression: MultiplicativeExpression:
PmExpression '%' PmExpression PmExpression '%' PmExpression
PmExpression PmExpression
@@ -401,7 +401,7 @@ private:
wxPluralFormsToken m_token; wxPluralFormsToken m_token;
wxPluralFormsNodePtr m_nodes[3]; wxPluralFormsNodePtr m_nodes[3];
}; };
wxPluralFormsNodePtr::~wxPluralFormsNodePtr() wxPluralFormsNodePtr::~wxPluralFormsNodePtr()
{ {
delete m_p; delete m_p;
@@ -486,7 +486,7 @@ class wxPluralFormsCalculator
{ {
public: public:
wxPluralFormsCalculator() : m_nplurals(0), m_plural(0) {} wxPluralFormsCalculator() : m_nplurals(0), m_plural(0) {}
// input: number, returns msgstr index // input: number, returns msgstr index
int evaluate(int n) const; int evaluate(int n) const;
@@ -499,7 +499,7 @@ public:
void init(wxPluralFormsToken::Number nplurals, wxPluralFormsNode* plural); void init(wxPluralFormsToken::Number nplurals, wxPluralFormsNode* plural);
wxString getString() const; wxString getString() const;
private: private:
wxPluralFormsToken::Number m_nplurals; wxPluralFormsToken::Number m_nplurals;
wxPluralFormsNodePtr m_plural; wxPluralFormsNodePtr m_plural;
@@ -541,7 +541,7 @@ private:
wxPluralFormsScanner& m_scanner; wxPluralFormsScanner& m_scanner;
const wxPluralFormsToken& token() const; const wxPluralFormsToken& token() const;
bool nextToken(); bool nextToken();
wxPluralFormsNode* expression(); wxPluralFormsNode* expression();
wxPluralFormsNode* logicalOrExpression(); wxPluralFormsNode* logicalOrExpression();
wxPluralFormsNode* logicalAndExpression(); wxPluralFormsNode* logicalAndExpression();
@@ -923,7 +923,7 @@ private:
*m_pTransTable; // translated *m_pTransTable; // translated
wxString m_charset; wxString m_charset;
// swap the 2 halves of 32 bit integer if needed // swap the 2 halves of 32 bit integer if needed
size_t32 Swap(size_t32 ui) const size_t32 Swap(size_t32 ui) const
{ {
@@ -944,7 +944,7 @@ private:
} }
return (const char *)(m_pData + ofsString); return (const char *)(m_pData + ofsString);
} }
bool m_bSwapped; // wrong endianness? bool m_bSwapped; // wrong endianness?
@@ -1156,7 +1156,7 @@ bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName0,
m_pTransTable = (wxMsgTableEntry *)(m_pData + m_pTransTable = (wxMsgTableEntry *)(m_pData +
Swap(pHeader->ofsTransTable)); Swap(pHeader->ofsTransTable));
m_nSize = nSize; m_nSize = nSize;
// now parse catalog's header and try to extract catalog charset and // now parse catalog's header and try to extract catalog charset and
// plural forms formula from it: // plural forms formula from it:
@@ -1181,7 +1181,7 @@ bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName0,
} }
} }
// else: incorrectly filled Content-Type header // else: incorrectly filled Content-Type header
// Extract plural forms: // Extract plural forms:
begin = header.Find(wxT("Plural-Forms:")); begin = header.Find(wxT("Plural-Forms:"));
if (begin != wxNOT_FOUND) if (begin != wxNOT_FOUND)
@@ -1393,7 +1393,7 @@ bool wxLocale::Init(const wxChar *szName,
{ {
wxASSERT_MSG( !m_initialized, wxASSERT_MSG( !m_initialized,
_T("you can't call wxLocale::Init more than once") ); _T("you can't call wxLocale::Init more than once") );
m_initialized = true; m_initialized = true;
m_strLocale = szName; m_strLocale = szName;
m_strShort = szShort; m_strShort = szShort;
@@ -1416,7 +1416,7 @@ bool wxLocale::Init(const wxChar *szName,
256); 256);
if (ret != 0) if (ret != 0)
{ {
m_pszOldLocale = wxStrdup(localeName); m_pszOldLocale = wxStrdup(localeName);
} }
else else
m_pszOldLocale = NULL; m_pszOldLocale = NULL;
@@ -1574,7 +1574,10 @@ bool wxLocale::Init(int language, int flags)
// #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS bellow. // #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS bellow.
#define SETLOCALE_FAILS_ON_UNICODE_LANGS #define SETLOCALE_FAILS_ON_UNICODE_LANGS
#endif #endif
#if !wxUSE_UNICODE
const
#endif
wxMB2WXbuf retloc = wxT("C"); wxMB2WXbuf retloc = wxT("C");
if (language != wxLANGUAGE_DEFAULT) if (language != wxLANGUAGE_DEFAULT)
{ {
@@ -1585,7 +1588,7 @@ bool wxLocale::Init(int language, int flags)
} }
else else
{ {
int codepage int codepage
#ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
= -1 = -1
#endif #endif
@@ -2590,7 +2593,7 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
default: default:
return wxEmptyString; return wxEmptyString;
} }
} }
#endif // __WXMSW__/!__WXMSW__ #endif // __WXMSW__/!__WXMSW__