More warning and error fixes (work in progress with Tinderbox).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-05-31 13:46:38 +00:00
parent a5e6cfa82a
commit b631781021
5 changed files with 80 additions and 81 deletions

View File

@@ -992,7 +992,7 @@ spFile* CJSourceParser::Parse( char* start, char* end )
mIsTemplate = 0; mIsTemplate = 0;
mNestingLevel = 0; mNestingLevel = 0;
cur = start; m_cur = start;
mpStart = start; mpStart = start;
mpEnd = end; mpEnd = end;
@@ -1008,11 +1008,11 @@ spFile* CJSourceParser::Parse( char* start, char* end )
do do
{ {
if ( !get_next_token( cur ) ) if ( !get_next_token( m_cur ) )
// end of source reached // end of source reached
return pTopCtx; return pTopCtx;
if ( memcmp( cur, "ScriptSection( const string&", if ( memcmp( m_cur, "ScriptSection( const string&",
strlen( "ScriptSection( const string&" ) strlen( "ScriptSection( const string&" )
) == 0 ) == 0
) )
@@ -1021,35 +1021,35 @@ spFile* CJSourceParser::Parse( char* start, char* end )
// ++o; // ++o;
} }
switch (*cur) switch (*m_cur)
{ {
case '#' : case '#' :
{ {
AddMacroNode( cur ); AddMacroNode( m_cur );
continue; continue;
} }
case ':' : case ':' :
{ {
skip_token( cur ); skip_token( m_cur );
continue; continue;
} }
case ';' : case ';' :
{ {
skip_token( cur ); skip_token( m_cur );
continue; continue;
} }
case ')' : case ')' :
{ {
skip_token( cur ); skip_token( m_cur );
continue; continue;
} }
case '=' : case '=' :
{ {
skip_token( cur ); skip_token( m_cur );
continue; continue;
} }
@@ -1057,24 +1057,24 @@ spFile* CJSourceParser::Parse( char* start, char* end )
} }
// 'const' is a part of the return type, not a keyword here // 'const' is a part of the return type, not a keyword here
if ( strncmp(cur, "const", 5) != 0 && is_keyword( cur ) ) if ( strncmp(m_cur, "const", 5) != 0 && is_keyword( m_cur ) )
{ {
// parses, token, if token identifies // parses, token, if token identifies
// the container context (e.g. class/namespace) // the container context (e.g. class/namespace)
// the corresponding context object is created // the corresponding context object is created
// and set as current context // and set as current context
ParseKeyword( cur ); ParseKeyword( m_cur );
continue; continue;
} }
if ( *cur >= '0' && *cur <= '9' ) if ( *m_cur >= _T('0') && *m_cur <= _T('9') )
{ {
skip_token( cur ); skip_token( m_cur );
continue; continue;
} }
if ( *cur == '}' ) if ( *m_cur == _T('}') )
{ {
if ( mCurCtxType != SP_CTX_CLASS ) if ( mCurCtxType != SP_CTX_CLASS )
{ {
@@ -1083,13 +1083,13 @@ spFile* CJSourceParser::Parse( char* start, char* end )
// DBG:: unexpected closing-bracket found // DBG:: unexpected closing-bracket found
//ASSERT(0); //ASSERT(0);
skip_token( cur ); // just skip it skip_token( m_cur ); // just skip it
continue; continue;
} }
if ( mpCurCtx->GetType() == SP_CTX_CLASS ) if ( mpCurCtx->GetType() == SP_CTX_CLASS )
{ {
int curOfs = ( (cur+1) - _gSrcStart ); int curOfs = ( (m_cur+1) - _gSrcStart );
mpCurCtx->mContextLength = ( curOfs - mpCurCtx->mSrcOffset ); mpCurCtx->mContextLength = ( curOfs - mpCurCtx->mSrcOffset );
} }
@@ -1113,21 +1113,21 @@ spFile* CJSourceParser::Parse( char* start, char* end )
mIsTemplate = 0; mIsTemplate = 0;
} }
skip_token( cur ); skip_token( m_cur );
continue; continue;
} }
bool isAMacro = false; bool isAMacro = false;
if ( is_function( cur, isAMacro ) ) if ( is_function( m_cur, isAMacro ) )
{ {
if ( isAMacro ) if ( isAMacro )
{ {
skip_token( cur ); skip_token( m_cur );
continue; continue;
} }
char* savedPos = cur; char* savedPos = m_cur;
int tmpLnNo; int tmpLnNo;
store_line_no( tmpLnNo ); store_line_no( tmpLnNo );
@@ -1135,17 +1135,17 @@ spFile* CJSourceParser::Parse( char* start, char* end )
isAMacro = false; isAMacro = false;
if ( !ParseNameAndRetVal( cur, isAMacro ) ) if ( !ParseNameAndRetVal( m_cur, isAMacro ) )
{ {
if ( !isAMacro ) if ( !isAMacro )
{ {
cur = savedPos; m_cur = savedPos;
SkipFunction( cur ); SkipFunction( m_cur );
} }
continue; continue;
} }
if ( !ParseArguments( cur ) ) if ( !ParseArguments( m_cur ) )
{ {
// failure while parsing arguments, // failure while parsing arguments,
// remove enclosing operation context // remove enclosing operation context
@@ -1154,8 +1154,8 @@ spFile* CJSourceParser::Parse( char* start, char* end )
mpCurCtx = mpCurCtx->GetOutterContext(); mpCurCtx = mpCurCtx->GetOutterContext();
mpCurCtx->RemoveChild( pFailed ); mpCurCtx->RemoveChild( pFailed );
skip_to_eol( cur ); skip_to_eol( m_cur );
//cur = savedPos; //m_cur = savedPos;
} }
else else
{ {
@@ -1163,7 +1163,7 @@ spFile* CJSourceParser::Parse( char* start, char* end )
clear_commets_queue(); clear_commets_queue();
SkipFunctionBody( cur ); SkipFunctionBody( m_cur );
mpCurCtx = mpCurCtx->GetOutterContext(); mpCurCtx = mpCurCtx->GetOutterContext();
@@ -1180,11 +1180,11 @@ spFile* CJSourceParser::Parse( char* start, char* end )
{ {
// non-class members are ignored // non-class members are ignored
skip_token( cur ); // skip the end of statement skip_token( m_cur ); // skip the end of statement
continue; continue;
} }
ParseMemberVar( cur ); ParseMemberVar( m_cur );
} }
} while( 1 ); } while( 1 );
@@ -1196,7 +1196,7 @@ void CJSourceParser::AttachComments( spContext& ctx, wxChar* cur )
MCommentListT& lst = ctx.GetCommentList(); MCommentListT& lst = ctx.GetCommentList();
char* prevComEnd = 0; wxChar* prevComEnd = 0;
int tmpLnNo; int tmpLnNo;
store_line_no( tmpLnNo ); store_line_no( tmpLnNo );
@@ -1209,32 +1209,31 @@ void CJSourceParser::AttachComments( spContext& ctx, wxChar* cur )
lst.push_back( pComment ); lst.push_back( pComment );
// find the end of comment // find the end of comment
char* start = _gCommentsQueue[i]; wxChar* start = _gCommentsQueue[i];
pComment->mIsMultiline = ( *(start+1) == '*' ); pComment->mIsMultiline = ( *(start+1) == _T('*') );
// first comment in the queue and multiline // first comment in the queue and multiline
// comments are always treated as a begining // comments are always treated as a begining
// of the new paragraph in the comment text // of the new paragraph in the comment text
if ( i == 0 ) if ( i == 0 )
{
pComment->mStartsPar = true; pComment->mStartsPar = true;
else }
if ( pComment->mIsMultiline ) else if ( pComment->mIsMultiline )
{
pComment->mStartsPar = true; pComment->mStartsPar = true;
}
else else
{ {
// find out wheather there is a new-line // find out wheather there is a new-line
// between to adjecent comments // between to adjecent comments
wxChar* prevLine = start;
char* prevLine = start;
skip_to_prev_line(prevLine); skip_to_prev_line(prevLine);
if ( prevLine >= prevComEnd ) if ( prevLine >= prevComEnd )
pComment->mStartsPar = true; pComment->mStartsPar = true;
else else
pComment->mStartsPar = false; pComment->mStartsPar = false;
@@ -1243,7 +1242,6 @@ void CJSourceParser::AttachComments( spContext& ctx, wxChar* cur )
prevComEnd = set_comment_text( pComment->m_Text, start ); prevComEnd = set_comment_text( pComment->m_Text, start );
} }
// attach comments which are at the end of the line // attach comments which are at the end of the line
// of the given context (if any) // of the given context (if any)
@@ -1255,7 +1253,7 @@ void CJSourceParser::AttachComments( spContext& ctx, wxChar* cur )
set_comment_text( pComment->m_Text, cur ); set_comment_text( pComment->m_Text, cur );
pComment->mStartsPar = 1; pComment->mStartsPar = 1;
pComment->mIsMultiline = ( *(cur+1) == '*' ); pComment->mIsMultiline = ( *(cur+1) == _T('*') );
// mark this comment, so that it would not // mark this comment, so that it would not
// get in the comments list of the next context // get in the comments list of the next context

