make CCallsign::m_sz mutable

pull/1/head
Tom Early 5 years ago
parent e6235bc340
commit e488070587

@ -331,23 +331,20 @@ bool CCallsign::operator ==(const CCallsign &callsign) const
CCallsign::operator const char *() const CCallsign::operator const char *() const
{ {
char *sz = (char *)(const char *)m_sz;
// empty // empty
::memset(sz, 0, sizeof(m_sz)); ::memset(m_sz, 0, sizeof(m_sz));
// callsign // callsign
sz[CALLSIGN_LEN] = 0; ::memcpy(m_sz, m_Callsign, sizeof(m_Callsign));
::memcpy(sz, m_Callsign, sizeof(m_Callsign));
// module // module
if ( HasModule() ) if ( HasModule() )
{ {
sz[sizeof(m_Callsign)] = m_Module; m_sz[sizeof(m_Callsign)] = m_Module;
} }
// suffix // suffix
if ( HasSuffix() ) if ( HasSuffix() )
{ {
::strcat(sz, " / "); ::strcat(m_sz, " / ");
::strncat(sz, m_Suffix, sizeof(m_Suffix)); ::strncat(m_sz, m_Suffix, sizeof(m_Suffix));
} }
// done // done

@ -91,7 +91,7 @@ protected:
char m_Callsign[CALLSIGN_LEN]; char m_Callsign[CALLSIGN_LEN];
char m_Suffix[CALLSUFFIX_LEN]; char m_Suffix[CALLSUFFIX_LEN];
char m_Module; char m_Module;
char m_sz[CALLSIGN_LEN+CALLSUFFIX_LEN+5]; mutable char m_sz[CALLSIGN_LEN+CALLSUFFIX_LEN+5];
#ifndef NO_XLX #ifndef NO_XLX
uint32 m_uiDmrid; uint32 m_uiDmrid;
#endif #endif

Loading…
Cancel
Save

Powered by TurnKey Linux.