X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d12e353663f9a2fc28b26e6468716f6a01b85595..c6d60564cb1586ea3087696920945e5985641128:/utils/HelpGen/src/srcparser.cpp diff --git a/utils/HelpGen/src/srcparser.cpp b/utils/HelpGen/src/srcparser.cpp index 81d84ed431..9895113751 100644 --- a/utils/HelpGen/src/srcparser.cpp +++ b/utils/HelpGen/src/srcparser.cpp @@ -10,8 +10,7 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation "srcparser.h" -#pragma interface +# pragma implementation "srcparser.h" #endif // For compilers that support precompilation, includes "wx/wx.h". @@ -25,7 +24,9 @@ #include "wx/wx.h" #endif -#include +#ifndef __DARWIN__ +# include +#endif #include #include "srcparser.h" @@ -36,8 +37,8 @@ void spVisitor::VisitAll( spContext& atContext, bool sortContent ) { - mSiblingSkipped = FALSE; - mChildSkipped = FALSE; + mSiblingSkipped = false; + mChildSkipped = false; mContextMask = SP_CTX_ANY; // FIXME:: should be an arg. if ( sortContent && !atContext.IsSorted() ) @@ -55,7 +56,7 @@ void spVisitor::VisitAll( spContext& atContext, for( size_t i = 0; i != members.size(); ++i ) { if ( mSiblingSkipped ) - + return; if ( !mChildSkipped ) @@ -83,12 +84,12 @@ void spVisitor::RemoveCurrentContext() void spVisitor::SkipSiblings() { - mSiblingSkipped = TRUE; + mSiblingSkipped = true; } void spVisitor::SkipChildren() { - mChildSkipped = TRUE; + mChildSkipped = true; } void spVisitor::SetFilter( int contextMask ) @@ -124,7 +125,7 @@ spContext::spContext() : mpParent ( NULL ), mpFirstOccurence( NULL ), - mAlreadySorted ( FALSE ), + mAlreadySorted ( false ), mSrcLineNo (-1), mSrcOffset (-1), @@ -139,8 +140,8 @@ spContext::spContext() mVisibility( SP_VIS_PRIVATE ), - mIsVirtualContext ( FALSE ), - mVirtualContextHasChildren( FALSE ), + mIsVirtualContext ( false ), + mVirtualContextHasChildren( false ), mpUserData( NULL ) {} @@ -148,7 +149,7 @@ spContext::spContext() void spContext::RemoveChildren() { for( size_t i = 0; i != mMembers.size(); ++i ) - + delete mMembers[i]; mMembers.erase( mMembers.begin(), mMembers.end() ); @@ -159,7 +160,7 @@ spContext::~spContext() RemoveChildren(); for( size_t i = 0; i != mComments.size(); ++i ) - + delete mComments[i]; } @@ -200,7 +201,7 @@ void spContext::RemoveChild( spContext* pChild ) return; } - // the given child should exist on the parent's list + // the given child should exist on the parent's list wxASSERT( 0 ); } @@ -208,8 +209,8 @@ spContext* spContext::GetEnclosingContext( int mask ) { spContext* cur = this->GetParent(); - while ( cur && !(cur->GetContextType() & mask) ) - + while ( cur && !(cur->GetContextType() & mask) ) + cur = cur->GetParent(); return cur; @@ -245,7 +246,7 @@ string spContext::GetFooterOfVirtualContextBody() } -void spContext::SetVirtualContextBody( const string& body, +void spContext::SetVirtualContextBody( const string& body, bool hasChildren, const string& footer ) { @@ -256,13 +257,13 @@ void spContext::SetVirtualContextBody( const string& body, // atuomaticllay becomes virtual context - mIsVirtualContext = TRUE; + mIsVirtualContext = true; } string spContext::GetBody( spContext* pCtx ) { - if ( ( pCtx == NULL || pCtx == this ) && mIsVirtualContext ) - + if ( ( pCtx == NULL || pCtx == this ) && mIsVirtualContext ) + return mVirtualContextBody; if ( GetParent() ) @@ -288,7 +289,7 @@ bool spContext::IsFirstOccurence() spContext* spContext::GetFirstOccurence() { - // this object should not itself be + // this object should not itself be // the first occurence of the context wxASSERT( mpFirstOccurence != 0 ); @@ -321,7 +322,7 @@ spContext* spContext::FindContext( const string& identifier, { spContext& member = *mMembers[i]; - if ( member.GetName() == identifier && + if ( member.GetName() == identifier && ( contextType & member.GetContextType() ) ) @@ -329,7 +330,7 @@ spContext* spContext::FindContext( const string& identifier, if ( searchSubMembers ) { - spContext* result = + spContext* result = member.FindContext( identifier, contextType, 1 ); if ( result ) return result; @@ -345,7 +346,7 @@ void spContext::RemoveThisContext() mpParent->RemoveChild( this ); else // context should have a parent - wxASSERT(0); + wxFAIL_MSG("Context should have a parent"); } spContext* spContext::GetOutterContext() @@ -413,7 +414,7 @@ void spClass::SortMembers() spOperation::spOperation() - : mHasDefinition( FALSE ) + : mHasDefinition( false ) { mIsConstant = mIsVirtual = @@ -427,7 +428,7 @@ string spOperation::GetFullName(MarkupTagsT tags) txt += mName; txt += "( "; txt += tags[TAG_BOLD].end; - + for( size_t i = 0; i != mMembers.size(); ++i ) { // DBG:: @@ -437,9 +438,9 @@ string spOperation::GetFullName(MarkupTagsT tags) if ( i != 0 ) txt += ", "; - + txt += tags[TAG_BOLD].start; - + txt += param.mType; txt += tags[TAG_BOLD].end; @@ -478,15 +479,15 @@ string spPreprocessorLine::CPP_GetIncludedFileNeme() const size_t i = 0; - while( i < mLine.length() && mLine[i] != '"' && mLine[i] != '<' ) - + while( i < mLine.length() && mLine[i] != '"' && mLine[i] != '<' ) + ++i; ++i; size_t start = i; - while( i < mLine.length() && mLine[i] != '"' && mLine[i] != '>' ) + while( i < mLine.length() && mLine[i] != '"' && mLine[i] != '>' ) ++i; @@ -566,7 +567,7 @@ void spContext::Dump(const wxString& indent) const } } -void spContext::DumpThis(const wxString& indent) const +void spContext::DumpThis(const wxString& WXUNUSED(indent)) const { wxFAIL_MSG("abstract base class can't be found in parser tree!"); }