View File

@@ -34,17 +34,17 @@ class CJSourceParser : public SourceParserBase
{ {
protected: protected:
// begining of the full-text area of the source file // begining of the full-text area of the source file
char* mpStart; wxChar* mpStart;
// points to first character after the end // points to first character after the end
// of teh full-text area // of teh full-text area
char* mpEnd; wxChar* mpEnd;
// current "privacy level" // current "privacy level"
int mCurVis; int mCurVis;
// current parsing position int full-text area // current parsing position int full-text area
char* cur; wxChar* m_cur;
// about the current class // about the current class
bool mIsVirtual; bool mIsVirtual;

View File

@@ -117,14 +117,14 @@ RipperDocGen::RipperDocGen()
mpCurClassSect(0) mpCurClassSect(0)
{ {
// topIndex is not referenced // topIndex is not referenced
mpTopIdx = new ScriptSection( "Source Code Contents" , "", &mTopTempl , 0 ); mpTopIdx = new ScriptSection( "Source Code Contents" , wxEmptyString, &mTopTempl , 0 );
mpClassIdx = new ScriptSection( "Classes Reference" , "", &mContentIdxTempl, &mRefTempl ); mpClassIdx = new ScriptSection( "Classes Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
mpEnumIdx = new ScriptSection( "Enumerations Reference" , "", &mContentIdxTempl, &mRefTempl ); mpEnumIdx = new ScriptSection( "Enumerations Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
mpTypeDefIdx = new ScriptSection( "Type Definitions Reference" , "", &mContentIdxTempl, &mRefTempl ); mpTypeDefIdx = new ScriptSection( "Type Definitions Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
mpMacroIdx = new ScriptSection( "Macros Reference" , "", &mContentIdxTempl, &mRefTempl ); mpMacroIdx = new ScriptSection( "Macros Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
mpGlobalVarsIdx = new ScriptSection( "Global Variables Reference" , "", &mContentIdxTempl, &mRefTempl ); mpGlobalVarsIdx = new ScriptSection( "Global Variables Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
mpGlobalFuncIdx = new ScriptSection( "Global Functions Reference", "", &mContentIdxTempl, &mRefTempl ); mpGlobalFuncIdx = new ScriptSection( "Global Functions Reference", wxEmptyString, &mContentIdxTempl, &mRefTempl );
mpConstIdx = new ScriptSection( "Constants Reference" , "", &mContentIdxTempl, &mRefTempl ); mpConstIdx = new ScriptSection( "Constants Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
// assemble top index // assemble top index
mpTopIdx->AddSection( mpClassIdx , 1 ); mpTopIdx->AddSection( mpClassIdx , 1 );
@@ -225,12 +225,12 @@ void RipperDocGen::AppendMulitilineStr( wxString& st, wxString& mlStr )
void RipperDocGen::AppendHighlightedSource( wxString& st, wxString source ) void RipperDocGen::AppendHighlightedSource( wxString& st, wxString source )
{ {
// FIXME:: below should not be fixed :) // FIXME:: below should not be fixed :)
char buf[1024*32]; wxChar buf[1024*32];
// DBG::: // DBG:::
// ASSERT( source.length() + 1 < sizeof(buf) ); // ASSERT( source.length() + 1 < sizeof(buf) );
strcpy( buf, source.c_str() ); wxStrcpy( buf, source.c_str() );
// highlight things // highlight things
mSrcPainter.Init(); mSrcPainter.Init();
@@ -243,7 +243,7 @@ bool RipperDocGen::CheckIfUncommented( spContext& ctx, ScriptSection& toSect )
if ( ctx.HasComments() ) return 0; if ( ctx.HasComments() ) return 0;
toSect.AddReference( toSect.AddReference(
new ScriptSection( GetScopedName( ctx ), "", 0, &mDeadRefTempl ) new ScriptSection( GetScopedName( ctx ), wxEmptyString, 0, &mDeadRefTempl )
); );
return 1; return 1;
@@ -330,7 +330,7 @@ void RipperDocGen::LinkSuperClassRefs()
if ( !pFound ) if ( !pFound )
{ {
ScriptSection* pNotFound = ScriptSection* pNotFound =
new ScriptSection( superClName, "", 0, &mDeadRefTempl ); new ScriptSection( superClName, wxEmptyString, 0, &mDeadRefTempl );
pSuperSect->AddReference( pNotFound ); pSuperSect->AddReference( pNotFound );
} }
@@ -366,7 +366,7 @@ void RipperDocGen::ProcessFile( const char* sourceFile )
void RipperDocGen::VisitEnumeration( spEnumeration& en ) void RipperDocGen::VisitEnumeration( spEnumeration& en )
{ {
// FOR NOW:: do not reference "nameless" enums // FOR NOW:: do not reference "nameless" enums
if ( en.GetName() == "" ) return; if ( en.GetName().empty() ) return;
if ( CheckIfUncommented( en, *mpEnumIdx ) ) if ( CheckIfUncommented( en, *mpEnumIdx ) )
return; return;
@@ -466,20 +466,20 @@ void RipperDocGen::VisitClass( spClass& cl )
// to the section where this class is represented // to the section where this class is represented
cl.SetUserData( mpCurClassSect ); cl.SetUserData( mpCurClassSect );
ScriptSection* pSuper = new ScriptSection( "Derived from" ,"", &mOutLine1Templ,0, 1 ); ScriptSection* pSuper = new ScriptSection( "Derived from" ,wxEmptyString, &mOutLine1Templ,0, 1 );
ScriptSection* pPublic = new ScriptSection( "Public members" ,"", &mOutLineTempl,0, 1 ); ScriptSection* pPublic = new ScriptSection( "Public members" ,wxEmptyString, &mOutLineTempl,0, 1 );
ScriptSection* pProtected = new ScriptSection( "Protected members" ,"", &mOutLineTempl,0, 1 ); ScriptSection* pProtected = new ScriptSection( "Protected members" ,wxEmptyString, &mOutLineTempl,0, 1 );
ScriptSection* pPrivate = new ScriptSection( "Private members" ,"", &mOutLineTempl,0, 1 ); ScriptSection* pPrivate = new ScriptSection( "Private members" ,wxEmptyString, &mOutLineTempl,0, 1 );
pPublic->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) ); pPublic->AddSection( new ScriptSection( "Operations", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
pPublic->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) ); pPublic->AddSection( new ScriptSection( "Attributes", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
pProtected->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) ); pProtected->AddSection( new ScriptSection( "Operations", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
pProtected->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) ); pProtected->AddSection( new ScriptSection( "Attributes", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
pPrivate->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) ); pPrivate->AddSection( new ScriptSection( "Operations", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
pPrivate->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) ); pPrivate->AddSection( new ScriptSection( "Attributes", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
mpCurClassSect->AddSection( pSuper ); mpCurClassSect->AddSection( pSuper );
mpCurClassSect->AddSection( pPublic ); mpCurClassSect->AddSection( pPublic );

View File

@@ -622,7 +622,7 @@ void SourcePainter::Init(bool assembleResultString)
mCommentIsMultiline = 0; mCommentIsMultiline = 0;
mCollectResultsOn = assembleResultString; mCollectResultsOn = assembleResultString;
mResultStr = ""; mResultStr = wxEmptyString;
mBlocks.erase( mBlocks.begin(), mBlocks.end() ); mBlocks.erase( mBlocks.begin(), mBlocks.end() );
} }
@@ -635,12 +635,12 @@ static int rank_tags_map[] =
TAG_GREEN_FONT TAG_GREEN_FONT
}; };
void SourcePainter::GetResultString(string& result, MarkupTagsT tags) void SourcePainter::GetResultString(wxString& result, MarkupTagsT tags)
{ {
// this method works, only if results of processing // this method works, only if results of processing
// are collected // are collected
// ASSERT( mCollectResultsOn ); // ASSERT( mCollectResultsOn );
result = ""; result = wxEmptyString;
unsigned pos = 0; unsigned pos = 0;
@@ -654,8 +654,9 @@ void SourcePainter::GetResultString(string& result, MarkupTagsT tags)
result += tags[ rank_tags_map[rank] ].start; result += tags[ rank_tags_map[rank] ].start;
for( unsigned n = 0; n != len; ++n ) for( unsigned n = 0; n != len; ++n )
{
result += mResultStr[(unsigned int)(pos+n)]; result += mResultStr[(unsigned int)(pos+n)];
}
pos += len; pos += len;

View File

@@ -93,7 +93,7 @@ public:
// generates string of highlighted source for the scipting // generates string of highlighted source for the scipting
// language given by "tags" argument // language given by "tags" argument
virtual void GetResultString(string& result, MarkupTagsT tags); virtual void GetResultString(wxString& result, MarkupTagsT tags);
// returns vector of block descriptors, see SPBlockListT definition // returns vector of block descriptors, see SPBlockListT definition
// (block descriptors can be used for fast custom highlighted text generation) // (block descriptors can be used for fast custom highlighted text generation)