pcsx2|utilities: Remove ambiguous wxString-related overloads

Avoid some function overloads that can accept char*, wxChar* and
wxString as a parameter. wxString can be constructed with either of
those parameters, so the function overloads may actually result in
ambiguity errors. Keep the wxString parameter versions and remove the
rest.

Fixes some compile errors on FreeBSD.
This commit is contained in:
Jonathan Li 2018-08-29 01:12:26 +01:00
parent 5b9e93c652
commit 93d5b52df3
5 changed files with 4 additions and 29 deletions

View File

@ -185,9 +185,6 @@ extern pxDoAssertFnType *pxDoAssert;
#define IndexBoundsAssumeDev(objname, idx, sze) pxAssumeDev((uint)(idx) < (uint)(sze), \
pxsFmt(L"Array index out of bounds accessing object '%s' (index=%d, size=%d)", objname, (idx), (sze)))
extern void pxOnAssert(const DiagnosticOrigin &origin, const wxChar *msg = NULL);
extern void pxOnAssert(const DiagnosticOrigin &origin, const char *msg);
extern void pxOnAssert(const DiagnosticOrigin &origin, const wxString &msg);
extern void pxOnAssert(const DiagnosticOrigin &origin, const FastFormatUnicode &msg);

View File

@ -680,8 +680,7 @@ protected:
wxPoint m_curpos;
int m_leading;
virtual void _DoWriteLn(const wxChar *msg);
void _DoWriteLn(const wxString msg);
virtual void _DoWriteLn(const wxString &msg);
void _DoWrite(const wxChar *msg);
public:

View File

@ -95,7 +95,7 @@ bool pxAssertImpl_LogIt(const DiagnosticOrigin &origin, const wxChar *msg)
}
DEVASSERT_INLINE void pxOnAssert(const DiagnosticOrigin &origin, const wxChar *msg)
DEVASSERT_INLINE void pxOnAssert(const DiagnosticOrigin &origin, const wxString &msg)
{
// Recursion guard: Allow at least one recursive call. This is useful because sometimes
// we get meaningless assertions while unwinding stack traces after exceptions have occurred.
@ -124,16 +124,6 @@ DEVASSERT_INLINE void pxOnAssert(const DiagnosticOrigin &origin, const wxChar *m
}
}
__fi void pxOnAssert(const DiagnosticOrigin &origin, const char *msg)
{
pxOnAssert(origin, fromUTF8(msg));
}
__fi void pxOnAssert(const DiagnosticOrigin &origin, const wxString &msg)
{
pxOnAssert(origin, msg.wc_str());
}
__fi void pxOnAssert(const DiagnosticOrigin &origin, const FastFormatUnicode &msg)
{
pxOnAssert(origin, msg.c_str());

View File

@ -84,7 +84,7 @@ pxWindowTextWriter &pxWindowTextWriter::MoveY(int ydelta)
return *this;
}
void pxWindowTextWriter::_DoWriteLn(const wxChar *msg)
void pxWindowTextWriter::_DoWriteLn(const wxString &msg)
{
pxAssert(msg);
@ -103,11 +103,6 @@ void pxWindowTextWriter::_DoWriteLn(const wxChar *msg)
m_curpos.y += tHeight + m_leading;
}
void pxWindowTextWriter::_DoWriteLn(const wxString msg)
{
_DoWriteLn(msg.wc_str());
}
// Splits incoming multi-line strings into pieces, and dispatches each line individually
// to the text writer.
void pxWindowTextWriter::_DoWrite(const wxChar *msg)

View File

@ -227,7 +227,7 @@ public:
ConsoleLogFromVM( const TraceLogDescriptor* desc ) : _parent( desc ) {}
bool Write( const wxChar* msg ) const
bool Write( const wxString &msg ) const
{
ConsoleColorScope cs(conColor);
Console.WriteRaw( msg );
@ -239,12 +239,6 @@ public:
return false;
}
bool Write( const wxString msg ) const
{
return Write(msg.wc_str());
}
};
// --------------------------------------------------------------------------------------