Source cleaning: whitespaces, tabs, -1/wxID_ANY/wxNOT_FOUND/wxDefaultCoord, TRUE/true, FALSE/false.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29257 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -144,7 +144,7 @@ bool wxIPV4address::Hostname(const wxString& name)
|
||||
if (name == wxT(""))
|
||||
{
|
||||
wxLogWarning( _("Trying to solve a NULL hostname: giving up") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
m_origHostname = name;
|
||||
return (GAddress_INET_SetHostName(m_address, name.mb_str()) == GSOCK_NOERROR);
|
||||
@@ -207,21 +207,21 @@ wxSockAddress *wxIPV4address::Clone() const
|
||||
}
|
||||
|
||||
wxString wxIPV4address::IPAddress() const
|
||||
{
|
||||
unsigned long raw = GAddress_INET_GetHostAddress(m_address);
|
||||
return wxString::Format(
|
||||
_T("%u.%u.%u.%u"),
|
||||
(unsigned char)((raw>>24) & 0xff),
|
||||
(unsigned char)((raw>>16) & 0xff),
|
||||
(unsigned char)((raw>>8) & 0xff),
|
||||
(unsigned char)(raw & 0xff)
|
||||
);
|
||||
{
|
||||
unsigned long raw = GAddress_INET_GetHostAddress(m_address);
|
||||
return wxString::Format(
|
||||
_T("%u.%u.%u.%u"),
|
||||
(unsigned char)((raw>>24) & 0xff),
|
||||
(unsigned char)((raw>>16) & 0xff),
|
||||
(unsigned char)((raw>>8) & 0xff),
|
||||
(unsigned char)(raw & 0xff)
|
||||
);
|
||||
}
|
||||
|
||||
bool wxIPV4address::operator==(wxIPV4address& addr)
|
||||
{
|
||||
if(Hostname().Cmp(addr.Hostname().c_str()) == 0 && Service() == addr.Service()) return true;
|
||||
return false;
|
||||
if(Hostname().Cmp(addr.Hostname().c_str()) == 0 && Service() == addr.Service()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
#if wxUSE_IPV6
|
||||
@@ -248,14 +248,14 @@ bool wxIPV6address::Hostname(const wxString& name)
|
||||
if (name == wxT(""))
|
||||
{
|
||||
wxLogWarning( _("Trying to solve a NULL hostname: giving up") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return (GAddress_INET_SetHostName(m_address, name.mb_str()) == GSOCK_NOERROR);
|
||||
}
|
||||
|
||||
bool wxIPV6address::Hostname(unsigned char[16] WXUNUSED(addr))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxIPV6address::Service(const wxString& name)
|
||||
@@ -284,15 +284,15 @@ bool wxIPV6address::AnyAddress()
|
||||
}
|
||||
|
||||
wxString wxIPV6address::IPAddress() const
|
||||
{
|
||||
unsigned long raw = GAddress_INET_GetHostAddress(m_address);
|
||||
return wxString::Format(
|
||||
_T("%u.%u.%u.%u"),
|
||||
(unsigned char)((raw>>24) & 0xff),
|
||||
(unsigned char)((raw>>16) & 0xff),
|
||||
(unsigned char)((raw>>8) & 0xff),
|
||||
(unsigned char)(raw & 0xff)
|
||||
);
|
||||
{
|
||||
unsigned long raw = GAddress_INET_GetHostAddress(m_address);
|
||||
return wxString::Format(
|
||||
_T("%u.%u.%u.%u"),
|
||||
(unsigned char)((raw>>24) & 0xff),
|
||||
(unsigned char)((raw>>16) & 0xff),
|
||||
(unsigned char)((raw>>8) & 0xff),
|
||||
(unsigned char)(raw & 0xff)
|
||||
);
|
||||
}
|
||||
|
||||
wxString wxIPV6address::Hostname() const
|
||||
@@ -342,7 +342,7 @@ wxString wxUNIXaddress::Filename()
|
||||
|
||||
path[0] = 0;
|
||||
GAddress_UNIX_GetPath(m_address, path, 1024);
|
||||
|
||||
|
||||
return wxString::FromAscii(path);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "wx/protocol/file.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol)
|
||||
IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, FALSE)
|
||||
IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, false)
|
||||
|
||||
wxFileProto::wxFileProto()
|
||||
: wxProtocol()
|
||||
|
||||
@@ -206,7 +206,7 @@ wxConnectionBase *wxTCPClient::MakeConnection (const wxString& host,
|
||||
client->SetEventHandler(*gs_handler, _CLIENT_ONREQUEST_ID);
|
||||
client->SetClientData(connection);
|
||||
client->SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG);
|
||||
client->Notify(TRUE);
|
||||
client->Notify(true);
|
||||
return connection;
|
||||
}
|
||||
else
|
||||
@@ -253,7 +253,7 @@ bool wxTCPServer::Create(const wxString& serverName)
|
||||
|
||||
wxSockAddress *addr = GetAddressFromName(serverName);
|
||||
if ( !addr )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
#ifdef __UNIX_LIKE__
|
||||
mode_t umaskOld;
|
||||
@@ -266,7 +266,7 @@ bool wxTCPServer::Create(const wxString& serverName)
|
||||
{
|
||||
delete addr;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// also set the umask to prevent the others from reading our file
|
||||
@@ -300,15 +300,15 @@ bool wxTCPServer::Create(const wxString& serverName)
|
||||
m_server->Destroy();
|
||||
m_server = NULL;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_server->SetEventHandler(*gs_handler, _SERVER_ONREQUEST_ID);
|
||||
m_server->SetClientData(this);
|
||||
m_server->SetNotify(wxSOCKET_CONNECTION_FLAG);
|
||||
m_server->Notify(TRUE);
|
||||
m_server->Notify(true);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxTCPServer::~wxTCPServer()
|
||||
@@ -379,20 +379,20 @@ void wxTCPConnection::Compress(bool WXUNUSED(on))
|
||||
bool wxTCPConnection::Disconnect ()
|
||||
{
|
||||
if ( !GetConnected() )
|
||||
return TRUE;
|
||||
return true;
|
||||
// Send the the disconnect message to the peer.
|
||||
m_codeco->Write8(IPC_DISCONNECT);
|
||||
m_sock->Notify(FALSE);
|
||||
m_sock->Notify(false);
|
||||
m_sock->Close();
|
||||
SetConnected(FALSE);
|
||||
SetConnected(false);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTCPConnection::Execute(const wxChar *data, int size, wxIPCFormat format)
|
||||
{
|
||||
if (!m_sock->IsConnected())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// Prepare EXECUTE message
|
||||
m_codeco->Write8(IPC_EXECUTE);
|
||||
@@ -404,7 +404,7 @@ bool wxTCPConnection::Execute(const wxChar *data, int size, wxIPCFormat format)
|
||||
m_codeco->Write32(size);
|
||||
m_sockstrm->Write(data, size);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxChar *wxTCPConnection::Request (const wxString& item, int *size, wxIPCFormat format)
|
||||
@@ -441,7 +441,7 @@ wxChar *wxTCPConnection::Request (const wxString& item, int *size, wxIPCFormat f
|
||||
bool wxTCPConnection::Poke (const wxString& item, wxChar *data, int size, wxIPCFormat format)
|
||||
{
|
||||
if (!m_sock->IsConnected())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_codeco->Write8(IPC_POKE);
|
||||
m_codeco->WriteString(item);
|
||||
@@ -453,7 +453,7 @@ bool wxTCPConnection::Poke (const wxString& item, wxChar *data, int size, wxIPCF
|
||||
m_codeco->Write32(size);
|
||||
m_sockstrm->Write(data, size);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTCPConnection::StartAdvise (const wxString& item)
|
||||
@@ -461,7 +461,7 @@ bool wxTCPConnection::StartAdvise (const wxString& item)
|
||||
int ret;
|
||||
|
||||
if (!m_sock->IsConnected())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_codeco->Write8(IPC_ADVISE_START);
|
||||
m_codeco->WriteString(item);
|
||||
@@ -469,9 +469,9 @@ bool wxTCPConnection::StartAdvise (const wxString& item)
|
||||
ret = m_codeci->Read8();
|
||||
|
||||
if (ret != IPC_FAIL)
|
||||
return TRUE;
|
||||
return true;
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTCPConnection::StopAdvise (const wxString& item)
|
||||
@@ -479,7 +479,7 @@ bool wxTCPConnection::StopAdvise (const wxString& item)
|
||||
int msg;
|
||||
|
||||
if (!m_sock->IsConnected())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_codeco->Write8(IPC_ADVISE_STOP);
|
||||
m_codeco->WriteString(item);
|
||||
@@ -487,9 +487,9 @@ bool wxTCPConnection::StopAdvise (const wxString& item)
|
||||
msg = m_codeci->Read8();
|
||||
|
||||
if (msg != IPC_FAIL)
|
||||
return TRUE;
|
||||
return true;
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Calls that SERVER can make
|
||||
@@ -497,7 +497,7 @@ bool wxTCPConnection::Advise (const wxString& item,
|
||||
wxChar *data, int size, wxIPCFormat format)
|
||||
{
|
||||
if (!m_sock->IsConnected())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_codeco->Write8(IPC_ADVISE);
|
||||
m_codeco->WriteString(item);
|
||||
@@ -509,7 +509,7 @@ bool wxTCPConnection::Advise (const wxString& item,
|
||||
m_codeco->Write32(size);
|
||||
m_sockstrm->Write(data, size);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -540,7 +540,7 @@ void wxTCPEventHandler::Client_OnRequest(wxSocketEvent &event)
|
||||
// We lost the connection: destroy everything
|
||||
if (evt == wxSOCKET_LOST)
|
||||
{
|
||||
sock->Notify(FALSE);
|
||||
sock->Notify(false);
|
||||
sock->Close();
|
||||
connection->OnDisconnect();
|
||||
return;
|
||||
@@ -658,9 +658,9 @@ void wxTCPEventHandler::Client_OnRequest(wxSocketEvent &event)
|
||||
}
|
||||
case IPC_DISCONNECT:
|
||||
{
|
||||
sock->Notify(FALSE);
|
||||
sock->Notify(false);
|
||||
sock->Close();
|
||||
connection->SetConnected(FALSE);
|
||||
connection->SetConnected(false);
|
||||
connection->OnDisconnect();
|
||||
break;
|
||||
}
|
||||
@@ -719,7 +719,7 @@ void wxTCPEventHandler::Server_OnRequest(wxSocketEvent &event)
|
||||
sock->SetEventHandler(*gs_handler, _CLIENT_ONREQUEST_ID);
|
||||
sock->SetClientData(new_connection);
|
||||
sock->SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG);
|
||||
sock->Notify(TRUE);
|
||||
sock->Notify(true);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -748,7 +748,7 @@ class wxTCPEventHandlerModule: public wxModule
|
||||
DECLARE_DYNAMIC_CLASS(wxTCPEventHandlerModule)
|
||||
|
||||
public:
|
||||
bool OnInit() { gs_handler = new wxTCPEventHandler(); return TRUE; }
|
||||
bool OnInit() { gs_handler = new wxTCPEventHandler(); return true; }
|
||||
void OnExit() { wxDELETE(gs_handler); }
|
||||
};
|
||||
|
||||
|
||||
@@ -49,16 +49,16 @@ wxSystemScreenType wxSystemSettings::GetScreenType()
|
||||
int x = GetMetric( wxSYS_SCREEN_X );
|
||||
|
||||
ms_screen = wxSYS_SCREEN_DESKTOP;
|
||||
|
||||
|
||||
if (x < 800)
|
||||
ms_screen = wxSYS_SCREEN_SMALL;
|
||||
|
||||
|
||||
if (x < 640)
|
||||
ms_screen = wxSYS_SCREEN_PDA;
|
||||
|
||||
|
||||
if (x < 200)
|
||||
ms_screen = wxSYS_SCREEN_TINY;
|
||||
|
||||
|
||||
// This is probably a bug, but VNC seems to report 0
|
||||
if (x < 10)
|
||||
ms_screen = wxSYS_SCREEN_DESKTOP;
|
||||
@@ -66,7 +66,7 @@ wxSystemScreenType wxSystemSettings::GetScreenType()
|
||||
|
||||
return ms_screen;
|
||||
}
|
||||
|
||||
|
||||
void wxSystemSettings::SetScreenType( wxSystemScreenType screen )
|
||||
{
|
||||
ms_screen = screen;
|
||||
|
||||
@@ -595,9 +595,9 @@ wxSize wxSizer::FitSize( wxWindow *window )
|
||||
|
||||
// Limit the size if sizeMax != wxDefaultSize
|
||||
|
||||
if ( size.x > sizeMax.x && sizeMax.x != -1 )
|
||||
if ( size.x > sizeMax.x && sizeMax.x != wxDefaultCoord )
|
||||
size.x = sizeMax.x;
|
||||
if ( size.y > sizeMax.y && sizeMax.y != -1 )
|
||||
if ( size.y > sizeMax.y && sizeMax.y != wxDefaultCoord )
|
||||
size.y = sizeMax.y;
|
||||
|
||||
return size;
|
||||
@@ -631,9 +631,9 @@ wxSize wxSizer::VirtualFitSize( wxWindow *window )
|
||||
|
||||
// Limit the size if sizeMax != wxDefaultSize
|
||||
|
||||
if ( size.x > sizeMax.x && sizeMax.x != -1 )
|
||||
if ( size.x > sizeMax.x && sizeMax.x != wxDefaultCoord )
|
||||
size.x = sizeMax.x;
|
||||
if ( size.y > sizeMax.y && sizeMax.y != -1 )
|
||||
if ( size.y > sizeMax.y && sizeMax.y != wxDefaultCoord )
|
||||
size.y = sizeMax.y;
|
||||
|
||||
return size;
|
||||
|
||||
@@ -146,11 +146,11 @@ bool wxSocketBase::Initialize()
|
||||
{
|
||||
m_countInit--;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxSocketBase::Shutdown()
|
||||
@@ -178,10 +178,10 @@ void wxSocketBase::Init()
|
||||
m_establishing =
|
||||
m_reading =
|
||||
m_writing =
|
||||
m_error = FALSE;
|
||||
m_error = false;
|
||||
m_lcount = 0;
|
||||
m_timeout = 600;
|
||||
m_beingDeleted = FALSE;
|
||||
m_beingDeleted = false;
|
||||
|
||||
// pushback buffer
|
||||
m_unread = NULL;
|
||||
@@ -189,10 +189,10 @@ void wxSocketBase::Init()
|
||||
m_unrd_cur = 0;
|
||||
|
||||
// events
|
||||
m_id = -1;
|
||||
m_id = wxID_ANY;
|
||||
m_handler = NULL;
|
||||
m_clientData = NULL;
|
||||
m_notify = FALSE;
|
||||
m_notify = false;
|
||||
m_eventmask = 0;
|
||||
|
||||
if ( !IsInitialized() )
|
||||
@@ -242,13 +242,13 @@ bool wxSocketBase::Destroy()
|
||||
// Delayed destruction: the socket will be deleted during the next
|
||||
// idle loop iteration. This ensures that all pending events have
|
||||
// been processed.
|
||||
m_beingDeleted = TRUE;
|
||||
m_beingDeleted = true;
|
||||
|
||||
// Shutdown and close the socket
|
||||
Close();
|
||||
|
||||
// Supress events from now on
|
||||
Notify(FALSE);
|
||||
Notify(false);
|
||||
|
||||
// schedule this object for deletion
|
||||
wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
|
||||
@@ -263,7 +263,7 @@ bool wxSocketBase::Destroy()
|
||||
delete this;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -290,15 +290,15 @@ bool wxSocketBase::Close()
|
||||
m_socket->Shutdown();
|
||||
}
|
||||
|
||||
m_connected = FALSE;
|
||||
m_establishing = FALSE;
|
||||
return TRUE;
|
||||
m_connected = false;
|
||||
m_establishing = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxSocketBase& wxSocketBase::Read(void* buffer, wxUint32 nbytes)
|
||||
{
|
||||
// Mask read events
|
||||
m_reading = TRUE;
|
||||
m_reading = true;
|
||||
|
||||
m_lcount = _Read(buffer, nbytes);
|
||||
|
||||
@@ -309,7 +309,7 @@ wxSocketBase& wxSocketBase::Read(void* buffer, wxUint32 nbytes)
|
||||
m_error = (m_lcount == 0);
|
||||
|
||||
// Allow read events from now on
|
||||
m_reading = FALSE;
|
||||
m_reading = false;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -319,7 +319,7 @@ wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
|
||||
int total;
|
||||
|
||||
// Try the pushback buffer first
|
||||
total = GetPushback(buffer, nbytes, FALSE);
|
||||
total = GetPushback(buffer, nbytes, false);
|
||||
nbytes -= total;
|
||||
buffer = (char *)buffer + total;
|
||||
|
||||
@@ -350,7 +350,7 @@ wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
|
||||
}
|
||||
else
|
||||
{
|
||||
bool more = TRUE;
|
||||
bool more = true;
|
||||
|
||||
while (more)
|
||||
{
|
||||
@@ -389,10 +389,10 @@ wxSocketBase& wxSocketBase::ReadMsg(void* buffer, wxUint32 nbytes)
|
||||
} msg;
|
||||
|
||||
// Mask read events
|
||||
m_reading = TRUE;
|
||||
m_reading = true;
|
||||
|
||||
total = 0;
|
||||
error = TRUE;
|
||||
error = true;
|
||||
old_flags = m_flags;
|
||||
SetFlags((m_flags & wxSOCKET_BLOCK) | wxSOCKET_WAITALL);
|
||||
|
||||
@@ -465,12 +465,12 @@ wxSocketBase& wxSocketBase::ReadMsg(void* buffer, wxUint32 nbytes)
|
||||
}
|
||||
|
||||
// everything was OK
|
||||
error = FALSE;
|
||||
error = false;
|
||||
|
||||
exit:
|
||||
m_error = error;
|
||||
m_lcount = total;
|
||||
m_reading = FALSE;
|
||||
m_reading = false;
|
||||
SetFlags(old_flags);
|
||||
|
||||
return *this;
|
||||
@@ -479,7 +479,7 @@ exit:
|
||||
wxSocketBase& wxSocketBase::Peek(void* buffer, wxUint32 nbytes)
|
||||
{
|
||||
// Mask read events
|
||||
m_reading = TRUE;
|
||||
m_reading = true;
|
||||
|
||||
m_lcount = _Read(buffer, nbytes);
|
||||
Pushback(buffer, m_lcount);
|
||||
@@ -491,7 +491,7 @@ wxSocketBase& wxSocketBase::Peek(void* buffer, wxUint32 nbytes)
|
||||
m_error = (m_lcount == 0);
|
||||
|
||||
// Allow read events again
|
||||
m_reading = FALSE;
|
||||
m_reading = false;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -499,7 +499,7 @@ wxSocketBase& wxSocketBase::Peek(void* buffer, wxUint32 nbytes)
|
||||
wxSocketBase& wxSocketBase::Write(const void *buffer, wxUint32 nbytes)
|
||||
{
|
||||
// Mask write events
|
||||
m_writing = TRUE;
|
||||
m_writing = true;
|
||||
|
||||
m_lcount = _Write(buffer, nbytes);
|
||||
|
||||
@@ -510,7 +510,7 @@ wxSocketBase& wxSocketBase::Write(const void *buffer, wxUint32 nbytes)
|
||||
m_error = (m_lcount == 0);
|
||||
|
||||
// Allow write events again
|
||||
m_writing = FALSE;
|
||||
m_writing = false;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -541,7 +541,7 @@ wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes)
|
||||
}
|
||||
else
|
||||
{
|
||||
bool more = TRUE;
|
||||
bool more = true;
|
||||
|
||||
while (more)
|
||||
{
|
||||
@@ -579,9 +579,9 @@ wxSocketBase& wxSocketBase::WriteMsg(const void *buffer, wxUint32 nbytes)
|
||||
} msg;
|
||||
|
||||
// Mask write events
|
||||
m_writing = TRUE;
|
||||
m_writing = true;
|
||||
|
||||
error = TRUE;
|
||||
error = true;
|
||||
total = 0;
|
||||
SetFlags((m_flags & wxSOCKET_BLOCK) | wxSOCKET_WAITALL);
|
||||
|
||||
@@ -613,12 +613,12 @@ wxSocketBase& wxSocketBase::WriteMsg(const void *buffer, wxUint32 nbytes)
|
||||
goto exit;
|
||||
|
||||
// everything was OK
|
||||
error = FALSE;
|
||||
error = false;
|
||||
|
||||
exit:
|
||||
m_error = error;
|
||||
m_lcount = total;
|
||||
m_writing = FALSE;
|
||||
m_writing = false;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -628,7 +628,7 @@ wxSocketBase& wxSocketBase::Unread(const void *buffer, wxUint32 nbytes)
|
||||
if (nbytes != 0)
|
||||
Pushback(buffer, nbytes);
|
||||
|
||||
m_error = FALSE;
|
||||
m_error = false;
|
||||
m_lcount = nbytes;
|
||||
|
||||
return *this;
|
||||
@@ -641,7 +641,7 @@ wxSocketBase& wxSocketBase::Discard()
|
||||
wxUint32 total = 0;
|
||||
|
||||
// Mask read events
|
||||
m_reading = TRUE;
|
||||
m_reading = true;
|
||||
|
||||
SetFlags(wxSOCKET_NOWAIT);
|
||||
|
||||
@@ -654,10 +654,10 @@ wxSocketBase& wxSocketBase::Discard()
|
||||
|
||||
delete[] buffer;
|
||||
m_lcount = total;
|
||||
m_error = FALSE;
|
||||
m_error = false;
|
||||
|
||||
// Allow read events again
|
||||
m_reading = FALSE;
|
||||
m_reading = false;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -679,12 +679,12 @@ bool wxSocketBase::_Wait(long seconds,
|
||||
GSocketEventFlags result;
|
||||
long timeout;
|
||||
|
||||
// Set this to TRUE to interrupt ongoing waits
|
||||
m_interrupt = FALSE;
|
||||
// Set this to true to interrupt ongoing waits
|
||||
m_interrupt = false;
|
||||
|
||||
// Check for valid socket
|
||||
if (!m_socket)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// Check for valid timeout value.
|
||||
if (seconds != -1)
|
||||
@@ -707,7 +707,7 @@ bool wxSocketBase::_Wait(long seconds,
|
||||
// we are just polling). Also, if just polling, do not yield.
|
||||
|
||||
wxStopWatch chrono;
|
||||
bool done = FALSE;
|
||||
bool done = false;
|
||||
|
||||
while (!done)
|
||||
{
|
||||
@@ -716,33 +716,33 @@ bool wxSocketBase::_Wait(long seconds,
|
||||
// Incoming connection (server) or connection established (client)
|
||||
if (result & GSOCK_CONNECTION_FLAG)
|
||||
{
|
||||
m_connected = TRUE;
|
||||
m_establishing = FALSE;
|
||||
return TRUE;
|
||||
m_connected = true;
|
||||
m_establishing = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Data available or output buffer ready
|
||||
if ((result & GSOCK_INPUT_FLAG) || (result & GSOCK_OUTPUT_FLAG))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Connection lost
|
||||
if (result & GSOCK_LOST_FLAG)
|
||||
{
|
||||
m_connected = FALSE;
|
||||
m_establishing = FALSE;
|
||||
m_connected = false;
|
||||
m_establishing = false;
|
||||
return (flags & GSOCK_LOST_FLAG) != 0;
|
||||
}
|
||||
|
||||
// Wait more?
|
||||
if ((!timeout) || (chrono.Time() > timeout) || (m_interrupt))
|
||||
done = TRUE;
|
||||
done = true;
|
||||
else
|
||||
PROCESS_EVENTS();
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSocketBase::Wait(long seconds, long milliseconds)
|
||||
@@ -757,11 +757,11 @@ bool wxSocketBase::WaitForRead(long seconds, long milliseconds)
|
||||
{
|
||||
// Check pushback buffer before entering _Wait
|
||||
if (m_unread)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
// Note that GSOCK_INPUT_LOST has to be explicitly passed to
|
||||
// _Wait becuase of the semantics of WaitForRead: a return
|
||||
// value of TRUE means that a GSocket_Read call will return
|
||||
// value of true means that a GSocket_Read call will return
|
||||
// immediately, not that there is actually data to read.
|
||||
|
||||
return _Wait(seconds, milliseconds, GSOCK_INPUT_FLAG |
|
||||
@@ -792,19 +792,19 @@ bool wxSocketBase::GetPeer(wxSockAddress& addr_man) const
|
||||
GAddress *peer;
|
||||
|
||||
if (!m_socket)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
peer = m_socket->GetPeer();
|
||||
|
||||
// copying a null address would just trigger an assert anyway
|
||||
|
||||
if (!peer)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
addr_man.SetAddress(peer);
|
||||
GAddress_destroy(peer);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSocketBase::GetLocal(wxSockAddress& addr_man) const
|
||||
@@ -812,13 +812,13 @@ bool wxSocketBase::GetLocal(wxSockAddress& addr_man) const
|
||||
GAddress *local;
|
||||
|
||||
if (!m_socket)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
local = m_socket->GetLocal();
|
||||
addr_man.SetAddress(local);
|
||||
GAddress_destroy(local);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -919,8 +919,8 @@ void wxSocketBase::OnRequest(wxSocketNotify notification)
|
||||
switch(notification)
|
||||
{
|
||||
case wxSOCKET_CONNECTION:
|
||||
m_establishing = FALSE;
|
||||
m_connected = TRUE;
|
||||
m_establishing = false;
|
||||
m_connected = true;
|
||||
break;
|
||||
|
||||
// If we are in the middle of a R/W operation, do not
|
||||
@@ -938,8 +938,8 @@ void wxSocketBase::OnRequest(wxSocketNotify notification)
|
||||
break;
|
||||
|
||||
case wxSOCKET_LOST:
|
||||
m_connected = FALSE;
|
||||
m_establishing = FALSE;
|
||||
m_connected = false;
|
||||
m_establishing = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1068,7 +1068,7 @@ wxSocketServer::wxSocketServer(wxSockAddress& addr_man,
|
||||
// Setup the socket as server
|
||||
|
||||
m_socket->SetLocal(addr_man.GetAddress());
|
||||
|
||||
|
||||
if (GetFlags() & wxSOCKET_REUSEADDR) {
|
||||
m_socket->SetReusable();
|
||||
}
|
||||
@@ -1097,9 +1097,9 @@ bool wxSocketServer::AcceptWith(wxSocketBase& sock, bool wait)
|
||||
GSocket *child_socket;
|
||||
|
||||
if (!m_socket)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// If wait == FALSE, then the call should be nonblocking.
|
||||
// If wait == false, then the call should be nonblocking.
|
||||
// When we are finished, we put the socket to blocking mode
|
||||
// again.
|
||||
|
||||
@@ -1112,18 +1112,18 @@ bool wxSocketServer::AcceptWith(wxSocketBase& sock, bool wait)
|
||||
m_socket->SetNonBlocking(0);
|
||||
|
||||
if (!child_socket)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
sock.m_type = wxSOCKET_BASE;
|
||||
sock.m_socket = child_socket;
|
||||
sock.m_connected = TRUE;
|
||||
sock.m_connected = true;
|
||||
|
||||
sock.m_socket->SetTimeout(sock.m_timeout * 1000);
|
||||
sock.m_socket->SetCallback(GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG |
|
||||
GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG,
|
||||
wx_socket_callback, (char *)&sock);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxSocketBase *wxSocketServer::Accept(bool wait)
|
||||
@@ -1151,9 +1151,9 @@ bool wxSocketBase::GetOption(int level, int optname, void *optval, int *optlen)
|
||||
if (m_socket->GetSockOpt(level, optname, optval, optlen)
|
||||
!= GSOCK_NOERROR)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSocketBase::SetOption(int level, int optname, const void *optval,
|
||||
@@ -1162,9 +1162,9 @@ bool wxSocketBase::SetOption(int level, int optname, const void *optval,
|
||||
if (m_socket->SetSockOpt(level, optname, optval, optlen)
|
||||
!= GSOCK_NOERROR)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
@@ -1200,18 +1200,18 @@ bool wxSocketClient::Connect(wxSockAddress& addr_man, bool wait)
|
||||
}
|
||||
|
||||
m_socket = GSocket_new();
|
||||
m_connected = FALSE;
|
||||
m_establishing = FALSE;
|
||||
m_connected = false;
|
||||
m_establishing = false;
|
||||
|
||||
if (!m_socket)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_socket->SetTimeout(m_timeout * 1000);
|
||||
m_socket->SetCallback(GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG |
|
||||
GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG,
|
||||
wx_socket_callback, (char *)this);
|
||||
|
||||
// If wait == FALSE, then the call should be nonblocking.
|
||||
// If wait == false, then the call should be nonblocking.
|
||||
// When we are finished, we put the socket to blocking mode
|
||||
// again.
|
||||
|
||||
@@ -1227,22 +1227,22 @@ bool wxSocketClient::Connect(wxSockAddress& addr_man, bool wait)
|
||||
if (err != GSOCK_NOERROR)
|
||||
{
|
||||
if (err == GSOCK_WOULDBLOCK)
|
||||
m_establishing = TRUE;
|
||||
m_establishing = true;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_connected = TRUE;
|
||||
return TRUE;
|
||||
m_connected = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSocketClient::WaitOnConnect(long seconds, long milliseconds)
|
||||
{
|
||||
if (m_connected) // Already connected
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (!m_establishing || !m_socket) // No connection in progress
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return _Wait(seconds, milliseconds, GSOCK_CONNECTION_FLAG |
|
||||
GSOCK_LOST_FLAG);
|
||||
@@ -1276,8 +1276,8 @@ wxDatagramSocket::wxDatagramSocket( wxSockAddress& addr,
|
||||
}
|
||||
|
||||
// Initialize all stuff
|
||||
m_connected = FALSE;
|
||||
m_establishing = FALSE;
|
||||
m_connected = false;
|
||||
m_establishing = false;
|
||||
m_socket->SetTimeout( m_timeout );
|
||||
m_socket->SetCallback( GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG |
|
||||
GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG,
|
||||
@@ -1313,7 +1313,7 @@ public:
|
||||
virtual bool OnInit()
|
||||
{
|
||||
// wxSocketBase will call GSocket_Init() itself when/if needed
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void OnExit()
|
||||
|
||||
@@ -99,7 +99,7 @@ void wxStatusBarBase::SetFieldsCount(int number, const int *widths)
|
||||
{
|
||||
wxCHECK_RET( number > 0, _T("invalid field number in SetFieldsCount") );
|
||||
|
||||
bool refresh = FALSE;
|
||||
bool refresh = false;
|
||||
|
||||
if ( number != m_nFields )
|
||||
{
|
||||
@@ -152,7 +152,7 @@ void wxStatusBarBase::SetFieldsCount(int number, const int *widths)
|
||||
|
||||
ReinitWidths();
|
||||
|
||||
refresh = TRUE;
|
||||
refresh = true;
|
||||
}
|
||||
//else: keep the old m_statusWidths if we had them
|
||||
|
||||
@@ -161,7 +161,7 @@ void wxStatusBarBase::SetFieldsCount(int number, const int *widths)
|
||||
SetStatusWidths(number, widths);
|
||||
|
||||
// already done from SetStatusWidths()
|
||||
refresh = FALSE;
|
||||
refresh = false;
|
||||
}
|
||||
|
||||
if ( refresh )
|
||||
|
||||
@@ -158,7 +158,7 @@ wxString wxGetStockLabel(wxWindowID id)
|
||||
};
|
||||
|
||||
#undef STOCKITEM
|
||||
|
||||
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
@@ -171,11 +171,11 @@ bool wxIsStockLabel(wxWindowID id, const wxString& label)
|
||||
|
||||
if (label == stock)
|
||||
return true;
|
||||
|
||||
|
||||
stock.Replace(_T("&"), wxEmptyString);
|
||||
if (label == stock)
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ const char *wxGetStockGtkID(wxWindowID id)
|
||||
#define STOCKITEM(wx,gtk) \
|
||||
case wx: \
|
||||
return gtk;
|
||||
|
||||
|
||||
#define STOCKITEM_MISSING(wx) \
|
||||
case wx: \
|
||||
return NULL;
|
||||
@@ -259,7 +259,7 @@ const char *wxGetStockGtkID(wxWindowID id)
|
||||
};
|
||||
|
||||
#undef STOCKITEM
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ wxLongLong wxGetLocalTimeMillis()
|
||||
wxLongLong now( nowft.dwHighDateTime, nowft.dwLowDateTime ); // time in 100 nanoseconds
|
||||
|
||||
return ( now - then ) / 10000.0; // time from 00:00:00 Jan 1st 1970 to now in milliseconds
|
||||
|
||||
|
||||
#elif defined(HAVE_GETTIMEOFDAY)
|
||||
struct timeval tp;
|
||||
if ( wxGetTimeOfDay(&tp, (struct timezone *)NULL) != -1 )
|
||||
@@ -244,7 +244,7 @@ wxLongLong wxGetLocalTimeMillis()
|
||||
val *= tp.time;
|
||||
return (val + tp.millitm);
|
||||
#elif defined(__WXMAC__)
|
||||
|
||||
|
||||
static UInt64 gMilliAtStart = 0;
|
||||
|
||||
Nanoseconds upTime = AbsoluteToNanoseconds( UpTime() );
|
||||
|
||||
@@ -1121,7 +1121,7 @@ size_t wxMBConv_iconv::WC2MB(char *buf, const wchar_t *psz, size_t n) const
|
||||
#ifdef wxHAVE_WIN32_MB2WC
|
||||
|
||||
// from utils.cpp
|
||||
#if wxUSE_FONTMAP
|
||||
#if wxUSE_FONTMAP
|
||||
extern WXDLLIMPEXP_BASE long wxCharsetToCodepage(const wxChar *charset);
|
||||
extern WXDLLIMPEXP_BASE long wxEncodingToCodepage(wxFontEncoding encoding);
|
||||
#endif
|
||||
@@ -1177,7 +1177,7 @@ public:
|
||||
quality approximations such as turning "1/2" symbol (U+00BD) into
|
||||
"1" for the code pages which don't have it and we, obviously, want
|
||||
to avoid this at any price
|
||||
|
||||
|
||||
the trouble is that this function does it _silently_, i.e. it won't
|
||||
even tell us whether it did or not... Win98/2000 and higher provide
|
||||
WC_NO_BEST_FIT_CHARS but it doesn't work for the older systems and
|
||||
@@ -1302,127 +1302,127 @@ public:
|
||||
|
||||
wxMBConv_mac(const wxChar* name)
|
||||
{
|
||||
Init( wxMacGetSystemEncFromFontEnc(wxFontMapper::Get()->CharsetToEncoding(name, FALSE) ) ) ;
|
||||
Init( wxMacGetSystemEncFromFontEnc(wxFontMapper::Get()->CharsetToEncoding(name, false) ) ) ;
|
||||
}
|
||||
|
||||
wxMBConv_mac(wxFontEncoding encoding)
|
||||
{
|
||||
Init( wxMacGetSystemEncFromFontEnc(encoding) );
|
||||
Init( wxMacGetSystemEncFromFontEnc(encoding) );
|
||||
}
|
||||
|
||||
~wxMBConv_mac()
|
||||
{
|
||||
OSStatus status = noErr ;
|
||||
status = TECDisposeConverter(m_MB2WC_converter);
|
||||
status = TECDisposeConverter(m_WC2MB_converter);
|
||||
}
|
||||
|
||||
|
||||
void Init( TextEncodingBase encoding)
|
||||
{
|
||||
OSStatus status = noErr ;
|
||||
m_char_encoding = encoding ;
|
||||
m_unicode_encoding = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ;
|
||||
|
||||
status = TECCreateConverter(&m_MB2WC_converter,
|
||||
m_char_encoding,
|
||||
m_unicode_encoding);
|
||||
status = TECCreateConverter(&m_WC2MB_converter,
|
||||
m_unicode_encoding,
|
||||
m_char_encoding);
|
||||
}
|
||||
|
||||
~wxMBConv_mac()
|
||||
{
|
||||
OSStatus status = noErr ;
|
||||
status = TECDisposeConverter(m_MB2WC_converter);
|
||||
status = TECDisposeConverter(m_WC2MB_converter);
|
||||
}
|
||||
|
||||
|
||||
void Init( TextEncodingBase encoding)
|
||||
{
|
||||
OSStatus status = noErr ;
|
||||
m_char_encoding = encoding ;
|
||||
m_unicode_encoding = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ;
|
||||
|
||||
status = TECCreateConverter(&m_MB2WC_converter,
|
||||
m_char_encoding,
|
||||
m_unicode_encoding);
|
||||
status = TECCreateConverter(&m_WC2MB_converter,
|
||||
m_unicode_encoding,
|
||||
m_char_encoding);
|
||||
}
|
||||
|
||||
size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const
|
||||
{
|
||||
OSStatus status = noErr ;
|
||||
ByteCount byteOutLen ;
|
||||
ByteCount byteInLen = strlen(psz) ;
|
||||
wchar_t *tbuf = NULL ;
|
||||
UniChar* ubuf = NULL ;
|
||||
size_t res = 0 ;
|
||||
|
||||
if (buf == NULL)
|
||||
{
|
||||
n = byteInLen ;
|
||||
tbuf = (wchar_t*) malloc( n * SIZEOF_WCHAR_T) ;
|
||||
}
|
||||
ByteCount byteBufferLen = n * sizeof( UniChar ) ;
|
||||
OSStatus status = noErr ;
|
||||
ByteCount byteOutLen ;
|
||||
ByteCount byteInLen = strlen(psz) ;
|
||||
wchar_t *tbuf = NULL ;
|
||||
UniChar* ubuf = NULL ;
|
||||
size_t res = 0 ;
|
||||
|
||||
if (buf == NULL)
|
||||
{
|
||||
n = byteInLen ;
|
||||
tbuf = (wchar_t*) malloc( n * SIZEOF_WCHAR_T) ;
|
||||
}
|
||||
ByteCount byteBufferLen = n * sizeof( UniChar ) ;
|
||||
#if SIZEOF_WCHAR_T == 4
|
||||
ubuf = (UniChar*) malloc( byteBufferLen + 2 ) ;
|
||||
ubuf = (UniChar*) malloc( byteBufferLen + 2 ) ;
|
||||
#else
|
||||
ubuf = (UniChar*) (buf ? buf : tbuf) ;
|
||||
ubuf = (UniChar*) (buf ? buf : tbuf) ;
|
||||
#endif
|
||||
status = TECConvertText(m_MB2WC_converter, (ConstTextPtr) psz , byteInLen, &byteInLen,
|
||||
(TextPtr) ubuf , byteBufferLen, &byteOutLen);
|
||||
status = TECConvertText(m_MB2WC_converter, (ConstTextPtr) psz , byteInLen, &byteInLen,
|
||||
(TextPtr) ubuf , byteBufferLen, &byteOutLen);
|
||||
#if SIZEOF_WCHAR_T == 4
|
||||
// we have to terminate here, because n might be larger for the trailing zero, and if UniChar
|
||||
// is not properly terminated we get random characters at the end
|
||||
ubuf[byteOutLen / sizeof( UniChar ) ] = 0 ;
|
||||
wxMBConvUTF16BE converter ;
|
||||
res = converter.MB2WC( (buf ? buf : tbuf) , (const char*)ubuf , n ) ;
|
||||
free( ubuf ) ;
|
||||
wxMBConvUTF16BE converter ;
|
||||
res = converter.MB2WC( (buf ? buf : tbuf) , (const char*)ubuf , n ) ;
|
||||
free( ubuf ) ;
|
||||
#else
|
||||
res = byteOutLen / sizeof( UniChar ) ;
|
||||
res = byteOutLen / sizeof( UniChar ) ;
|
||||
#endif
|
||||
if ( buf == NULL )
|
||||
free(tbuf) ;
|
||||
if ( buf == NULL )
|
||||
free(tbuf) ;
|
||||
|
||||
if ( buf && res < n)
|
||||
buf[res] = 0;
|
||||
|
||||
return res ;
|
||||
return res ;
|
||||
}
|
||||
|
||||
size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const
|
||||
{
|
||||
OSStatus status = noErr ;
|
||||
ByteCount byteOutLen ;
|
||||
ByteCount byteInLen = wxWcslen(psz) * SIZEOF_WCHAR_T ;
|
||||
{
|
||||
OSStatus status = noErr ;
|
||||
ByteCount byteOutLen ;
|
||||
ByteCount byteInLen = wxWcslen(psz) * SIZEOF_WCHAR_T ;
|
||||
|
||||
char *tbuf = NULL ;
|
||||
|
||||
if (buf == NULL)
|
||||
{
|
||||
// worst case
|
||||
n = byteInLen * 2 ;
|
||||
tbuf = (char*) malloc( n ) ;
|
||||
}
|
||||
char *tbuf = NULL ;
|
||||
|
||||
ByteCount byteBufferLen = n ;
|
||||
UniChar* ubuf = NULL ;
|
||||
if (buf == NULL)
|
||||
{
|
||||
// worst case
|
||||
n = byteInLen * 2 ;
|
||||
tbuf = (char*) malloc( n ) ;
|
||||
}
|
||||
|
||||
ByteCount byteBufferLen = n ;
|
||||
UniChar* ubuf = NULL ;
|
||||
#if SIZEOF_WCHAR_T == 4
|
||||
wxMBConvUTF16BE converter ;
|
||||
size_t unicharlen = converter.WC2MB( NULL , psz , 0 ) ;
|
||||
byteInLen = unicharlen ;
|
||||
ubuf = (UniChar*) malloc( byteInLen + 2 ) ;
|
||||
converter.WC2MB( (char*) ubuf , psz, unicharlen + 2 ) ;
|
||||
wxMBConvUTF16BE converter ;
|
||||
size_t unicharlen = converter.WC2MB( NULL , psz , 0 ) ;
|
||||
byteInLen = unicharlen ;
|
||||
ubuf = (UniChar*) malloc( byteInLen + 2 ) ;
|
||||
converter.WC2MB( (char*) ubuf , psz, unicharlen + 2 ) ;
|
||||
#else
|
||||
ubuf = (UniChar*) psz ;
|
||||
ubuf = (UniChar*) psz ;
|
||||
#endif
|
||||
status = TECConvertText(m_WC2MB_converter, (ConstTextPtr) ubuf , byteInLen, &byteInLen,
|
||||
(TextPtr) (buf ? buf : tbuf) , byteBufferLen, &byteOutLen);
|
||||
status = TECConvertText(m_WC2MB_converter, (ConstTextPtr) ubuf , byteInLen, &byteInLen,
|
||||
(TextPtr) (buf ? buf : tbuf) , byteBufferLen, &byteOutLen);
|
||||
#if SIZEOF_WCHAR_T == 4
|
||||
free( ubuf ) ;
|
||||
free( ubuf ) ;
|
||||
#endif
|
||||
if ( buf == NULL )
|
||||
free(tbuf) ;
|
||||
if ( buf == NULL )
|
||||
free(tbuf) ;
|
||||
|
||||
size_t res = byteOutLen ;
|
||||
size_t res = byteOutLen ;
|
||||
if ( buf && res < n)
|
||||
buf[res] = 0;
|
||||
|
||||
return res ;
|
||||
return res ;
|
||||
}
|
||||
|
||||
bool IsOk() const
|
||||
{ return m_MB2WC_converter != NULL && m_WC2MB_converter != NULL ; }
|
||||
|
||||
private:
|
||||
TECObjectRef m_MB2WC_converter ;
|
||||
TECObjectRef m_WC2MB_converter ;
|
||||
|
||||
TextEncodingBase m_char_encoding ;
|
||||
TextEncodingBase m_unicode_encoding ;
|
||||
TECObjectRef m_MB2WC_converter ;
|
||||
TECObjectRef m_WC2MB_converter ;
|
||||
|
||||
TextEncodingBase m_char_encoding ;
|
||||
TextEncodingBase m_unicode_encoding ;
|
||||
};
|
||||
|
||||
#endif // defined(__WXMAC__) && defined(TARGET_CARBON)
|
||||
@@ -1626,18 +1626,18 @@ wxMBConv *wxCSConv::DoCreate() const
|
||||
#endif
|
||||
}
|
||||
#endif // wxHAVE_WIN32_MB2WC
|
||||
#if defined(__WXMAC__)
|
||||
#if defined(__WXMAC__)
|
||||
{
|
||||
if ( m_name || ( m_encoding < wxFONTENCODING_UTF16BE ) )
|
||||
{
|
||||
|
||||
wxMBConv_mac *conv = m_name ? new wxMBConv_mac(m_name)
|
||||
: new wxMBConv_mac(m_encoding);
|
||||
if ( conv->IsOk() )
|
||||
return conv;
|
||||
if ( m_name || ( m_encoding < wxFONTENCODING_UTF16BE ) )
|
||||
{
|
||||
|
||||
delete conv;
|
||||
}
|
||||
wxMBConv_mac *conv = m_name ? new wxMBConv_mac(m_name)
|
||||
: new wxMBConv_mac(m_encoding);
|
||||
if ( conv->IsOk() )
|
||||
return conv;
|
||||
|
||||
delete conv;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// step (2)
|
||||
|
||||
@@ -70,14 +70,14 @@ void wxStreamBuffer::InitBuffer()
|
||||
m_buffer_size = 0;
|
||||
|
||||
// if we are going to allocate the buffer, we should free it later as well
|
||||
m_destroybuf = TRUE;
|
||||
m_destroybuf = true;
|
||||
}
|
||||
|
||||
void wxStreamBuffer::Init()
|
||||
{
|
||||
InitBuffer();
|
||||
|
||||
m_fixed = TRUE;
|
||||
m_fixed = true;
|
||||
}
|
||||
|
||||
wxStreamBuffer::wxStreamBuffer(BufMode mode)
|
||||
@@ -87,7 +87,7 @@ wxStreamBuffer::wxStreamBuffer(BufMode mode)
|
||||
m_stream = NULL;
|
||||
m_mode = mode;
|
||||
|
||||
m_flushable = FALSE;
|
||||
m_flushable = false;
|
||||
}
|
||||
|
||||
wxStreamBuffer::wxStreamBuffer(wxStreamBase& stream, BufMode mode)
|
||||
@@ -97,7 +97,7 @@ wxStreamBuffer::wxStreamBuffer(wxStreamBase& stream, BufMode mode)
|
||||
m_stream = &stream;
|
||||
m_mode = mode;
|
||||
|
||||
m_flushable = TRUE;
|
||||
m_flushable = true;
|
||||
}
|
||||
|
||||
wxStreamBuffer::wxStreamBuffer(const wxStreamBuffer& buffer)
|
||||
@@ -115,7 +115,7 @@ wxStreamBuffer::wxStreamBuffer(const wxStreamBuffer& buffer)
|
||||
m_flushable = buffer.m_flushable;
|
||||
m_stream = buffer.m_stream;
|
||||
m_mode = buffer.m_mode;
|
||||
m_destroybuf = FALSE;
|
||||
m_destroybuf = false;
|
||||
}
|
||||
|
||||
void wxStreamBuffer::FreeBuffer()
|
||||
@@ -172,7 +172,7 @@ void wxStreamBuffer::SetBufferIO(size_t bufsize)
|
||||
|
||||
if ( bufsize )
|
||||
{
|
||||
SetBufferIO(malloc(bufsize), bufsize, TRUE /* take ownership */);
|
||||
SetBufferIO(malloc(bufsize), bufsize, true /* take ownership */);
|
||||
}
|
||||
else // no buffer size => no buffer
|
||||
{
|
||||
@@ -198,41 +198,41 @@ bool wxStreamBuffer::FillBuffer()
|
||||
{
|
||||
wxInputStream *inStream = GetInputStream();
|
||||
|
||||
// It's legal to have no stream, so we don't complain about it just return FALSE
|
||||
// It's legal to have no stream, so we don't complain about it just return false
|
||||
if ( !inStream )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
size_t count = inStream->OnSysRead(m_buffer_start, m_buffer_size);
|
||||
if ( !count )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_buffer_end = m_buffer_start + count;
|
||||
m_buffer_pos = m_buffer_start;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// write the buffer contents to the stream (only for write buffers)
|
||||
bool wxStreamBuffer::FlushBuffer()
|
||||
{
|
||||
wxCHECK_MSG( m_flushable, FALSE, _T("can't flush this buffer") );
|
||||
wxCHECK_MSG( m_flushable, false, _T("can't flush this buffer") );
|
||||
|
||||
// FIXME: what is this check for? (VZ)
|
||||
if ( m_buffer_pos == m_buffer_start )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
wxOutputStream *outStream = GetOutputStream();
|
||||
|
||||
wxCHECK_MSG( outStream, FALSE, _T("should have a stream in wxStreamBuffer") );
|
||||
wxCHECK_MSG( outStream, false, _T("should have a stream in wxStreamBuffer") );
|
||||
|
||||
size_t current = m_buffer_pos - m_buffer_start;
|
||||
size_t count = outStream->OnSysWrite(m_buffer_start, current);
|
||||
if ( count != current )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_buffer_pos = m_buffer_start;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t wxStreamBuffer::GetDataLeft()
|
||||
@@ -767,7 +767,7 @@ size_t wxInputStream::Ungetch(const void *buf, size_t bufsize)
|
||||
if (!ptrback)
|
||||
return 0;
|
||||
|
||||
// Eof() shouldn't return TRUE any longer
|
||||
// Eof() shouldn't return true any longer
|
||||
if ( m_lasterror == wxSTREAM_EOF )
|
||||
m_lasterror = wxSTREAM_NO_ERROR;
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ bool wxStringBase::AllocBuffer(size_t nLen)
|
||||
|
||||
if ( pData == NULL ) {
|
||||
// allocation failures are handled by the caller
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
pData->nRefs = 1;
|
||||
@@ -258,7 +258,7 @@ bool wxStringBase::AllocBuffer(size_t nLen)
|
||||
pData->nAllocLength = nLen + EXTRA_ALLOC;
|
||||
m_pchData = pData->data(); // data starts after wxStringData
|
||||
m_pchData[nLen] = wxT('\0');
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// must be called before changing this string
|
||||
@@ -271,14 +271,14 @@ bool wxStringBase::CopyBeforeWrite()
|
||||
size_t nLen = pData->nDataLength;
|
||||
if ( !AllocBuffer(nLen) ) {
|
||||
// allocation failures are handled by the caller
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
memcpy(m_pchData, pData->data(), nLen*sizeof(wxChar));
|
||||
}
|
||||
|
||||
wxASSERT( !GetStringData()->IsShared() ); // we must be the only owner
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// must be called before replacing contents of this string
|
||||
@@ -293,7 +293,7 @@ bool wxStringBase::AllocBeforeWrite(size_t nLen)
|
||||
pData->Unlock();
|
||||
if ( !AllocBuffer(nLen) ) {
|
||||
// allocation failures are handled by the caller
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -310,7 +310,7 @@ bool wxStringBase::AllocBeforeWrite(size_t nLen)
|
||||
if ( pData == NULL ) {
|
||||
// allocation failures are handled by the caller
|
||||
// keep previous data since reallocation failed
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
pData->nAllocLength = nLen;
|
||||
@@ -323,7 +323,7 @@ bool wxStringBase::AllocBeforeWrite(size_t nLen)
|
||||
|
||||
wxASSERT( !GetStringData()->IsShared() ); // we must be the only owner
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxStringBase& wxStringBase::append(size_t n, wxChar ch)
|
||||
@@ -368,7 +368,7 @@ bool wxStringBase::Alloc(size_t nLen)
|
||||
|
||||
if ( pData == NULL ) {
|
||||
// allocation failure handled by caller
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
pData->nRefs = 1;
|
||||
@@ -382,7 +382,7 @@ bool wxStringBase::Alloc(size_t nLen)
|
||||
size_t nOldLen = pData->nDataLength;
|
||||
if ( !AllocBuffer(nLen) ) {
|
||||
// allocation failure handled by caller
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
memcpy(m_pchData, pData->data(), nOldLen*sizeof(wxChar));
|
||||
}
|
||||
@@ -395,7 +395,7 @@ bool wxStringBase::Alloc(size_t nLen)
|
||||
if ( pData == NULL ) {
|
||||
// allocation failure handled by caller
|
||||
// keep previous data since reallocation failed
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// it's not important if the pointer changed or not (the check for this
|
||||
@@ -405,9 +405,9 @@ bool wxStringBase::Alloc(size_t nLen)
|
||||
}
|
||||
}
|
||||
//else: we've already got enough
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
wxStringBase::iterator wxStringBase::begin()
|
||||
{
|
||||
if (length() > 0)
|
||||
@@ -522,7 +522,7 @@ size_t wxStringBase::rfind(const wxStringBase& str, size_t nStart) const
|
||||
}
|
||||
} while ( cursor-- > c_str() );
|
||||
}
|
||||
|
||||
|
||||
return npos;
|
||||
}
|
||||
|
||||
@@ -773,13 +773,13 @@ bool wxStringBase::AssignCopy(size_t nSrcLen, const wxChar *pszSrcData)
|
||||
else {
|
||||
if ( !AllocBeforeWrite(nSrcLen) ) {
|
||||
// allocation failure handled by caller
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
memcpy(m_pchData, pszSrcData, nSrcLen*sizeof(wxChar));
|
||||
GetStringData()->nDataLength = nSrcLen;
|
||||
m_pchData[nSrcLen] = wxT('\0');
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -808,7 +808,7 @@ bool wxStringBase::ConcatSelf(size_t nSrcLen, const wxChar *pszSrcData,
|
||||
wxStringData* pOldData = GetStringData();
|
||||
if ( !AllocBuffer(nNewLen) ) {
|
||||
// allocation failure handled by caller
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
memcpy(m_pchData, pOldData->data(), nLen*sizeof(wxChar));
|
||||
pOldData->Unlock();
|
||||
@@ -820,7 +820,7 @@ bool wxStringBase::ConcatSelf(size_t nSrcLen, const wxChar *pszSrcData,
|
||||
// we have to grow the buffer
|
||||
if ( capacity() < nNewLen ) {
|
||||
// allocation failure handled by caller
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -839,7 +839,7 @@ bool wxStringBase::ConcatSelf(size_t nSrcLen, const wxChar *pszSrcData,
|
||||
GetStringData()->nDataLength = nNewLen; // and fix the length
|
||||
}
|
||||
//else: the string to append was empty
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -855,11 +855,11 @@ bool wxStringBase::AllocCopy(wxString& dest, int nCopyLen, int nCopyIndex) const
|
||||
else {
|
||||
if ( !dest.AllocBuffer(nCopyLen) ) {
|
||||
// allocation failure handled by caller
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
memcpy(dest.m_pchData, m_pchData + nCopyIndex, nCopyLen*sizeof(wxChar));
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // !wxUSE_STL
|
||||
@@ -975,7 +975,7 @@ wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength)
|
||||
inBuf = tmp;
|
||||
psz = inBuf.data();
|
||||
}
|
||||
|
||||
|
||||
// first get the size of the buffer we need
|
||||
size_t nLen;
|
||||
if ( psz )
|
||||
@@ -1033,7 +1033,7 @@ wxString::wxString(const wchar_t *pwz, wxMBConv& conv, size_t nLength)
|
||||
inBuf = tmp;
|
||||
pwz = inBuf.data();
|
||||
}
|
||||
|
||||
|
||||
// first get the size of the buffer we need
|
||||
size_t nLen;
|
||||
if ( pwz )
|
||||
@@ -1092,7 +1092,7 @@ wxChar *wxString::GetWriteBuf(size_t nLen)
|
||||
}
|
||||
|
||||
wxASSERT( GetStringData()->nRefs == 1 );
|
||||
GetStringData()->Validate(FALSE);
|
||||
GetStringData()->Validate(false);
|
||||
|
||||
return m_pchData;
|
||||
}
|
||||
@@ -1101,13 +1101,13 @@ wxChar *wxString::GetWriteBuf(size_t nLen)
|
||||
void wxString::UngetWriteBuf()
|
||||
{
|
||||
GetStringData()->nDataLength = wxStrlen(m_pchData);
|
||||
GetStringData()->Validate(TRUE);
|
||||
GetStringData()->Validate(true);
|
||||
}
|
||||
|
||||
void wxString::UngetWriteBuf(size_t nLen)
|
||||
{
|
||||
GetStringData()->nDataLength = nLen;
|
||||
GetStringData()->Validate(TRUE);
|
||||
GetStringData()->Validate(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1312,7 +1312,7 @@ wxString wxString::Mid(size_t nFirst, size_t nCount) const
|
||||
}
|
||||
|
||||
// check that the string starts with prefix and return the rest of the string
|
||||
// in the provided pointer if it is not NULL, otherwise return FALSE
|
||||
// in the provided pointer if it is not NULL, otherwise return false
|
||||
bool wxString::StartsWith(const wxChar *prefix, wxString *rest) const
|
||||
{
|
||||
wxASSERT_MSG( prefix, _T("invalid parameter in wxString::StartsWith") );
|
||||
@@ -1327,7 +1327,7 @@ bool wxString::StartsWith(const wxChar *prefix, wxString *rest) const
|
||||
if ( *prefix++ != *p++ )
|
||||
{
|
||||
// no match
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1337,7 +1337,7 @@ bool wxString::StartsWith(const wxChar *prefix, wxString *rest) const
|
||||
*rest = p;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// extract nCount last (rightmost) characters
|
||||
@@ -1358,7 +1358,7 @@ wxString wxString::Right(size_t nCount) const
|
||||
wxString wxString::AfterLast(wxChar ch) const
|
||||
{
|
||||
wxString str;
|
||||
int iPos = Find(ch, TRUE);
|
||||
int iPos = Find(ch, true);
|
||||
if ( iPos == wxNOT_FOUND )
|
||||
str = *this;
|
||||
else
|
||||
@@ -1394,7 +1394,7 @@ wxString wxString::BeforeFirst(wxChar ch) const
|
||||
wxString wxString::BeforeLast(wxChar ch) const
|
||||
{
|
||||
wxString str;
|
||||
int iPos = Find(ch, TRUE);
|
||||
int iPos = Find(ch, true);
|
||||
if ( iPos != wxNOT_FOUND && iPos != 0 )
|
||||
str = wxString(c_str(), iPos);
|
||||
|
||||
@@ -1469,20 +1469,20 @@ bool wxString::IsAscii() const
|
||||
{
|
||||
const wxChar *s = (const wxChar*) *this;
|
||||
while(*s){
|
||||
if(!isascii(*s)) return(FALSE);
|
||||
if(!isascii(*s)) return(false);
|
||||
s++;
|
||||
}
|
||||
return(TRUE);
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool wxString::IsWord() const
|
||||
{
|
||||
const wxChar *s = (const wxChar*) *this;
|
||||
while(*s){
|
||||
if(!wxIsalpha(*s)) return(FALSE);
|
||||
if(!wxIsalpha(*s)) return(false);
|
||||
s++;
|
||||
}
|
||||
return(TRUE);
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool wxString::IsNumber() const
|
||||
@@ -1491,17 +1491,17 @@ bool wxString::IsNumber() const
|
||||
if (wxStrlen(s))
|
||||
if ((s[0] == '-') || (s[0] == '+')) s++;
|
||||
while(*s){
|
||||
if(!wxIsdigit(*s)) return(FALSE);
|
||||
if(!wxIsdigit(*s)) return(false);
|
||||
s++;
|
||||
}
|
||||
return(TRUE);
|
||||
return(true);
|
||||
}
|
||||
|
||||
wxString wxString::Strip(stripType w) const
|
||||
{
|
||||
wxString s = *this;
|
||||
if ( w & leading ) s.Trim(FALSE);
|
||||
if ( w & trailing ) s.Trim(TRUE);
|
||||
if ( w & leading ) s.Trim(false);
|
||||
if ( w & trailing ) s.Trim(true);
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -1529,7 +1529,7 @@ wxString& wxString::MakeLower()
|
||||
// trimming and padding
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// some compilers (VC++ 6.0 not to name them) return TRUE for a call to
|
||||
// some compilers (VC++ 6.0 not to name them) return true for a call to
|
||||
// isspace('<27>') in the C locale which seems to be broken to me, but we have to
|
||||
// live with this by checking that the character is a 7 bit one - even if this
|
||||
// may fail to detect some spaces (I don't know if Unicode doesn't have
|
||||
@@ -1627,41 +1627,41 @@ int wxString::Find(const wxChar *pszSub) const
|
||||
|
||||
bool wxString::ToLong(long *val, int base) const
|
||||
{
|
||||
wxCHECK_MSG( val, FALSE, _T("NULL pointer in wxString::ToLong") );
|
||||
wxCHECK_MSG( val, false, _T("NULL pointer in wxString::ToLong") );
|
||||
wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") );
|
||||
|
||||
const wxChar *start = c_str();
|
||||
wxChar *end;
|
||||
*val = wxStrtol(start, &end, base);
|
||||
|
||||
// return TRUE only if scan was stopped by the terminating NUL and if the
|
||||
// return true only if scan was stopped by the terminating NUL and if the
|
||||
// string was not empty to start with
|
||||
return !*end && (end != start);
|
||||
}
|
||||
|
||||
bool wxString::ToULong(unsigned long *val, int base) const
|
||||
{
|
||||
wxCHECK_MSG( val, FALSE, _T("NULL pointer in wxString::ToULong") );
|
||||
wxCHECK_MSG( val, false, _T("NULL pointer in wxString::ToULong") );
|
||||
wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") );
|
||||
|
||||
const wxChar *start = c_str();
|
||||
wxChar *end;
|
||||
*val = wxStrtoul(start, &end, base);
|
||||
|
||||
// return TRUE only if scan was stopped by the terminating NUL and if the
|
||||
// return true only if scan was stopped by the terminating NUL and if the
|
||||
// string was not empty to start with
|
||||
return !*end && (end != start);
|
||||
}
|
||||
|
||||
bool wxString::ToDouble(double *val) const
|
||||
{
|
||||
wxCHECK_MSG( val, FALSE, _T("NULL pointer in wxString::ToDouble") );
|
||||
wxCHECK_MSG( val, false, _T("NULL pointer in wxString::ToDouble") );
|
||||
|
||||
const wxChar *start = c_str();
|
||||
wxChar *end;
|
||||
*val = wxStrtod(start, &end);
|
||||
|
||||
// return TRUE only if scan was stopped by the terminating NUL and if the
|
||||
// return true only if scan was stopped by the terminating NUL and if the
|
||||
// string was not empty to start with
|
||||
return !*end && (end != start);
|
||||
}
|
||||
@@ -1752,7 +1752,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
|
||||
// misc other operations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// returns TRUE if the string matches the pattern which may contain '*' and
|
||||
// returns true if the string matches the pattern which may contain '*' and
|
||||
// '?' metacharacters (as usual, '?' matches any character and '*' any number
|
||||
// of them)
|
||||
bool wxString::Matches(const wxChar *pszMask) const
|
||||
@@ -1818,7 +1818,7 @@ match:
|
||||
switch ( *pszMask ) {
|
||||
case wxT('?'):
|
||||
if ( *pszTxt == wxT('\0') )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// pszTxt and pszMask will be incremented in the loop statement
|
||||
|
||||
@@ -1837,7 +1837,7 @@ match:
|
||||
|
||||
// if there is nothing more, match
|
||||
if ( *pszMask == wxT('\0') )
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
// are there any other metacharacters in the mask?
|
||||
size_t uiLenMask;
|
||||
@@ -1855,7 +1855,7 @@ match:
|
||||
wxString strToMatch(pszMask, uiLenMask);
|
||||
const wxChar* pMatch = wxStrstr(pszTxt, strToMatch);
|
||||
if ( pMatch == NULL )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// -1 to compensate "++" in the loop
|
||||
pszTxt = pMatch + uiLenMask - 1;
|
||||
@@ -1865,14 +1865,14 @@ match:
|
||||
|
||||
default:
|
||||
if ( *pszMask != *pszTxt )
|
||||
return FALSE;
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// match only if nothing left
|
||||
if ( *pszTxt == wxT('\0') )
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
// if we failed to match, backtrack if we can
|
||||
if ( pszLastStarInText ) {
|
||||
@@ -1886,7 +1886,7 @@ match:
|
||||
goto match;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif // wxUSE_REGEX/!wxUSE_REGEX
|
||||
}
|
||||
|
||||
@@ -2245,7 +2245,7 @@ wxArrayString::insert(iterator it, const_iterator first, const_iterator last)
|
||||
|
||||
++first;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// expand the array
|
||||
void wxArrayString::SetCount(size_t count)
|
||||
@@ -2320,7 +2320,7 @@ static wxArrayString::CompareFunction gs_compareFunction = NULL;
|
||||
|
||||
// if we don't use the compare function, this flag tells us if we sort the
|
||||
// array in ascending or descending order
|
||||
static bool gs_sortAscending = TRUE;
|
||||
static bool gs_sortAscending = true;
|
||||
|
||||
// function which is called by quick sort
|
||||
extern "C" int wxC_CALLING_CONV // LINKAGEMODE
|
||||
@@ -2380,15 +2380,15 @@ void wxArrayString::DoSort()
|
||||
bool wxArrayString::operator==(const wxArrayString& a) const
|
||||
{
|
||||
if ( m_nCount != a.m_nCount )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
for ( size_t n = 0; n < m_nCount; n++ )
|
||||
{
|
||||
if ( Item(n) != a[n] )
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // !wxUSE_STL
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 2001-07-10
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
@@ -74,7 +74,7 @@ wxArrayString wxSystemOptionsModule::sm_optionValues;
|
||||
|
||||
bool wxSystemOptionsModule::OnInit()
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxSystemOptionsModule::OnExit()
|
||||
@@ -90,7 +90,7 @@ void wxSystemOptionsModule::OnExit()
|
||||
// Option functions (arbitrary name/value mapping)
|
||||
void wxSystemOptions::SetOption(const wxString& name, const wxString& value)
|
||||
{
|
||||
int idx = wxSystemOptionsModule::sm_optionNames.Index(name, FALSE);
|
||||
int idx = wxSystemOptionsModule::sm_optionNames.Index(name, false);
|
||||
if (idx == wxNOT_FOUND)
|
||||
{
|
||||
wxSystemOptionsModule::sm_optionNames.Add(name);
|
||||
@@ -112,7 +112,7 @@ void wxSystemOptions::SetOption(const wxString& name, int value)
|
||||
|
||||
wxString wxSystemOptions::GetOption(const wxString& name)
|
||||
{
|
||||
int idx = wxSystemOptionsModule::sm_optionNames.Index(name, FALSE);
|
||||
int idx = wxSystemOptionsModule::sm_optionNames.Index(name, false);
|
||||
if (idx == wxNOT_FOUND)
|
||||
return wxEmptyString;
|
||||
else
|
||||
@@ -126,7 +126,7 @@ int wxSystemOptions::GetOptionInt(const wxString& name)
|
||||
|
||||
bool wxSystemOptions::HasOption(const wxString& name)
|
||||
{
|
||||
return (wxSystemOptionsModule::sm_optionNames.Index(name, FALSE) != wxNOT_FOUND);
|
||||
return (wxSystemOptionsModule::sm_optionNames.Index(name, false) != wxNOT_FOUND);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user