Source cleaning: whitespaces, tabs, -1/wxID_ANY/wxNOT_FOUND/wxDefaultCoord, TRUE/true, FALSE/false, !!/!IsEmpty().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -50,5 +50,5 @@ void wxTaskBarIconBase::OnRightButtonDown(wxTaskBarIconEvent& WXUNUSED(event))
|
||||
delete menu;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // defined(wxHAS_TASK_BAR_ICON)
|
||||
|
||||
@@ -59,7 +59,7 @@ WX_DEFINE_LIST(wxToolBarToolsList);
|
||||
// wxToolBarToolBase
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxToolBarToolBase, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxToolBarToolBase, wxObject)
|
||||
|
||||
bool wxToolBarToolBase::Enable(bool enable)
|
||||
{
|
||||
@@ -592,7 +592,7 @@ void wxToolBarBase::OnRightClick(int id,
|
||||
}
|
||||
|
||||
// Called when the mouse cursor enters a tool bitmap (no button pressed).
|
||||
// Argument is -1 if mouse is exiting the toolbar.
|
||||
// Argument is wxID_ANY if mouse is exiting the toolbar.
|
||||
// Note that for this event, the id of the window is used,
|
||||
// and the integer parameter of wxCommandEvent is used to retrieve
|
||||
// the tool id.
|
||||
@@ -605,9 +605,9 @@ void wxToolBarBase::OnMouseEnter(int id)
|
||||
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
|
||||
if( frame )
|
||||
{
|
||||
wxToolBarToolBase* tool = id == -1 ? (wxToolBarToolBase*)0 : FindById(id);
|
||||
wxToolBarToolBase* tool = id == wxID_ANY ? (wxToolBarToolBase*)0 : FindById(id);
|
||||
wxString help = tool ? tool->GetLongHelp() : wxString();
|
||||
frame->DoGiveHelp( help, id != -1 );
|
||||
frame->DoGiveHelp( help, id != wxID_ANY );
|
||||
}
|
||||
|
||||
(void)GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
@@ -143,7 +143,7 @@ wxTextBuffer::wxTextBuffer(const wxString& strBufferName)
|
||||
: m_strBufferName(strBufferName)
|
||||
{
|
||||
m_nCurLine = 0;
|
||||
m_isOpened = FALSE;
|
||||
m_isOpened = false;
|
||||
}
|
||||
|
||||
wxTextBuffer::~wxTextBuffer()
|
||||
@@ -172,13 +172,13 @@ bool wxTextBuffer::Create()
|
||||
wxASSERT( !m_strBufferName.IsEmpty() );
|
||||
|
||||
// if the buffer already exists do nothing
|
||||
if ( Exists() ) return FALSE;
|
||||
|
||||
if ( Exists() ) return false;
|
||||
|
||||
if ( !OnOpen(m_strBufferName, WriteAccess) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
OnClose();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTextBuffer::Open(const wxString& strBufferName, wxMBConv& conv)
|
||||
@@ -195,7 +195,7 @@ bool wxTextBuffer::Open(wxMBConv& conv)
|
||||
|
||||
// open buffer in read-only mode
|
||||
if ( !OnOpen(m_strBufferName, ReadAccess) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// read buffer into memory
|
||||
m_isOpened = OnRead(conv);
|
||||
@@ -275,9 +275,9 @@ bool wxTextBuffer::Close()
|
||||
m_aTypes.Clear();
|
||||
m_aLines.Clear();
|
||||
m_nCurLine = 0;
|
||||
m_isOpened = FALSE;
|
||||
m_isOpened = false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTextBuffer::Write(wxTextFileType typeNew, wxMBConv& conv)
|
||||
|
||||
@@ -128,27 +128,27 @@ wxTextAttr wxTextAttr::Combine(const wxTextAttr& attr,
|
||||
}
|
||||
|
||||
wxTextAttr newAttr(colFg, colBg, font);
|
||||
|
||||
|
||||
if (attr.HasAlignment())
|
||||
newAttr.SetAlignment(attr.GetAlignment());
|
||||
else if (attrDef.HasAlignment())
|
||||
newAttr.SetAlignment(attrDef.GetAlignment());
|
||||
|
||||
|
||||
if (attr.HasTabs())
|
||||
newAttr.SetTabs(attr.GetTabs());
|
||||
else if (attrDef.HasTabs())
|
||||
newAttr.SetTabs(attrDef.GetTabs());
|
||||
|
||||
|
||||
if (attr.HasLeftIndent())
|
||||
newAttr.SetLeftIndent(attr.GetLeftIndent(), attr.GetLeftSubIndent());
|
||||
else if (attrDef.HasLeftIndent())
|
||||
newAttr.SetLeftIndent(attrDef.GetLeftIndent(), attr.GetLeftSubIndent());
|
||||
|
||||
|
||||
if (attr.HasRightIndent())
|
||||
newAttr.SetRightIndent(attr.GetRightIndent());
|
||||
else if (attrDef.HasRightIndent())
|
||||
newAttr.SetRightIndent(attrDef.GetRightIndent());
|
||||
|
||||
newAttr.SetRightIndent(attrDef.GetRightIndent());
|
||||
|
||||
return newAttr;
|
||||
}
|
||||
|
||||
@@ -171,14 +171,14 @@ bool wxTextCtrlBase::SetStyle(long WXUNUSED(start), long WXUNUSED(end),
|
||||
const wxTextAttr& WXUNUSED(style))
|
||||
{
|
||||
// to be implemented in derived TextCtrl classes
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the styling at the given position
|
||||
bool wxTextCtrlBase::GetStyle(long WXUNUSED(position), wxTextAttr& WXUNUSED(style))
|
||||
{
|
||||
// to be implemented in derived TextCtrl classes
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// change default text attributes
|
||||
@@ -192,7 +192,7 @@ bool wxTextCtrlBase::SetDefaultStyle(const wxTextAttr& style)
|
||||
else
|
||||
m_defaultStyle = wxTextAttr::Combine(style, m_defaultStyle, this);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// get default text attributes
|
||||
@@ -220,14 +220,14 @@ bool wxTextCtrlBase::LoadFile(const wxString& filename)
|
||||
|
||||
m_filename = filename;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
wxLogError(_("File couldn't be loaded."));
|
||||
#endif // wxUSE_FFILE
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTextCtrlBase::SaveFile(const wxString& filename)
|
||||
@@ -238,7 +238,7 @@ bool wxTextCtrlBase::SaveFile(const wxString& filename)
|
||||
// what kind of message to give? is it an error or a program bug?
|
||||
wxLogDebug(wxT("Can't save textctrl to file without filename."));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#if wxUSE_FFILE
|
||||
@@ -251,13 +251,13 @@ bool wxTextCtrlBase::SaveFile(const wxString& filename)
|
||||
// if it worked, save for future calls
|
||||
m_filename = filenameToUse;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif // wxUSE_FFILE
|
||||
|
||||
wxLogError(_("The text couldn't be saved."));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -355,7 +355,7 @@ bool wxTextCtrlBase::CanPaste() const
|
||||
// the generic version is unused in wxMSW
|
||||
bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& WXUNUSED(event))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#else // !__WIN32__
|
||||
bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
|
||||
@@ -443,10 +443,10 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
|
||||
{
|
||||
WriteText(ch);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#endif // !__WIN32__
|
||||
|
||||
@@ -483,12 +483,12 @@ void wxTextCtrlBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
|
||||
{
|
||||
if ( event.GetSetEnabled() )
|
||||
Enable(event.GetEnabled());
|
||||
|
||||
|
||||
if ( event.GetSetText() )
|
||||
{
|
||||
if ( event.GetText() != GetValue() )
|
||||
SetValue(event.GetText());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -102,25 +102,25 @@ bool wxTextFile::OnRead(wxMBConv& conv)
|
||||
strPtr = strBuf = new char[1024];
|
||||
strEnd = strBuf + 1024;
|
||||
|
||||
do
|
||||
do
|
||||
{
|
||||
nRead = m_file.Read(buf, WXSIZEOF(buf));
|
||||
if ( nRead == wxInvalidOffset )
|
||||
if ( nRead == wxInvalidOffset )
|
||||
{
|
||||
// read error (error message already given in wxFile::Read)
|
||||
delete[] strBuf;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (n = 0; n < nRead; n++)
|
||||
{
|
||||
ch = buf[n];
|
||||
switch ( ch )
|
||||
switch ( ch )
|
||||
{
|
||||
case '\n':
|
||||
// Dos/Unix line termination
|
||||
*strPtr = '\0';
|
||||
AddLine(wxString(strBuf, conv),
|
||||
AddLine(wxString(strBuf, conv),
|
||||
chLast == '\r' ? wxTextFileType_Dos
|
||||
: wxTextFileType_Unix);
|
||||
strPtr = strBuf;
|
||||
@@ -128,7 +128,7 @@ bool wxTextFile::OnRead(wxMBConv& conv)
|
||||
break;
|
||||
|
||||
case '\r':
|
||||
if ( chLast == '\r' )
|
||||
if ( chLast == '\r' )
|
||||
{
|
||||
// Mac empty line
|
||||
AddLine(wxEmptyString, wxTextFileType_Mac);
|
||||
@@ -147,7 +147,7 @@ bool wxTextFile::OnRead(wxMBConv& conv)
|
||||
strPtr = strBuf;
|
||||
*(strPtr++) = ch;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// add to the current line
|
||||
*(strPtr++) = ch;
|
||||
@@ -168,15 +168,15 @@ bool wxTextFile::OnRead(wxMBConv& conv)
|
||||
} while ( nRead == WXSIZEOF(buf) );
|
||||
|
||||
// anything in the last line?
|
||||
if ( strPtr != strBuf )
|
||||
if ( strPtr != strBuf )
|
||||
{
|
||||
*strPtr = '\0';
|
||||
AddLine(wxString(strBuf, conv),
|
||||
AddLine(wxString(strBuf, conv),
|
||||
wxTextFileType_None); // no line terminator
|
||||
}
|
||||
|
||||
delete[] strBuf;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ bool wxTextFile::OnWrite(wxTextFileType typeNew, wxMBConv& conv)
|
||||
|
||||
if ( !fileTmp.IsOpened() ) {
|
||||
wxLogError(_("can't write buffer '%s' to disk."), m_strBufferName.c_str());
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t nCount = GetLineCount();
|
||||
|
||||
@@ -85,7 +85,7 @@ bool wxTimerBase::Start(int milliseconds, bool oneShot)
|
||||
|
||||
m_oneShot = oneShot;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // wxUSE_TIMER
|
||||
|
||||
@@ -102,11 +102,11 @@ void wxStringTokenizer::Reinit(const wxString& str)
|
||||
// do we have more of them?
|
||||
bool wxStringTokenizer::HasMoreTokens() const
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), FALSE, _T("you should call SetString() first") );
|
||||
wxCHECK_MSG( IsOk(), false, _T("you should call SetString() first") );
|
||||
|
||||
if ( m_string.find_first_not_of(m_delims) == wxString::npos )
|
||||
{
|
||||
// no non empty tokens left, but in 2 cases we still may return TRUE if
|
||||
// no non empty tokens left, but in 2 cases we still may return true if
|
||||
// GetNextToken() wasn't called yet for this empty token:
|
||||
//
|
||||
// a) in wxTOKEN_RET_EMPTY_ALL mode we always do it
|
||||
@@ -115,13 +115,13 @@ bool wxStringTokenizer::HasMoreTokens() const
|
||||
// token just before it
|
||||
return (m_mode == wxTOKEN_RET_EMPTY_ALL) ||
|
||||
(m_mode == wxTOKEN_RET_EMPTY && m_pos == 0)
|
||||
? m_hasMore : FALSE;
|
||||
? m_hasMore : false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// there are non delimiter characters left, hence we do have more
|
||||
// tokens
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ wxString wxStringTokenizer::GetNextToken()
|
||||
|
||||
// no more tokens in this string, even in wxTOKEN_RET_EMPTY_ALL
|
||||
// mode (we will return the trailing one right now in this case)
|
||||
m_hasMore = FALSE;
|
||||
m_hasMore = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ wxTopLevelWindowBase::~wxTopLevelWindowBase()
|
||||
bool shouldExit = IsLastBeforeExit();
|
||||
|
||||
wxTopLevelWindows.DeleteObject(this);
|
||||
|
||||
|
||||
if ( shouldExit )
|
||||
{
|
||||
// then do it
|
||||
@@ -88,12 +88,12 @@ bool wxTopLevelWindowBase::Destroy()
|
||||
// not be done if this TLW is the
|
||||
// only one left since we then would
|
||||
// risk not to get any idle events
|
||||
// at all anymore during which we
|
||||
// at all anymore during which we
|
||||
// could delete any pending events.
|
||||
Hide();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTopLevelWindowBase::IsLastBeforeExit() const
|
||||
@@ -116,10 +116,10 @@ wxSize wxTopLevelWindowBase::GetMaxSize() const
|
||||
|
||||
wxClientDisplayRect( 0, 0, &w, &h );
|
||||
|
||||
if( size.GetWidth() == -1 )
|
||||
if( size.GetWidth() == wxDefaultCoord )
|
||||
size.SetWidth( w );
|
||||
|
||||
if( size.GetHeight() == -1 )
|
||||
if( size.GetHeight() == wxDefaultCoord )
|
||||
size.SetHeight( h );
|
||||
|
||||
return size;
|
||||
@@ -257,7 +257,7 @@ void wxTopLevelWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
|
||||
{
|
||||
if ( event.GetSetEnabled() )
|
||||
Enable(event.GetEnabled());
|
||||
|
||||
|
||||
if ( event.GetSetText() )
|
||||
{
|
||||
if ( event.GetText() != GetTitle() )
|
||||
|
||||
@@ -75,7 +75,7 @@ wxTreeEvent::wxTreeEvent(wxEventType commandType, int id)
|
||||
: wxNotifyEvent(commandType, id)
|
||||
{
|
||||
m_itemOld = 0l;
|
||||
m_editCancelled = FALSE;
|
||||
m_editCancelled = false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_TREECTRL
|
||||
|
||||
@@ -70,14 +70,14 @@ wxChar wxTextInputStream::NextChar()
|
||||
#if wxUSE_UNICODE
|
||||
wxChar wbuf[2];
|
||||
memset((void*)m_lastBytes, 0, 10);
|
||||
for(size_t inlen = 0; inlen < 9; inlen++)
|
||||
for(size_t inlen = 0; inlen < 9; inlen++)
|
||||
{
|
||||
// actually read the next character
|
||||
m_lastBytes[inlen] = m_input.GetC();
|
||||
|
||||
if(m_input.LastRead() <= 0)
|
||||
if(m_input.LastRead() <= 0)
|
||||
return wxEOT;
|
||||
|
||||
|
||||
int retlen = (int) m_conv.MB2WC(wbuf, m_lastBytes, 2); // returns -1 for failure
|
||||
if(retlen >= 0) // res == 0 could happen for '\0' char
|
||||
return wbuf[0];
|
||||
@@ -86,13 +86,13 @@ wxChar wxTextInputStream::NextChar()
|
||||
return wxEOT;
|
||||
#else
|
||||
m_lastBytes[0] = m_input.GetC();
|
||||
|
||||
if(m_input.LastRead() <= 0)
|
||||
|
||||
if(m_input.LastRead() <= 0)
|
||||
return wxEOT;
|
||||
|
||||
|
||||
return m_lastBytes[0];
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
wxChar wxTextInputStream::NextNonSeparators()
|
||||
@@ -112,18 +112,18 @@ wxChar wxTextInputStream::NextNonSeparators()
|
||||
|
||||
bool wxTextInputStream::EatEOL(const wxChar &c)
|
||||
{
|
||||
if (c == wxT('\n')) return TRUE; // eat on UNIX
|
||||
if (c == wxT('\n')) return true; // eat on UNIX
|
||||
|
||||
if (c == wxT('\r')) // eat on both Mac and DOS
|
||||
{
|
||||
wxChar c2 = NextChar();
|
||||
if(c2 == wxEOT) return TRUE; // end of stream reached, had enough :-)
|
||||
if(c2 == wxEOT) return true; // end of stream reached, had enough :-)
|
||||
|
||||
if (c2 != wxT('\n')) UngetLast(); // Don't eat on Mac
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
wxUint32 wxTextInputStream::Read32(int base)
|
||||
@@ -191,7 +191,7 @@ wxString wxTextInputStream::ReadLine()
|
||||
wxChar c = NextChar();
|
||||
if(c == wxEOT)
|
||||
break;
|
||||
|
||||
|
||||
if ( !m_input )
|
||||
break;
|
||||
|
||||
@@ -216,13 +216,13 @@ wxString wxTextInputStream::ReadWord()
|
||||
return word;
|
||||
|
||||
word += c;
|
||||
|
||||
|
||||
while ( !m_input.Eof() )
|
||||
{
|
||||
c = NextChar();
|
||||
if(c == wxEOT)
|
||||
break;
|
||||
|
||||
|
||||
if (m_separators.Contains(c))
|
||||
break;
|
||||
|
||||
@@ -421,7 +421,7 @@ wxTextOutputStream& wxTextOutputStream::operator<<(const wxString& string)
|
||||
wxTextOutputStream& wxTextOutputStream::operator<<(char c)
|
||||
{
|
||||
WriteString( wxString::FromAscii(c) );
|
||||
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -107,21 +107,21 @@ typedef voidp unzFile;
|
||||
/* tm_unz contain date/time info */
|
||||
typedef struct tm_unz_s
|
||||
{
|
||||
uInt tm_sec; /* seconds after the minute - [0,59] */
|
||||
uInt tm_min; /* minutes after the hour - [0,59] */
|
||||
uInt tm_hour; /* hours since midnight - [0,23] */
|
||||
uInt tm_mday; /* day of the month - [1,31] */
|
||||
uInt tm_mon; /* months since January - [0,11] */
|
||||
uInt tm_year; /* years - [1980..2044] */
|
||||
uInt tm_sec; /* seconds after the minute - [0,59] */
|
||||
uInt tm_min; /* minutes after the hour - [0,59] */
|
||||
uInt tm_hour; /* hours since midnight - [0,23] */
|
||||
uInt tm_mday; /* day of the month - [1,31] */
|
||||
uInt tm_mon; /* months since January - [0,11] */
|
||||
uInt tm_year; /* years - [1980..2044] */
|
||||
} tm_unz;
|
||||
|
||||
/* unz_global_info structure contain global data about the ZIPfile
|
||||
These data comes from the end of central dir */
|
||||
typedef struct unz_global_info_s
|
||||
{
|
||||
uLong number_entry; /* total number of entries in
|
||||
the central dir on this disk */
|
||||
uLong size_comment; /* size of the global comment of the zipfile */
|
||||
uLong number_entry; /* total number of entries in
|
||||
the central dir on this disk */
|
||||
uLong size_comment; /* size of the global comment of the zipfile */
|
||||
} unz_global_info;
|
||||
|
||||
|
||||
@@ -148,15 +148,16 @@ typedef struct unz_file_info_s
|
||||
} unz_file_info;
|
||||
|
||||
extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
|
||||
const char* fileName2,
|
||||
int iCaseSensitivity));
|
||||
const char* fileName2,
|
||||
int iCaseSensitivity));
|
||||
/*
|
||||
Compare two filename (fileName1,fileName2).
|
||||
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
|
||||
or strcasecmp)
|
||||
If iCaseSenisivity = 1, comparision is case sensitivity
|
||||
(like strcmp)
|
||||
If iCaseSenisivity = 2, comparision is not case sensitivity
|
||||
(like strcmpi or strcasecmp)
|
||||
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
*/
|
||||
|
||||
|
||||
@@ -164,11 +165,11 @@ extern unzFile ZEXPORT unzOpen OF((const char *path));
|
||||
/*
|
||||
Open a Zip file. path contain the full pathname (by example,
|
||||
on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
|
||||
"zlib/zlib111.zip".
|
||||
If the zipfile cannot be opened (file don't exist or in not valid), the
|
||||
return value is NULL.
|
||||
"zlib/zlib111.zip".
|
||||
If the zipfile cannot be opened (file don't exist or in not valid), the
|
||||
return value is NULL.
|
||||
Else, the return value is a unzFile Handle, usable with other function
|
||||
of this unzip package.
|
||||
of this unzip package.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzClose OF((unzFile file));
|
||||
@@ -179,7 +180,7 @@ extern int ZEXPORT unzClose OF((unzFile file));
|
||||
return UNZ_OK if there is no problem. */
|
||||
|
||||
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
|
||||
unz_global_info *pglobal_info));
|
||||
unz_global_info *pglobal_info));
|
||||
/*
|
||||
Write info about the ZipFile in the *pglobal_info structure.
|
||||
No preparation of the structure is needed
|
||||
@@ -187,8 +188,8 @@ extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
|
||||
|
||||
|
||||
extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
|
||||
char *szComment,
|
||||
uLong uSizeBuf));
|
||||
char *szComment,
|
||||
uLong uSizeBuf));
|
||||
/*
|
||||
Get the global comment string of the ZipFile, in the szComment buffer.
|
||||
uSizeBuf is the size of the szComment buffer.
|
||||
@@ -213,8 +214,8 @@ extern int ZEXPORT unzGoToNextFile OF((unzFile file));
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzLocateFile OF((unzFile file,
|
||||
const char *szFileName,
|
||||
int iCaseSensitivity));
|
||||
const char *szFileName,
|
||||
int iCaseSensitivity));
|
||||
/*
|
||||
Try locate the file szFileName in the zipfile.
|
||||
For the iCaseSensitivity signification, see unzStringFileNameCompare
|
||||
@@ -226,24 +227,24 @@ extern int ZEXPORT unzLocateFile OF((unzFile file,
|
||||
|
||||
|
||||
extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
|
||||
unz_file_info *pfile_info,
|
||||
char *szFileName,
|
||||
uLong fileNameBufferSize,
|
||||
void *extraField,
|
||||
uLong extraFieldBufferSize,
|
||||
char *szComment,
|
||||
uLong commentBufferSize));
|
||||
unz_file_info *pfile_info,
|
||||
char *szFileName,
|
||||
uLong fileNameBufferSize,
|
||||
void *extraField,
|
||||
uLong extraFieldBufferSize,
|
||||
char *szComment,
|
||||
uLong commentBufferSize));
|
||||
/*
|
||||
Get Info about the current file
|
||||
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
|
||||
the current file
|
||||
the current file
|
||||
if szFileName!=NULL, the filemane string will be copied in szFileName
|
||||
(fileNameBufferSize is the size of the buffer)
|
||||
(fileNameBufferSize is the size of the buffer)
|
||||
if extraField!=NULL, the extra field information will be copied in extraField
|
||||
(extraFieldBufferSize is the size of the buffer).
|
||||
This is the Central-header version of the extra field
|
||||
(extraFieldBufferSize is the size of the buffer).
|
||||
This is the Central-header version of the extra field
|
||||
if szComment!=NULL, the comment string of the file will be copied in szComment
|
||||
(commentBufferSize is the size of the buffer)
|
||||
(commentBufferSize is the size of the buffer)
|
||||
*/
|
||||
|
||||
/***************************************************************************/
|
||||
@@ -263,10 +264,10 @@ extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
|
||||
Return UNZ_CRCERROR if all the file was read but the CRC is not good
|
||||
*/
|
||||
|
||||
|
||||
|
||||
extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
|
||||
voidp buf,
|
||||
unsigned len));
|
||||
voidp buf,
|
||||
unsigned len));
|
||||
/*
|
||||
Read bytes from the current file (opened by unzOpenCurrentFile)
|
||||
buf contain buffer where data must be copied
|
||||
@@ -289,8 +290,8 @@ extern int ZEXPORT unzeof OF((unzFile file));
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
|
||||
voidp buf,
|
||||
unsigned len));
|
||||
voidp buf,
|
||||
unsigned len));
|
||||
/*
|
||||
Read extra field from the current file (opened by unzOpenCurrentFile)
|
||||
This is the local-header version of the extra field (sometimes, there is
|
||||
@@ -299,9 +300,9 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
|
||||
if buf==NULL, it return the size of the local extra field
|
||||
|
||||
if buf!=NULL, len is the size of the buffer, the extra header is copied in
|
||||
buf.
|
||||
buf.
|
||||
the return value is the number of bytes copied in buf, or (if <0)
|
||||
the error code
|
||||
the error code
|
||||
*/
|
||||
|
||||
#if defined(__VISAGECPP__) || defined(__BORLANDC__)
|
||||
|
||||
@@ -45,7 +45,7 @@ USE_PROTOCOL(wxHTTP)
|
||||
USE_PROTOCOL(wxFTP)
|
||||
|
||||
wxHTTP *wxURL::ms_proxyDefault = NULL;
|
||||
bool wxURL::ms_useDefaultProxy = FALSE;
|
||||
bool wxURL::ms_useDefaultProxy = false;
|
||||
#endif
|
||||
|
||||
// --------------------------------------------------------------
|
||||
@@ -73,7 +73,7 @@ wxURL::wxURL(const wxString& url)
|
||||
if ( !ms_proxyDefault )
|
||||
{
|
||||
// don't try again
|
||||
ms_useDefaultProxy = FALSE;
|
||||
ms_useDefaultProxy = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,14 +98,14 @@ bool wxURL::ParseURL()
|
||||
if (!PrepProto(last_url))
|
||||
{
|
||||
m_error = wxURL_SNTXERR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Find and create the protocol object
|
||||
if (!FetchProtocol())
|
||||
{
|
||||
m_error = wxURL_NOPROTO;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Do we need a host name ?
|
||||
@@ -115,7 +115,7 @@ bool wxURL::ParseURL()
|
||||
if (!PrepHost(last_url))
|
||||
{
|
||||
m_error = wxURL_SNTXERR;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ bool wxURL::ParseURL()
|
||||
if (!PrepPath(last_url))
|
||||
{
|
||||
m_error = wxURL_NOPATH;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// URL parse finished.
|
||||
@@ -147,7 +147,7 @@ bool wxURL::ParseURL()
|
||||
#endif
|
||||
|
||||
m_error = wxURL_NOERR;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxURL::CleanData()
|
||||
@@ -180,14 +180,14 @@ bool wxURL::PrepProto(wxString& url)
|
||||
|
||||
// Find end
|
||||
pos = url.Find(wxT(':'));
|
||||
if (pos == -1)
|
||||
return FALSE;
|
||||
if (pos == wxNOT_FOUND)
|
||||
return false;
|
||||
|
||||
m_protoname = url(0, pos);
|
||||
|
||||
url = url(pos+1, url.Length());
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxURL::PrepHost(wxString& url)
|
||||
@@ -196,51 +196,51 @@ bool wxURL::PrepHost(wxString& url)
|
||||
int pos, pos2;
|
||||
|
||||
if ((url.GetChar(0) != wxT('/')) || (url.GetChar(1) != wxT('/')))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
url = url(2, url.Length());
|
||||
|
||||
pos = url.Find(wxT('/'));
|
||||
if (pos == -1)
|
||||
if (pos == wxNOT_FOUND)
|
||||
pos = url.Length();
|
||||
|
||||
if (pos == 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
temp_url = url(0, pos);
|
||||
url = url(url.Find(wxT('/')), url.Length());
|
||||
|
||||
// Retrieve service number
|
||||
pos2 = temp_url.Find(wxT(':'), TRUE);
|
||||
if (pos2 != -1 && pos2 < pos)
|
||||
pos2 = temp_url.Find(wxT(':'), true);
|
||||
if (pos2 != wxNOT_FOUND && pos2 < pos)
|
||||
{
|
||||
m_servname = temp_url(pos2+1, pos);
|
||||
if (!m_servname.IsNumber())
|
||||
return FALSE;
|
||||
return false;
|
||||
temp_url = temp_url(0, pos2);
|
||||
}
|
||||
|
||||
// Retrieve user and password.
|
||||
pos2 = temp_url.Find(wxT('@'));
|
||||
// Even if pos2 equals -1, this code is right.
|
||||
// Even if pos2 equals wxNOT_FOUND, this code is right.
|
||||
m_hostname = temp_url(pos2+1, temp_url.Length());
|
||||
|
||||
m_user = wxT("");
|
||||
m_password = wxT("");
|
||||
|
||||
if (pos2 == -1)
|
||||
return TRUE;
|
||||
if (pos2 == wxNOT_FOUND)
|
||||
return true;
|
||||
|
||||
temp_url = temp_url(0, pos2);
|
||||
pos2 = temp_url.Find(wxT(':'));
|
||||
|
||||
if (pos2 == -1)
|
||||
return FALSE;
|
||||
if (pos2 == wxNOT_FOUND)
|
||||
return false;
|
||||
|
||||
m_user = temp_url(0, pos2);
|
||||
m_password = temp_url(pos2+1, url.Length());
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxURL::PrepPath(wxString& url)
|
||||
@@ -249,7 +249,7 @@ bool wxURL::PrepPath(wxString& url)
|
||||
m_path = ConvertToValidURI(url);
|
||||
else
|
||||
m_path = wxT("/");
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxURL::FetchProtocol()
|
||||
@@ -265,11 +265,11 @@ bool wxURL::FetchProtocol()
|
||||
|
||||
m_protoinfo = info;
|
||||
m_protocol = (wxProtocol *)m_protoinfo->m_cinfo->CreateObject();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
info = info->next;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
@@ -318,7 +318,7 @@ wxInputStream *wxURL::GetInputStream()
|
||||
|
||||
addr.Service(m_servname);
|
||||
|
||||
if (!m_protocol->Connect(addr, TRUE)) // Watcom needs the 2nd arg for some reason
|
||||
if (!m_protocol->Connect(addr, true)) // Watcom needs the 2nd arg for some reason
|
||||
{
|
||||
m_error = wxURL_CONNERR;
|
||||
return NULL;
|
||||
@@ -327,7 +327,7 @@ wxInputStream *wxURL::GetInputStream()
|
||||
#endif
|
||||
|
||||
// When we use a proxy, we have to pass the whole URL to it.
|
||||
wxInputStream *the_i_stream =
|
||||
wxInputStream *the_i_stream =
|
||||
(m_useProxy) ? m_protocol->GetInputStream(m_url) :
|
||||
m_protocol->GetInputStream(m_path);
|
||||
|
||||
@@ -356,7 +356,7 @@ void wxURL::SetDefaultProxy(const wxString& url_proxy)
|
||||
{
|
||||
wxString tmp_str = url_proxy;
|
||||
int pos = tmp_str.Find(wxT(':'));
|
||||
if (pos == -1)
|
||||
if (pos == wxNOT_FOUND)
|
||||
return;
|
||||
|
||||
wxString hostname = tmp_str(0, pos),
|
||||
@@ -373,7 +373,7 @@ void wxURL::SetDefaultProxy(const wxString& url_proxy)
|
||||
ms_proxyDefault->Close();
|
||||
else
|
||||
ms_proxyDefault = new wxHTTP();
|
||||
ms_proxyDefault->Connect(addr, TRUE); // Watcom needs the 2nd arg for some reason
|
||||
ms_proxyDefault->Connect(addr, true); // Watcom needs the 2nd arg for some reason
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ void wxURL::SetProxy(const wxString& url_proxy)
|
||||
delete m_proxy;
|
||||
}
|
||||
|
||||
m_useProxy = FALSE;
|
||||
m_useProxy = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -399,7 +399,7 @@ void wxURL::SetProxy(const wxString& url_proxy)
|
||||
tmp_str = url_proxy;
|
||||
pos = tmp_str.Find(wxT(':'));
|
||||
// This is an invalid proxy name.
|
||||
if (pos == -1)
|
||||
if (pos == wxNOT_FOUND)
|
||||
return;
|
||||
|
||||
hostname = tmp_str(0, pos);
|
||||
@@ -412,11 +412,11 @@ void wxURL::SetProxy(const wxString& url_proxy)
|
||||
if (m_proxy && m_proxy != ms_proxyDefault)
|
||||
delete m_proxy;
|
||||
m_proxy = new wxHTTP();
|
||||
m_proxy->Connect(addr, TRUE); // Watcom needs the 2nd arg for some reason
|
||||
m_proxy->Connect(addr, true); // Watcom needs the 2nd arg for some reason
|
||||
|
||||
CleanData();
|
||||
// Reparse url.
|
||||
m_useProxy = TRUE;
|
||||
m_useProxy = true;
|
||||
ParseURL();
|
||||
}
|
||||
}
|
||||
@@ -441,7 +441,7 @@ wxString wxURL::ConvertToValidURI(const wxString& uri, const wxChar* delims)
|
||||
else
|
||||
{
|
||||
// GRG, Apr/2000: modified according to the URI definition (RFC 2396)
|
||||
//
|
||||
//
|
||||
// - Alphanumeric characters are never escaped
|
||||
// - Unreserved marks are never escaped
|
||||
// - Delimiters must be escaped if they appear within a component
|
||||
@@ -530,10 +530,10 @@ bool wxURLModule::OnInit()
|
||||
|
||||
if ( getenv("HTTP_PROXY") )
|
||||
{
|
||||
wxURL::ms_useDefaultProxy = TRUE;
|
||||
wxURL::ms_useDefaultProxy = true;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxURLModule::OnExit()
|
||||
|
||||
@@ -322,12 +322,12 @@ bool wxGetEmailAddress(wxChar *address, int maxSize)
|
||||
{
|
||||
wxString email = wxGetEmailAddress();
|
||||
if ( !email )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
wxStrncpy(address, email, maxSize - 1);
|
||||
address[maxSize - 1] = wxT('\0');
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxString wxGetEmailAddress()
|
||||
@@ -335,10 +335,10 @@ wxString wxGetEmailAddress()
|
||||
wxString email;
|
||||
|
||||
wxString host = wxGetFullHostName();
|
||||
if ( !!host )
|
||||
if ( !host.IsEmpty() )
|
||||
{
|
||||
wxString user = wxGetUserId();
|
||||
if ( !!user )
|
||||
if ( !user.IsEmpty() )
|
||||
{
|
||||
email << user << wxT('@') << host;
|
||||
}
|
||||
@@ -447,18 +447,18 @@ wxString wxGetCurrentDir()
|
||||
|
||||
// wxDoExecuteWithCapture() helper: reads an entire stream into one array
|
||||
//
|
||||
// returns TRUE if ok, FALSE if error
|
||||
// returns true if ok, false if error
|
||||
#if wxUSE_STREAMS
|
||||
static bool ReadAll(wxInputStream *is, wxArrayString& output)
|
||||
{
|
||||
wxCHECK_MSG( is, FALSE, _T("NULL stream in wxExecute()?") );
|
||||
wxCHECK_MSG( is, false, _T("NULL stream in wxExecute()?") );
|
||||
|
||||
// the stream could be already at EOF or in wxSTREAM_BROKEN_PIPE state
|
||||
is->Reset();
|
||||
|
||||
wxTextInputStream tis(*is);
|
||||
|
||||
bool cont = TRUE;
|
||||
bool cont = true;
|
||||
while ( cont )
|
||||
{
|
||||
wxString line = tis.ReadLine();
|
||||
@@ -467,7 +467,7 @@ static bool ReadAll(wxInputStream *is, wxArrayString& output)
|
||||
|
||||
if ( !*is )
|
||||
{
|
||||
cont = FALSE;
|
||||
cont = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -538,7 +538,7 @@ bool wxYield()
|
||||
|
||||
bool wxYieldIfNeeded()
|
||||
{
|
||||
return wxTheApp && wxTheApp->Yield(TRUE);
|
||||
return wxTheApp && wxTheApp->Yield(true);
|
||||
}
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
@@ -660,7 +660,7 @@ wxFindWindowByName (const wxString& name, wxWindow * parent)
|
||||
return wxWindow::FindWindowByName( name, parent );
|
||||
}
|
||||
|
||||
// Returns menu item id or -1 if none.
|
||||
// Returns menu item id or wxNOT_FOUND if none.
|
||||
int
|
||||
wxFindMenuItemId (wxFrame * frame, const wxString& menuString, const wxString& itemString)
|
||||
{
|
||||
@@ -670,7 +670,7 @@ wxFindMenuItemId (wxFrame * frame, const wxString& menuString, const wxString& i
|
||||
return menuBar->FindMenuItem (menuString, itemString);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
return -1;
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
// Try to find the deepest child that contains 'pt'.
|
||||
@@ -831,7 +831,7 @@ wxString wxGetPasswordFromUser(const wxString& message,
|
||||
wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit)
|
||||
{
|
||||
wxColourData data;
|
||||
data.SetChooseFull(TRUE);
|
||||
data.SetChooseFull(true);
|
||||
if ( colInit.Ok() )
|
||||
{
|
||||
data.SetColour((wxColour &)colInit); // const_cast
|
||||
@@ -951,7 +951,7 @@ bool wxSafeYield(wxWindow *win, bool onlyIfNeeded)
|
||||
#ifndef __WXGTK__
|
||||
bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) )
|
||||
{
|
||||
return TRUE; // detectable auto-repeat is the only mode MSW supports
|
||||
return true; // detectable auto-repeat is the only mode MSW supports
|
||||
}
|
||||
#endif // !wxGTK
|
||||
|
||||
|
||||
Reference in New Issue
Block a user