Ticket #15206: UniCharTypeAdditions.diff

File UniCharTypeAdditions.diff, 4.6 KB (added by ByteMonk, 5 years ago)

Patch detailing changes to the wxUniChar class

  • include/wx/unichar.h

     
    4646    wxUniChar(unsigned long int c) { m_value = c; }
    4747    wxUniChar(short int c) { m_value = c; }
    4848    wxUniChar(unsigned short int c) { m_value = c; }
     49    wxUniChar(long long int c) { m_value = c; }
     50    wxUniChar(unsigned long long c) { m_value = c; }
    4951
    5052    wxUniChar(const wxUniCharRef& c);
    5153
     
    103105    operator unsigned long int() const { return (unsigned long)m_value; }
    104106    operator short int() const { return (short int)m_value; }
    105107    operator unsigned short int() const { return (unsigned short int)m_value; }
     108    operator long long int() const { return (long long int)m_value; }
     109    operator unsigned long long() const { return (unsigned long long)m_value; }
    106110
    107111    // We need this operator for the "*p" part of expressions like "for (
    108112    // const_iterator p = begin() + nStart; *p; ++p )". In this case,
     
    130134    wxUniChar& operator=(unsigned long int c) { m_value = c; return *this; }
    131135    wxUniChar& operator=(short int c) { m_value = c; return *this; }
    132136    wxUniChar& operator=(unsigned short int c) { m_value = c; return *this; }
     137    wxUniChar& operator=(long long int c) { m_value = c; return *this; }
     138    wxUniChar& operator=(unsigned long long c) { m_value = c; return *this; }
    133139
    134140    // Comparison operators:
    135141
     
    144150    bool operator op(short int c) const { return m_value op (value_type)c; }  \
    145151    bool operator op(unsigned short int c) const { return m_value op (value_type)c; }  \
    146152    bool operator op(long int c) const { return m_value op (value_type)c; }   \
    147     bool operator op(unsigned long int c) const { return m_value op (value_type)c; }
     153    bool operator op(unsigned long int c) const { return m_value op (value_type)c; } \
     154    bool operator op(long long int c) const { return m_value op (value_type)c; } \
     155    bool operator op(unsigned long long c) const { return m_value op (value_type)c; }
    148156
    149157    wxFOR_ALL_COMPARISONS(wxDEFINE_UNICHAR_OPERATOR)
    150158
     
    254262    wxUniCharRef& operator=(unsigned short int c) { return *this = wxUniChar(c); }
    255263    wxUniCharRef& operator=(long int c) { return *this = wxUniChar(c); }
    256264    wxUniCharRef& operator=(unsigned long int c) { return *this = wxUniChar(c); }
     265    wxUniCharRef& operator=(long long int c) { return *this = wxUniChar(c); }
     266    wxUniCharRef& operator=(unsigned long long c) { return *this = wxUniChar(c); }
    257267
    258268    // Conversions to the same types as wxUniChar is convertible too:
    259269    operator char() const { return UniChar(); }
     
    267277    operator unsigned short int() const { return UniChar(); }
    268278    operator long int() const { return UniChar(); }
    269279    operator unsigned long int() const { return UniChar(); }
     280    operator long long int() const { return UniChar(); }
     281    operator unsigned long long() const { return UniChar(); }
    270282
     283
     284
    271285    // see wxUniChar::operator bool etc. for explanation
    272286    operator bool() const { return (bool)UniChar(); }
    273287    bool operator!() const { return !UniChar(); }
     
    285299    bool operator op(short int c) const { return UniChar() op c; }             \
    286300    bool operator op(unsigned short int c) const { return UniChar() op c; }    \
    287301    bool operator op(long int c) const { return UniChar() op c; }             \
    288     bool operator op(unsigned long int c) const { return UniChar() op c; }
     302    bool operator op(unsigned long int c) const { return UniChar() op c; } \
     303    bool operator op(long long int c) const { return UniChar() op c; } \
     304    bool operator op(unsigned long long c) const { return UniChar() op c; }
    289305
    290306    wxFOR_ALL_COMPARISONS(wxDEFINE_UNICHARREF_OPERATOR)
    291307
  • interface/wx/unichar.h

     
    4545    wxUniChar(unsigned long int c);
    4646    wxUniChar(short int c);
    4747    wxUniChar(unsigned short int c);
     48    wxUniChar(long long int c);
     49    wxUniChar(unsigned long long c);
    4850
    4951    wxUniChar(const wxUniCharRef& c);
    5052
     
    9799    operator unsigned long int() const;
    98100    operator short int() const;
    99101    operator unsigned short int() const;
     102    operator long long int() const;
     103    operator unsigned long long() const;
    100104    //@}
    101105
    102106    //@{
     
    114118    wxUniChar& operator=(unsigned long int c);
    115119    wxUniChar& operator=(short int c);
    116120    wxUniChar& operator=(unsigned short int c);
     121    wxUniChar& operator=(long long int c);
     122    wxUniChar& operator=(unsigned long long c);
    117123    //@}
    118124};
    119125