Fix using const char* and wxString in ternary operator
Using a const char* and a wxString in the two branches of the ternary operator resulted in compile-time errors since the result type of the conditional expression was ambiguous, so add explicit conversions to fix it. Closes https://github.com/wxWidgets/wxWidgets/pull/2634 See #19355.
This commit is contained in:
parent
55cb17df78
commit
0f8ab824a3
4 changed files with 6 additions and 5 deletions
|
|
@ -63,6 +63,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
const wxString dispAlphaValNull("--");
|
||||
const unsigned char* d1 = m_image.GetData();
|
||||
const unsigned char* d2 = other.GetData();
|
||||
const unsigned char* a1 = m_image.GetAlpha();
|
||||
|
|
@ -72,8 +73,8 @@ public:
|
|||
{
|
||||
for ( int x = 0; x < m_image.GetWidth(); ++x )
|
||||
{
|
||||
wxString a1txt = dispAlphaVal ? (a1 != NULL ? wxString::Format("%02x", *a1) : "--") : "";
|
||||
wxString a2txt = dispAlphaVal ? (a2 != NULL ? wxString::Format("%02x", *a2) : "--") : "";
|
||||
wxString a1txt = dispAlphaVal ? (a1 != NULL ? wxString::Format("%02x", *a1) : dispAlphaValNull) : wxString();
|
||||
wxString a2txt = dispAlphaVal ? (a2 != NULL ? wxString::Format("%02x", *a2) : dispAlphaValNull) : wxString();
|
||||
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue