diff --git a/utils/HelpGen/src/cjparser.cpp b/utils/HelpGen/src/cjparser.cpp index 9cbf7f2dfd..3c706cbcf8 100644 --- a/utils/HelpGen/src/cjparser.cpp +++ b/utils/HelpGen/src/cjparser.cpp @@ -1621,7 +1621,11 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro ) if ( cur >= start ) { string rettype = string( start, size_t( cur-start ) ); - rettype.Replace("WXDLLEXPORT ", ""); // FIXME just for now... + // FIXME just for now... + string::size_type pos = 0; + string toerase("WXDLLEXPORT "); + while((pos = rettype.find(toerase, pos)) != string::npos) + rettype.erase(pos, toerase.length()); pOp->mRetType = rettype; } @@ -1912,11 +1916,11 @@ void CJSourceParser::ParseMemberVar( char*& cur ) if ( !pAttr ) continue; - if ( !pAttr->mType ) + if ( pAttr->mType.empty() ) pAttr->mType = type; pAttr->mVisibility = mCurVis; - if ( !!pAttr->mName ) + if ( !pAttr->mName.empty() ) arrange_indirection_tokens_between( pAttr->mType, pAttr->mName ); } diff --git a/utils/HelpGen/src/ifcontext.cpp b/utils/HelpGen/src/ifcontext.cpp index 79f9c72a44..85e73c04aa 100644 --- a/utils/HelpGen/src/ifcontext.cpp +++ b/utils/HelpGen/src/ifcontext.cpp @@ -267,7 +267,7 @@ void spInterFileContext::WriteToFiles() { FILE* fp = fopen( mFiles[i].c_str(), "w+t" ); - if ( int(fp) > 0 ) + if ( fp != NULL ) { fwrite( mContents[i].c_str(), sizeof(char), mContents[i].length(), fp ); diff --git a/utils/HelpGen/src/scriptbinder.cpp b/utils/HelpGen/src/scriptbinder.cpp index 851b30388c..6a5ed52c57 100644 --- a/utils/HelpGen/src/scriptbinder.cpp +++ b/utils/HelpGen/src/scriptbinder.cpp @@ -591,7 +591,7 @@ bool DocGeneratorBase::SaveDocument( const char* fname, { FILE* fp = fopen( fname, fopenOptions ); - if ( (int)fp == -1 ) return 0; + if ( !fp ) return 0; ScriptStream stm; diff --git a/utils/HelpGen/src/scriptbinder.h b/utils/HelpGen/src/scriptbinder.h index 3d638e4290..f95bdcc8d3 100644 --- a/utils/HelpGen/src/scriptbinder.h +++ b/utils/HelpGen/src/scriptbinder.h @@ -28,8 +28,12 @@ #include "wxstlvec.h" #include "wx/string.h" - // FIXME:: dirty! - typedef wxString string; + #ifdef wxUSE_STD_STRING + using std::string; + #else + // FIXME:: dirty! + typedef wxString string; + #endif #endif diff --git a/utils/HelpGen/src/sourcepainter.h b/utils/HelpGen/src/sourcepainter.h index 333059a03a..c2456e4da2 100644 --- a/utils/HelpGen/src/sourcepainter.h +++ b/utils/HelpGen/src/sourcepainter.h @@ -32,8 +32,12 @@ #include "wxstlvec.h" #include "wx/string.h" - // FIXME:: dirty! - #define string wxString + #ifdef wxUSE_STD_STRING + using std::string; + #else + // FIXME:: dirty! + #define string wxString + #endif typedef WXSTL_VECTOR_SHALLOW_COPY(int) SPBlockListT; diff --git a/utils/HelpGen/src/srcparser.cpp b/utils/HelpGen/src/srcparser.cpp index 9895113751..f98154c822 100644 --- a/utils/HelpGen/src/srcparser.cpp +++ b/utils/HelpGen/src/srcparser.cpp @@ -533,7 +533,7 @@ spFile* SourceParserBase::ParseFile( const char* fname ) FILE* fp = fopen( fname, "rt" ); - if ( (int)fp == -1 || !fp ) return NULL; + if ( !fp ) return NULL; int sz = fread( mpFileBuf, 1, mFileBufSz, fp ); @@ -587,7 +587,7 @@ void spAttribute::DumpThis(const wxString& indent) const void spOperation::DumpThis(const wxString& indent) const { wxString protection; - if ( !!mScope ) { + if ( !mScope.empty() ) { switch ( mVisibility ) { case SP_VIS_PUBLIC: protection = "public"; diff --git a/utils/HelpGen/src/srcparser.h b/utils/HelpGen/src/srcparser.h index a6ee4668d3..50376aa206 100644 --- a/utils/HelpGen/src/srcparser.h +++ b/utils/HelpGen/src/srcparser.h @@ -30,9 +30,12 @@ #include "wx/string.h" #include "wxstlvec.h" - // FOR NOW:: quick n' dirty: - - #define string wxString + #ifdef wxUSE_STD_STRING + using std::string; + #else + // FOR NOW:: quick n' dirty: + #define string wxString + #endif #endif