]> git.saurik.com Git - wxWidgets.git/commitdiff
Warning fixes. Code cleanup. Whitespaces and tabs removed.
authorWłodzimierz Skiba <abx@abx.art.pl>
Thu, 17 Jun 2004 19:00:22 +0000 (19:00 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Thu, 17 Jun 2004 19:00:22 +0000 (19:00 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/HelpGen/src/HelpGen.cpp
utils/HelpGen/src/cjparser.cpp
utils/HelpGen/src/docripper.cpp
utils/HelpGen/src/scriptbinder.cpp
utils/HelpGen/src/sourcepainter.cpp

index 5bd04744c7c268759239b6abff4478450a4f49ef..83747829aeef9542fa90d65a8a351cf236e4ac48 100644 (file)
@@ -191,17 +191,17 @@ public:
     bool FlushAll()
     {
         if ( m_text.empty() )
-            return TRUE;
+            return true;
 
         if ( !Write(m_text) ) {
             wxLogError("Failed to output generated documentation.");
 
-            return FALSE;
+            return false;
         }
 
         m_text.clear();
 
-        return TRUE;
+        return true;
     }
 
 private:
@@ -223,19 +223,19 @@ public:
     // already have)
     bool AddNamesFromFile(const wxString& filename);
 
-    // return TRUE if we ignore this function
+    // return true if we ignore this function
     bool IgnoreMethod(const wxString& classname,
                       const wxString& funcname) const
     {
         if ( IgnoreClass(classname) )
-            return TRUE;
+            return true;
 
         IgnoreListEntry ignore(classname, funcname);
 
         return m_ignore.Index(&ignore) != wxNOT_FOUND;
     }
 
-    // return TRUE if we ignore this class entirely
+    // return true if we ignore this class entirely
     bool IgnoreClass(const wxString& classname) const
     {
         IgnoreListEntry ignore(classname, "");
@@ -321,7 +321,7 @@ protected:
     wxTeXFile m_file;           // file we're writing to now
 
     // state variables
-    bool m_inClass,         // TRUE after file successfully opened
+    bool m_inClass,         // true after file successfully opened
          m_inTypesSection,  // enums & typedefs go there
          m_inMethodSection, // functions go here
          m_isFirstParam;    // first parameter of current function?
@@ -367,10 +367,10 @@ public:
     DocManager(bool checkParamNames);
     ~DocManager();
 
-    // returns FALSE on failure
+    // returns false on failure
     bool ParseTeXFile(const wxString& filename);
 
-    // returns FALSE if there were any differences
+    // returns false if there were any differences
     bool DumpDifferences(spContext *ctxTop) const;
 
     // get our `ignore' object
@@ -397,12 +397,12 @@ protected:
     }
 
     // skips characters until the next 'c' in '*pp' unless it ends before in
-    // which case FALSE is returned and pp points to '\0', otherwise TRUE is
+    // which case false is returned and pp points to '\0', otherwise true is
     // returned and pp points to 'c'
     bool SkipUntil(const char **pp, char c);
 
     // the same as SkipUntil() but only spaces are skipped: on first non space
-    // character different from 'c' the function stops and returns FALSE
+    // character different from 'c' the function stops and returns false
     bool SkipSpaceUntil(const char **pp, char c);
 
     // extract the string between {} and modify '*pp' to point at the
@@ -463,7 +463,7 @@ protected:
     };
 
 public: // FIXME: macro requires it
-    WX_DEFINE_ARRAY(ParamInfo *, ArrayParamInfo);
+    WX_DEFINE_ARRAY_PTR(ParamInfo *, ArrayParamInfo);
 
     // info about a function
     struct MethodInfo
@@ -505,8 +505,8 @@ public: // FIXME: macro requires it
         ArrayParamInfo m_params;
     };
 
-    WX_DEFINE_ARRAY(MethodInfo *, ArrayMethodInfo);
-    WX_DEFINE_ARRAY(ArrayMethodInfo *, ArrayMethodInfos);
+    WX_DEFINE_ARRAY_PTR(MethodInfo *, ArrayMethodInfo);
+    WX_DEFINE_ARRAY_PTR(ArrayMethodInfo *, ArrayMethodInfos);
 
 private:
     // first array contains the names of all classes we found, the second has a
@@ -594,8 +594,8 @@ int main(int argc, char **argv)
     wxArrayString filesH, filesTeX;
     wxString directoryOut,      // directory for 'dmup' output
              ignoreFile;        // file with classes/functions to ignore
-    bool overwrite = FALSE,     // overwrite existing files during 'dump'?
-         paramNames = FALSE;    // check param names during 'diff'?
+    bool overwrite = false,     // overwrite existing files during 'dump'?
+         paramNames = false;    // check param names during 'diff'?
 
     for ( int current = 1; current < argc ; current++ ) {
         // all options have one letter
@@ -609,7 +609,7 @@ int main(int argc, char **argv)
 
                     case 'q':
                         // be quiet
-                        wxLog::GetActiveTarget()->SetVerbose(FALSE);
+                        wxLog::GetActiveTarget()->SetVerbose(false);
                         continue;
 
                     case 'H':
@@ -642,7 +642,7 @@ int main(int argc, char **argv)
                             break;
                         }
 
-                        paramNames = TRUE;
+                        paramNames = true;
                         continue;
 
                     case 'f':
@@ -652,7 +652,7 @@ int main(int argc, char **argv)
                             break;
                         }
 
-                        overwrite = TRUE;
+                        overwrite = true;
                         continue;
 
                     case 'o':
@@ -762,7 +762,7 @@ int main(int argc, char **argv)
             wxLogError("Can't complete diff.");
 
             // failure
-            return FALSE;
+            return false;
         }
 
         DocManager docman(paramNames);
@@ -802,7 +802,7 @@ void HelpGenVisitor::Reset()
 {
     m_inClass =
     m_inTypesSection =
-    m_inMethodSection = FALSE;
+    m_inMethodSection = false;
 
     m_classname =
     m_funcName =
@@ -839,7 +839,7 @@ void HelpGenVisitor::InsertEnumDocs()
 void HelpGenVisitor::InsertDataStructuresHeader()
 {
     if ( !m_inTypesSection ) {
-        m_inTypesSection = TRUE;
+        m_inTypesSection = true;
 
         m_file.WriteVerbatim("\\wxheading{Data structures}\n\n");
     }
@@ -848,7 +848,7 @@ void HelpGenVisitor::InsertDataStructuresHeader()
 void HelpGenVisitor::InsertMethodsHeader()
 {
     if ( !m_inMethodSection ) {
-        m_inMethodSection = TRUE;
+        m_inMethodSection = true;
 
         m_file.WriteVerbatim( "\\latexignore{\\rtfignore{\\wxheading{Members}}}\n\n");
     }
@@ -876,40 +876,42 @@ void HelpGenVisitor::CloseFunction()
 
 void HelpGenVisitor::CloseClass()
 {
-       CloseFunction();
+    CloseFunction();
 
-    if ( m_inClass ) {
+    if ( m_inClass ) 
+    {
         size_t count = m_arrayFuncDocs.GetCount();
-        if ( count ) {
-                       size_t n;
+        if ( count ) 
+        {
+            size_t n;
             FunctionDocEntry::classname = m_classname;
 
             m_arrayFuncDocs.Sort(FunctionDocEntry::Compare);
 
-                       // Now examine each first line and if it's been seen, cut it
-                       // off (it's a duplicate \membersection)
-                       wxHashTable membersections(wxKEY_STRING);
+            // Now examine each first line and if it's been seen, cut it
+            // off (it's a duplicate \membersection)
+            wxHashTable membersections(wxKEY_STRING);
 
             for ( n = 0; n < count; n++ )
-                       {
+            {
                 wxString section(m_arrayFuncDocs[n].text);
 
-                               // Strip leading whitespace
-                               int pos = section.Find("\\membersection");
-                               if (pos > -1)
-                               {
-                                       section = section.Mid(pos);
-                               }
-
-                               wxString ms(section.BeforeFirst(wxT('\n')));
-                               if (membersections.Get(ms))
-                               {
-                                       m_arrayFuncDocs[n].text = section.AfterFirst(wxT('\n'));
-                               }
-                               else
-                               {
-                                       membersections.Put(ms, & membersections);
-                               }
+                // Strip leading whitespace
+                int pos = section.Find("\\membersection");
+                if (pos > -1)
+                {
+                    section = section.Mid(pos);
+                }
+
+                wxString ms(section.BeforeFirst(wxT('\n')));
+                if (membersections.Get(ms))
+                {
+                    m_arrayFuncDocs[n].text = section.AfterFirst(wxT('\n'));
+                }
+                else
+                {
+                    membersections.Put(ms, & membersections);
+                }
             }
 
             for ( n = 0; n < count; n++ ) {
@@ -919,10 +921,10 @@ void HelpGenVisitor::CloseClass()
             m_arrayFuncDocs.Empty();
         }
 
-        m_inClass = FALSE;
+        m_inClass = false;
         m_classname.clear();
     }
-       m_file.FlushAll();
+    m_file.FlushAll();
 }
 
 void HelpGenVisitor::EndVisit()
@@ -934,11 +936,11 @@ void HelpGenVisitor::EndVisit()
     m_fileHeader.Empty();
 
     m_file.FlushAll();
-       if (m_file.IsOpened())
-       {
-               m_file.Flush();
-               m_file.Close();
-       }
+    if (m_file.IsOpened())
+    {
+        m_file.Flush();
+        m_file.Close();
+    }
 
     wxLogVerbose("%s: finished generating for the current file.",
                  GetCurrentTime("%H:%M:%S"));
@@ -955,11 +957,11 @@ void HelpGenVisitor::VisitClass( spClass& cl )
 {
     CloseClass();
 
-       if (m_file.IsOpened())
-       {
-               m_file.Flush();
-               m_file.Close();
-       }
+    if (m_file.IsOpened())
+    {
+        m_file.Flush();
+        m_file.Close();
+    }
 
     wxString name = cl.GetName();
 
@@ -999,7 +1001,7 @@ void HelpGenVisitor::VisitClass( spClass& cl )
     }
 
     m_inMethodSection =
-    m_inTypesSection = FALSE;
+    m_inTypesSection = false;
 
     wxLogInfo("Created new file '%s' for class '%s'.",
               filename.c_str(), name.c_str());
@@ -1103,7 +1105,7 @@ void HelpGenVisitor::VisitClass( spClass& cl )
         derived << "No base class";
     }
     else {
-        bool first = TRUE;
+        bool first = true;
         for ( StrListT::const_iterator i = baseClasses.begin();
               i != baseClasses.end();
               i++ ) {
@@ -1112,7 +1114,7 @@ void HelpGenVisitor::VisitClass( spClass& cl )
                 derived << "\\\\\n";
             }
             else {
-                first = FALSE;
+                first = false;
             }
 
             wxString baseclass = *i;
@@ -1136,7 +1138,7 @@ void HelpGenVisitor::VisitClass( spClass& cl )
     InsertTypedefDocs();
     InsertEnumDocs();
 
-       //m_file.Flush();
+    //m_file.Flush();
 }
 
 void HelpGenVisitor::VisitEnumeration( spEnumeration& en )
@@ -1269,7 +1271,7 @@ void HelpGenVisitor::VisitOperation( spOperation& op )
 
     // save state info
     m_funcName = funcname;
-    m_isFirstParam = TRUE;
+    m_isFirstParam = true;
 
     m_textStoredFunctionComment = GetAllComments(op);
 
@@ -1283,19 +1285,19 @@ void HelpGenVisitor::VisitOperation( spOperation& op )
         funcname = dtor;
     }
 
-       m_textFunc.Printf("\n"
-               "\\membersection{%s::%s}\\label{%s}\n",
-               m_classname.c_str(), funcname.c_str(),
-               MakeLabel(m_classname, funcname).c_str());
+    m_textFunc.Printf("\n"
+        "\\membersection{%s::%s}\\label{%s}\n",
+        m_classname.c_str(), funcname.c_str(),
+        MakeLabel(m_classname, funcname).c_str());
 
-       wxString func;
-       func.Printf("\n"
+    wxString func;
+    func.Printf("\n"
                       "\\%sfunc{%s%s}{%s}{",
                       op.mIsConstant ? "const" : "",
                       op.mIsVirtual ? "virtual " : "",
                       op.mRetType.c_str(),
                       funcname.c_str());
-       m_textFunc += func;
+    m_textFunc += func;
 }
 
 void HelpGenVisitor::VisitParameter( spParameter& param )
@@ -1304,7 +1306,7 @@ void HelpGenVisitor::VisitParameter( spParameter& param )
         return;
 
     if ( m_isFirstParam ) {
-        m_isFirstParam = FALSE;
+        m_isFirstParam = false;
     }
     else {
         m_textFunc << ", ";
@@ -1407,11 +1409,11 @@ bool DocManager::ParseTeXFile(const wxString& filename)
 
     wxFile file(m_filename, wxFile::read);
     if ( !file.IsOpened() )
-        return FALSE;
+        return false;
 
     off_t len = file.Length();
     if ( len == wxInvalidOffset )
-        return FALSE;
+        return false;
 
     char *buf = new char[len + 1];
     buf[len] = '\0';
@@ -1419,7 +1421,7 @@ bool DocManager::ParseTeXFile(const wxString& filename)
     if ( file.Read(buf, len) == wxInvalidOffset ) {
         delete [] buf;
 
-        return FALSE;
+        return false;
     }
 
     // reinit everything
@@ -1525,7 +1527,7 @@ bool DocManager::ParseTeXFile(const wxString& filename)
         TeXUnfilter(&returnType);
 
         current++;
-        if ( !SkipSpaceUntil(&current, '{') ) { 
+        if ( !SkipSpaceUntil(&current, '{') ) {
             wxLogWarning("file %s(%d): '{' expected after return type",
                          m_filename.c_str(), m_line);
 
@@ -1545,8 +1547,8 @@ bool DocManager::ParseTeXFile(const wxString& filename)
         current = funcEnd + 1;
 
         // trim spaces from both sides
-        funcName.Trim(FALSE);
-        funcName.Trim(TRUE);
+        funcName.Trim(false);
+        funcName.Trim(true);
 
         // special cases: '$...$' may be used for LaTeX inline math, remove the
         // '$'s
@@ -1597,7 +1599,7 @@ bool DocManager::ParseTeXFile(const wxString& filename)
 
         wxArrayString paramNames, paramTypes, paramValues;
 
-        bool isVararg = FALSE;
+        bool isVararg = false;
 
         current++; // skip '\\'
         lenMatch = TryMatch(current, "void");
@@ -1629,7 +1631,7 @@ bool DocManager::ParseTeXFile(const wxString& filename)
                     // vararg function?
                     wxString paramText = ExtractStringBetweenBraces(&current);
                     if ( paramText == "..." ) {
-                        isVararg = TRUE;
+                        isVararg = true;
                     }
                     else {
                         wxLogWarning("Parameters of '%s::%s' are in "
@@ -1715,20 +1717,20 @@ bool DocManager::ParseTeXFile(const wxString& filename)
     wxLogVerbose("%s: finished parsing doc file '%s'.\n",
                  GetCurrentTime("%H:%M:%S"), m_filename.c_str());
 
-    return TRUE;
+    return true;
 }
 
 bool DocManager::DumpDifferences(spContext *ctxTop) const
 {
     typedef MMemberListT::const_iterator MemberIndex;
 
-    bool foundDiff = FALSE;
+    bool foundDiff = false;
 
     // flag telling us whether the given class was found at all in the header
     size_t nClass, countClassesInDocs = m_classes.GetCount();
     bool *classExists = new bool[countClassesInDocs];
     for ( nClass = 0; nClass < countClassesInDocs; nClass++ ) {
-        classExists[nClass] = FALSE;
+        classExists[nClass] = false;
     }
 
     // ctxTop is normally an spFile
@@ -1747,7 +1749,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
         int index = m_classes.Index(nameClass);
         if ( index == wxNOT_FOUND ) {
             if ( !m_ignoreNames.IgnoreClass(nameClass) ) {
-                foundDiff = TRUE;
+                foundDiff = true;
 
                 wxLogError("Class '%s' is not documented at all.",
                            nameClass.c_str());
@@ -1757,7 +1759,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
             continue;
         }
         else {
-            classExists[index] = TRUE;
+            classExists[index] = true;
         }
 
         // array of method descriptions for this class
@@ -1767,7 +1769,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
         // flags telling if we already processed given function
         bool *methodExists = new bool[countMethods];
         for ( nMethod = 0; nMethod < countMethods; nMethod++ ) {
-            methodExists[nMethod] = FALSE;
+            methodExists[nMethod] = false;
         }
 
         wxArrayString aOverloadedMethods;
@@ -1790,7 +1792,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
 
             if ( aMethodsWithSameName.IsEmpty() && ctxMethod->IsPublic() ) {
                 if ( !m_ignoreNames.IgnoreMethod(nameClass, nameMethod) ) {
-                    foundDiff = TRUE;
+                    foundDiff = true;
 
                     wxLogError("'%s::%s' is not documented.",
                                nameClass.c_str(),
@@ -1802,7 +1804,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
             }
             else if ( aMethodsWithSameName.GetCount() == 1 ) {
                 index = (size_t)aMethodsWithSameName[0u];
-                methodExists[index] = TRUE;
+                methodExists[index] = true;
 
                 if ( m_ignoreNames.IgnoreMethod(nameClass, nameMethod) )
                     continue;
@@ -1858,7 +1860,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
                         const ParamInfo& param = method.GetParam(nParam);
                         if ( m_checkParamNames &&
                              (param.GetName() != ctxParam->mName) ) {
-                            foundDiff = TRUE;
+                            foundDiff = true;
 
                             wxLogError("Parameter #%d of '%s::%s' should be "
                                        "'%s' and not '%s'.",
@@ -1872,7 +1874,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
                         }
 
                         if ( param.GetType() != ctxParam->mType ) {
-                            foundDiff = TRUE;
+                            foundDiff = true;
 
                             wxLogError("Type of parameter '%s' of '%s::%s' "
                                        "should be '%s' and not '%s'.",
@@ -1908,7 +1910,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
                     // mark all methods with this name as existing
                     for ( nMethod = 0; nMethod < countMethods; nMethod++ ) {
                         if ( methods[nMethod]->GetName() == nameMethod )
-                            methodExists[nMethod] = TRUE;
+                            methodExists[nMethod] = true;
                     }
 
                     aOverloadedMethods.Add(nameMethod);
@@ -1927,7 +1929,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
             if ( !methodExists[nMethod] ) {
                 const wxString& nameMethod = methods[nMethod]->GetName();
                 if ( !m_ignoreNames.IgnoreMethod(nameClass, nameMethod) ) {
-                    foundDiff = TRUE;
+                    foundDiff = true;
 
                     wxLogError("'%s::%s' is documented but doesn't exist.",
                                nameClass.c_str(),
@@ -1942,7 +1944,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
     // check that all classes we found in the docs really exist
     for ( nClass = 0; nClass < countClassesInDocs; nClass++ ) {
         if ( !classExists[nClass] ) {
-            foundDiff = TRUE;
+            foundDiff = true;
 
             wxLogError("Class '%s' is documented but doesn't exist.",
                        m_classes[nClass].c_str());
@@ -1978,11 +1980,11 @@ bool IgnoreNamesHandler::AddNamesFromFile(const wxString& filename)
 {
     wxFile file(filename, wxFile::read);
     if ( !file.IsOpened() )
-        return FALSE;
+        return false;
 
     off_t len = file.Length();
     if ( len == wxInvalidOffset )
-        return FALSE;
+        return false;
 
     char *buf = new char[len + 1];
     buf[len] = '\0';
@@ -1990,7 +1992,7 @@ bool IgnoreNamesHandler::AddNamesFromFile(const wxString& filename)
     if ( file.Read(buf, len) == wxInvalidOffset ) {
         delete [] buf;
 
-        return FALSE;
+        return false;
     }
 
     wxString line;
@@ -2027,7 +2029,7 @@ bool IgnoreNamesHandler::AddNamesFromFile(const wxString& filename)
 
     delete [] buf;
 
-    return TRUE;
+    return true;
 }
 
 // -----------------------------------------------------------------------------
@@ -2115,7 +2117,7 @@ static wxString MakeHelpref(const char *argument)
 static void TeXFilter(wxString* str)
 {
     // TeX special which can be quoted (don't include backslash nor braces as
-    // we generate them 
+    // we generate them
     static wxRegEx reNonSpecialSpecials("[#$%&_]"),
                    reAccents("[~^]");
 
@@ -2130,8 +2132,8 @@ static void TeXFilter(wxString* str)
 static void TeXUnfilter(wxString* str)
 {
     // FIXME may be done much more quickly
-    str->Trim(TRUE);
-    str->Trim(FALSE);
+    str->Trim(true);
+    str->Trim(false);
 
     // undo TeXFilter
     static wxRegEx reNonSpecialSpecials("\\\\([#$%&_{}])"),
@@ -2151,7 +2153,7 @@ static wxString GetAllComments(const spContext& ctx)
         wxString comment = (*i)->GetText();
 
         // don't take comments like "// ----------" &c
-        comment.Trim(FALSE);
+        comment.Trim(false);
         if ( !!comment &&
               comment == wxString(comment[0u], comment.length() - 1) + '\n' )
             comments << "\n";
@@ -2185,6 +2187,9 @@ static const wxString GetVersionString()
 
 /*
    $Log$
+   Revision 1.29  2004/06/17 19:00:22  ABX
+   Warning fixes. Code cleanup. Whitespaces and tabs removed.
+
    Revision 1.28  2004/05/25 11:19:57  JS
    More name changes
 
index fbec4d74dc4604558c54bda6faa29531a17ea011..9cbf7f2dfd6ab132f2bd8a92e85f096cde3d3851 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     22/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Aleskandars Gluchovas
-// Licence:       wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -161,12 +161,12 @@ static inline bool skip_to_next_comment_in_the_line( char*& cur )
                *cur != '/'
              ) ++cur;
 
-        if ( cur == _gSrcEnd ) return FALSE;
+        if ( cur == _gSrcEnd ) return false;
 
         if ( *cur == '/' )
         {
             if ( (*(cur+1) == '*') ||
-                 (*(cur+1) == '/') ) return TRUE;
+                 (*(cur+1) == '/') ) return true;
             else
             {
                 ++cur;
@@ -174,7 +174,7 @@ static inline bool skip_to_next_comment_in_the_line( char*& cur )
             }
         }
 
-        return FALSE;
+        return false;
 
     } while(1);
 }
@@ -381,10 +381,9 @@ static inline bool get_next_token( char*& cur )
     }
 
     if ( cur >= _gSrcEnd )
-
-        return FALSE;
+        return false;
     else
-        return TRUE;
+        return true;
 }
 
 static inline void skip_preprocessor_dir( char*& cur )
@@ -497,13 +496,13 @@ static inline bool cmp_tokens( char* tok1, char* tok2 )
     do
     {
         if ( *(tok1++) != *(tok2++) )
-            return FALSE;
+            return false;
 
         --len;
 
     } while ( --len );
 
-    return TRUE;
+    return true;
 }
 
 static inline bool cmp_tokens_fast( char* tok1, char* tok2, size_t len )
@@ -511,11 +510,11 @@ static inline bool cmp_tokens_fast( char* tok1, char* tok2, size_t len )
     do
     {
         if ( *(tok1++) != *(tok2++) )
-            return FALSE;
+            return false;
 
     } while ( --len );
 
-    return TRUE;
+    return true;
 }
 
 static inline void skip_tempalate_statement( char*& cur )
@@ -741,18 +740,18 @@ static inline bool skip_imp_block( char*& cur )
     while( *cur != '{' && cur < _gSrcEnd )
     {
         skip_token( cur );
-        if ( !get_next_token( cur ) ) return FALSE;
+        if ( !get_next_token( cur ) ) return false;
     }
 
     while( *cur != '}' && cur < _gSrcEnd )
     {
         skip_token( cur );
-        if ( !get_next_token( cur ) ) return FALSE;
+        if ( !get_next_token( cur ) ) return false;
     }
 
     ++cur;
 
-    return TRUE;
+    return true;
 }
 
 static bool is_class_token( char*& cur )
@@ -779,7 +778,7 @@ static bool is_class_token( char*& cur )
 
             return cmp_tokens_fast( cur, "union", 5 );
 
-    return FALSE;
+    return false;
 }
 
 inline static bool is_forward_decl( char* cur )
@@ -788,11 +787,11 @@ inline static bool is_forward_decl( char* cur )
     {
         switch( *cur )
         {
-            case ':' : return FALSE;
-            case '{' : return FALSE;
-            case '(' : return FALSE;
+            case ':' : return false;
+            case '{' : return false;
+            case '(' : return false;
 
-            case ';' : return TRUE;
+            case ';' : return true;
 
             default : break;
         };
@@ -801,12 +800,12 @@ inline static bool is_forward_decl( char* cur )
 
     } while (cur < _gSrcEnd); // prevent running out of bounds
 
-    return FALSE;
+    return false;
 }
 
 inline static bool is_function( char* cur, bool& isAMacro )
 {
-    isAMacro = FALSE;
+    isAMacro = false;
 
     int tmpLnNo;
     store_line_no( tmpLnNo );
@@ -825,10 +824,10 @@ inline static bool is_function( char* cur, bool& isAMacro )
 
     if ( cur > eol )
     {
-        isAMacro = TRUE;
+        isAMacro = true;
         restore_line_no( tmpLnNo );
 
-        return TRUE;
+        return true;
     }
 
     // it's not a macro, go to the begining of arg. list
@@ -840,7 +839,7 @@ inline static bool is_function( char* cur, bool& isAMacro )
         if ( *cur == '(' )
         {
             restore_line_no( tmpLnNo );
-            return TRUE;
+            return true;
         }
 
         // end of statement found without any brackets in it
@@ -849,7 +848,7 @@ inline static bool is_function( char* cur, bool& isAMacro )
         if ( *cur == ';' )
         {
             restore_line_no( tmpLnNo );
-            return FALSE;
+            return false;
         }
 
         ++cur;
@@ -859,7 +858,7 @@ inline static bool is_function( char* cur, bool& isAMacro )
     isAMacro = 1;
     restore_line_no( tmpLnNo );
 
-    return FALSE;
+    return false;
 }
 
 // upon return the cursor is positioned after the
@@ -1018,8 +1017,8 @@ spFile* CJSourceParser::Parse( char* start, char* end )
                    ) == 0
             )
         {
-            int o = 0;
-            ++o;
+            // int o = 0;
+            // ++o;
         }
 
         switch (*cur)
@@ -1118,7 +1117,7 @@ spFile* CJSourceParser::Parse( char* start, char* end )
             continue;
         }
 
-        bool isAMacro = 0;
+        bool isAMacro = false;
 
         if ( is_function( cur, isAMacro ) )
         {
@@ -1132,8 +1131,9 @@ spFile* CJSourceParser::Parse( char* start, char* end )
 
             int tmpLnNo;
             store_line_no( tmpLnNo );
+            wxUnusedVar( tmpLnNo );
 
-            isAMacro = FALSE;
+            isAMacro = false;
 
             if ( !ParseNameAndRetVal( cur, isAMacro ) )
             {
@@ -1219,11 +1219,11 @@ void CJSourceParser::AttachComments( spContext& ctx, char* cur )
 
         if ( i == 0 )
 
-            pComment->mStartsPar = TRUE;
+            pComment->mStartsPar = true;
         else
         if ( pComment->mIsMultiline )
 
-            pComment->mStartsPar = TRUE;
+            pComment->mStartsPar = true;
         else
         {
             // find out wheather there is a new-line
@@ -1235,9 +1235,9 @@ void CJSourceParser::AttachComments( spContext& ctx, char* cur )
 
             if ( prevLine >= prevComEnd )
 
-                pComment->mStartsPar = TRUE;
+                pComment->mStartsPar = true;
             else
-                pComment->mStartsPar = FALSE;
+                pComment->mStartsPar = false;
         }
 
         prevComEnd = set_comment_text( pComment->mText, start );
@@ -1521,7 +1521,7 @@ void CJSourceParser::ParseKeyword( char*& cur )
 
 bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
 {
-    isAMacro = FALSE;
+    isAMacro = false;
 
     // FOR NOW:: all functions in the global
     //           scope are ignored
@@ -1537,7 +1537,7 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
             isVirtual = true;
 
         skip_token( cur );
-        if ( !get_next_token( cur ) ) return FALSE;
+        if ( !get_next_token( cur ) ) return false;
     }
 
     char* bracketPos = cur;
@@ -1564,9 +1564,9 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
 
             mpPlugin->ParseContext( _gSrcStart, cur, _gSrcEnd, mpCurCtx );
 
-            isAMacro = TRUE;
+            isAMacro = true;
 
-            return FALSE;
+            return false;
         }
     }
 
@@ -1633,7 +1633,7 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
     // now, enter operation context
     mpCurCtx = pOp;
 
-    return TRUE;
+    return true;
 }
 
 bool CJSourceParser::ParseArguments( char*& cur )
@@ -1655,7 +1655,7 @@ bool CJSourceParser::ParseArguments( char*& cur )
 
         get_next_token( cur );
 
-        bool first_blk = 1;
+        bool first_blk = true;
 
         while( *cur != ')' && *cur != ',' )
         {
@@ -1693,7 +1693,7 @@ bool CJSourceParser::ParseArguments( char*& cur )
             // if only one block enclosed, than it's probably
             // some macro, there should be at least two blocks,
             // one for argument type and another for it's identifier
-            return FALSE;
+            return false;
         }
 
         if ( blocksSkipped == 0 )
@@ -1777,29 +1777,31 @@ bool CJSourceParser::ParseArguments( char*& cur )
     int tmpLnNo;
     store_line_no( tmpLnNo );
 
+    bool result = true;
+
     do
     {
         if ( *tok == '{' || *tok == ';' )
         {
             restore_line_no(tmpLnNo);
-            return TRUE;
+            break;
         }
 
         // check for unexpected tokens
         if ( *tok == '=' || *tok == '0' )
         {
             skip_token(tok);
-            if ( !get_next_token(tok) ) return FALSE;
+            if ( !get_next_token(tok) ) return false;
             continue;
         }
 
-        if ( *tok == '}' ) return FALSE;
+        if ( *tok == '}' ) return false;
 
         // if initialization list found
         if ( *tok == ':' )
         {
             restore_line_no(tmpLnNo);
-            return TRUE;
+            break;
         }
 
         if ( cmp_tokens_fast( tok, "const", 5 ) )
@@ -1807,30 +1809,28 @@ bool CJSourceParser::ParseArguments( char*& cur )
             ((spOperation*)mpCurCtx)->mIsConstant = true;
 
             skip_token(tok);
-            if ( !get_next_token(tok) ) return FALSE;
+            if ( !get_next_token(tok) ) return false;
             continue;
         }
 
-        if ( CheckVisibilty( tok ) ) return FALSE;
+        if ( CheckVisibilty( tok ) ) return false;
 
         // if next context found
-        if ( is_keyword( tok ) ) return FALSE;
+        if ( is_keyword( tok ) ) return false;
 
         skip_token(tok);
-        if ( !get_next_token(tok) ) return FALSE;
+        if ( !get_next_token(tok) ) return false;
 
     } while(1);
 
-    return TRUE;
+    return result;
 }
 
 void CJSourceParser::ParseMemberVar( char*& cur )
 {
     MMemberListT& members = mpCurCtx->GetMembers();
 
-    bool firstMember = 1;
-
-    size_t first = 0;
+    bool firstMember = true;
 
     string type;
 
@@ -1860,7 +1860,6 @@ void CJSourceParser::ParseMemberVar( char*& cur )
         if ( firstMember )
         {
             firstMember = 0;
-            first = members.size() - 1;;
         }
 
         skip_token_back( cur );
@@ -1904,7 +1903,7 @@ void CJSourceParser::ParseMemberVar( char*& cur )
 
     } while(1);
 
-    first = 0;
+    size_t first = 0;
 
     // set up types for all collected (same-type) attributes;
     while ( first != members.size() - 1 )
@@ -1950,7 +1949,7 @@ void CJSourceParser::SkipFunctionBody( char*& cur )
 {
     // FIXME:: check for comments and quoted stirngs here
 
-    bool hasDefinition = FALSE;
+    bool hasDefinition = false;
 
     while( *cur != '{' && *cur != ';' )
     {
@@ -1964,7 +1963,7 @@ void CJSourceParser::SkipFunctionBody( char*& cur )
     }
     else
     {
-        hasDefinition = TRUE;
+        hasDefinition = true;
 
         skip_scope_block( cur ); // skip the whole imp.
     }
@@ -2004,22 +2003,22 @@ bool CJSourceParser::CheckVisibilty( char*& cur )
     if ( cmp_tokens_fast( cur, "public:", len ) )
     {
         mCurVis = SP_VIS_PUBLIC;
-        return TRUE;
+        return true;
     }
 
     if ( cmp_tokens_fast( cur, "protected:", len ) )
     {
         mCurVis = SP_VIS_PROTECTED;
-        return TRUE;
+        return true;
     }
 
     if ( cmp_tokens_fast( cur, "private:", len ) )
     {
         mCurVis = SP_VIS_PRIVATE;
-        return TRUE;
+        return true;
     }
 
-    return FALSE;
+    return false;
 }
 
 void CJSourceParser::AddClassNode( char*& cur )
index e7552491ad482ebda1e00c00d156af8053dcfcd6..3accf5dbd173553dd071aada4b023c776fa0fce4 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     22/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Aleskandars Gluchovas
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -32,7 +32,7 @@
 
 // ***** currently only HTML versions of variouse templates available ***** //
 
-static const char* HTM_TopTempl = 
+static const char* HTM_TopTempl =
 
 "<html><body bgcolor=#FFFFFF>\n\
 \n\n<!------ Automatically Generated by \"wxDocRipper\"------->\n\n\n\
@@ -42,7 +42,7 @@ $(REFLIST)\
 </ul><p>\n\n\
 ";
 
-static const char* HTM_ContentIdxTempl = 
+static const char* HTM_ContentIdxTempl =
 
 "\
 <a name=\"r$(ID)_$(NAME)\">\n\
@@ -53,7 +53,7 @@ $(REFLIST)\
 </ul><p>\n\n\
 ";
 
-static const char* HTM_SuperContentTempl = 
+static const char* HTM_SuperContentTempl =
 
 "\
 <a name=\"r$(ID)_$(NAME)\">\n\
@@ -62,7 +62,7 @@ static const char* HTM_SuperContentTempl =
 $(BODY)\n\
 ";
 
-static const char* HTM_SubContentTempl = 
+static const char* HTM_SubContentTempl =
 
 "\
 <a name=\"r$(ID)_$(NAME)\">\n\
@@ -104,490 +104,456 @@ static const char* HTM_DeadRefTempl =
 
 RipperDocGen::RipperDocGen()
 
-       : mTopTempl         ( HTM_TopTempl ),
-         mContentIdxTempl  ( HTM_ContentIdxTempl ),
-         mSuperContentTempl( HTM_SuperContentTempl ),
-         mSubContentTempl  ( HTM_SubContentTempl ),
-         mOutLineTempl     ( HTM_OutLineTempl ),
-         mOutLine1Templ    ( HTM_OutLine1Templ ),
-
-         mRefTempl         ( HTM_RefTempl ),
-         mDeadRefTempl     ( HTM_DeadRefTempl ),
-
-         mpCurClassSect(0)
-{                                                                                                                                                                                         // topIndex is not referenced
-       mpTopIdx        = new ScriptSection( "Source Code Contents"       , "", &mTopTempl       , 0          );
-       mpClassIdx      = new ScriptSection( "Classes Reference"          , "", &mContentIdxTempl, &mRefTempl );
-       mpEnumIdx       = new ScriptSection( "Enumerations  Reference"    , "", &mContentIdxTempl,  &mRefTempl );
-       mpTypeDefIdx    = new ScriptSection( "Type Definitions Reference" , "", &mContentIdxTempl, &mRefTempl );
-       mpMacroIdx      = new ScriptSection( "Macros Reference"           , "", &mContentIdxTempl, &mRefTempl );
-       mpGlobalVarsIdx = new ScriptSection( "Global Variables Reference" , "", &mContentIdxTempl, &mRefTempl );
-       mpGlobalFuncIdx = new ScriptSection( "Global Functions  Reference", "", &mContentIdxTempl, &mRefTempl );
-       mpConstIdx      = new ScriptSection( "Constants  Reference"       , "", &mContentIdxTempl, &mRefTempl );
-
-       // assemble top index
-       mpTopIdx->AddSection( mpClassIdx     , 1 );
-       mpTopIdx->AddSection( mpEnumIdx      , 1 );
-       mpTopIdx->AddSection( mpTypeDefIdx   , 1 );
-       mpTopIdx->AddSection( mpMacroIdx     , 1 );
-       mpTopIdx->AddSection( mpGlobalVarsIdx, 1 );
-       mpTopIdx->AddSection( mpGlobalFuncIdx, 1 );
-       mpTopIdx->AddSection( mpConstIdx     , 1 );
-
-       // register reserved variables for index and description templates
-       ScriptSection::RegisterTemplate( mTopTempl );
-       ScriptSection::RegisterTemplate( mContentIdxTempl );
-       ScriptSection::RegisterTemplate( mSuperContentTempl );
-       ScriptSection::RegisterTemplate( mSubContentTempl );
-       ScriptSection::RegisterTemplate( mOutLineTempl );
-       ScriptSection::RegisterTemplate( mOutLine1Templ );
-       ScriptSection::RegisterTemplate( mRefTempl );
-       ScriptSection::RegisterTemplate( mDeadRefTempl );
-
-       // create the top-most (interfile) context
-       mpFileBinderCtx = new spFile();
-
-       // the default script is HTML
-       mTags = get_HTML_markup_tags();
-
-       mpParser = 0; // no default parser!
+    : mTopTempl         ( HTM_TopTempl ),
+      mContentIdxTempl  ( HTM_ContentIdxTempl ),
+      mSuperContentTempl( HTM_SuperContentTempl ),
+      mSubContentTempl  ( HTM_SubContentTempl ),
+      mOutLineTempl     ( HTM_OutLineTempl ),
+      mOutLine1Templ    ( HTM_OutLine1Templ ),
+
+      mRefTempl         ( HTM_RefTempl ),
+      mDeadRefTempl     ( HTM_DeadRefTempl ),
+
+      mpCurClassSect(0)
+{
+    // topIndex is not referenced
+    mpTopIdx        = new ScriptSection( "Source Code Contents"       , "", &mTopTempl       , 0          );
+    mpClassIdx      = new ScriptSection( "Classes Reference"          , "", &mContentIdxTempl, &mRefTempl );
+    mpEnumIdx       = new ScriptSection( "Enumerations  Reference"    , "", &mContentIdxTempl,  &mRefTempl );
+    mpTypeDefIdx    = new ScriptSection( "Type Definitions Reference" , "", &mContentIdxTempl, &mRefTempl );
+    mpMacroIdx      = new ScriptSection( "Macros Reference"           , "", &mContentIdxTempl, &mRefTempl );
+    mpGlobalVarsIdx = new ScriptSection( "Global Variables Reference" , "", &mContentIdxTempl, &mRefTempl );
+    mpGlobalFuncIdx = new ScriptSection( "Global Functions  Reference", "", &mContentIdxTempl, &mRefTempl );
+    mpConstIdx      = new ScriptSection( "Constants  Reference"       , "", &mContentIdxTempl, &mRefTempl );
+
+    // assemble top index
+    mpTopIdx->AddSection( mpClassIdx     , 1 );
+    mpTopIdx->AddSection( mpEnumIdx      , 1 );
+    mpTopIdx->AddSection( mpTypeDefIdx   , 1 );
+    mpTopIdx->AddSection( mpMacroIdx     , 1 );
+    mpTopIdx->AddSection( mpGlobalVarsIdx, 1 );
+    mpTopIdx->AddSection( mpGlobalFuncIdx, 1 );
+    mpTopIdx->AddSection( mpConstIdx     , 1 );
+
+    // register reserved variables for index and description templates
+    ScriptSection::RegisterTemplate( mTopTempl );
+    ScriptSection::RegisterTemplate( mContentIdxTempl );
+    ScriptSection::RegisterTemplate( mSuperContentTempl );
+    ScriptSection::RegisterTemplate( mSubContentTempl );
+    ScriptSection::RegisterTemplate( mOutLineTempl );
+    ScriptSection::RegisterTemplate( mOutLine1Templ );
+    ScriptSection::RegisterTemplate( mRefTempl );
+    ScriptSection::RegisterTemplate( mDeadRefTempl );
+
+    // create the top-most (interfile) context
+    mpFileBinderCtx = new spFile();
+
+    // the default script is HTML
+    mTags = get_HTML_markup_tags();
+
+    mpParser = 0; // no default parser!
 }
 
 void RipperDocGen::Init( SourceParserBase* pParser )
 {
-       mpParser = pParser;
+    mpParser = pParser;
 }
 
 RipperDocGen::~RipperDocGen()
 {
-       delete mpFileBinderCtx;
+    delete mpFileBinderCtx;
 }
 
 void RipperDocGen::AppendComments( spContext& fromContext, string& str )
 {
-       if ( !fromContext.HasComments() ) return;
-
-       size_t start = str.length();
-
-       str += mTags[TAG_BOLD].end;
-       str += mTags[TAG_PARAGRAPH].start;
-
-       MCommentListT& lst = fromContext.GetCommentList();
-
-       for( size_t i = 0; i != lst.size(); ++i )
-       {
-       
-               if ( i != 0 )
-                       
-                       if ( lst[i]->StartsParagraph() )
-                       {
-                               str += mTags[TAG_PARAGRAPH].start;
-
-                       }
-       
-               str += lst[i]->mText;
-       }
-
-       // remove new lines, and insert paragraph breaks
-
-       // if empty lines found
-
-       size_t len = str.length();
-
-       for( size_t n = start; n != len; ++n )
-       
-               if ( str[n] == 10 || 
-                    str[n] == 13  ) 
-
-               {
-
-                       if ( n + 2 < len )
-
-                       {
+    if ( !fromContext.HasComments() ) return;
 
-                               if ( ( str[n] == 13 && str[n+1] == 10 &&  // FIXME:: quick-hack
+    size_t start = str.length();
 
-                                          str[n+2] == 13 ) ||
+    str += mTags[TAG_BOLD].end;
+    str += mTags[TAG_PARAGRAPH].start;
 
-                                        ( str[n] == 10 && str[n+1] == 10 )
+    MCommentListT& lst = fromContext.GetCommentList();
 
-                           )
+    for( size_t i = 0; i != lst.size(); ++i )
+    {
 
-                               {
+        if ( i != 0 )
 
-                                       str.insert( n + 1, "<p>" ); // FIXME:: quick-hack
+            if ( lst[i]->StartsParagraph() )
+            {
+                str += mTags[TAG_PARAGRAPH].start;
+            }
 
-                                       len += 3;
+        str += lst[i]->mText;
+    }
 
-                               }
+    // remove new lines, and insert paragraph breaks
 
-                       }
+    // if empty lines found
 
+    size_t len = str.length();
 
+    for( size_t n = start; n != len; ++n )
 
-                       str[n] = ' ';
-
-               }
-
-
-       str += mTags[TAG_PARAGRAPH].end;
+        if ( str[n] == 10 ||
+             str[n] == 13  )
+        {
+            if ( n + 2 < len )
+            {
+                if ( ( str[n] == 13 && str[n+1] == 10 &&  // FIXME:: quick-hack
+                       str[n+2] == 13 ) ||
+                     ( str[n] == 10 && str[n+1] == 10 )
+                   )
+                {
+                    str.insert( n + 1, "<p>" ); // FIXME:: quick-hack
+                    len += 3;
+                }
+            }
+            str[n] = ' ';
+        }
+    str += mTags[TAG_PARAGRAPH].end;
 }
 
 void RipperDocGen::AppendMulitilineStr( string& st, string& mlStr )
 {
-       st = mTags[TAG_FIXED_FONT].start;
-       st += mlStr;
-       st += mTags[TAG_FIXED_FONT].end;
+    st = mTags[TAG_FIXED_FONT].start;
+    st += mlStr;
+    st += mTags[TAG_FIXED_FONT].end;
 }
 
 void RipperDocGen::AppendHighlightedSource( string& st, string source )
 {
-       // FIXME:: below should not be fixed :)
-       char buf[1024*32];
-
-       // DBG:::
-//     ASSERT( source.length() + 1 < sizeof(buf) );
-
-       strcpy( buf, source.c_str() );
-                                               
-       // highlight things
-       mSrcPainter.Init();
-       mSrcPainter.ProcessSource( buf, strlen(buf) );
-       mSrcPainter.GetResultString( st, mTags );
+    // FIXME:: below should not be fixed :)
+    char buf[1024*32];
+
+    // DBG:::
+//    ASSERT( source.length() + 1 < sizeof(buf) );
+
+    strcpy( buf, source.c_str() );
+
+    // highlight things
+    mSrcPainter.Init();
+    mSrcPainter.ProcessSource( buf, strlen(buf) );
+    mSrcPainter.GetResultString( st, mTags );
 }
 
 bool RipperDocGen::CheckIfUncommented( spContext& ctx, ScriptSection& toSect )
 {
-       if ( ctx.HasComments() ) return 0;
+    if ( ctx.HasComments() ) return 0;
 
-       toSect.AddReference( 
-               new ScriptSection( GetScopedName( ctx ), "", 0, &mDeadRefTempl )
-       );
+    toSect.AddReference(
+        new ScriptSection( GetScopedName( ctx ), "", 0, &mDeadRefTempl )
+    );
 
-       return 1;
+    return 1;
 }
 
 ScriptTemplate* RipperDocGen::GetRefTemplFor( spContext& ctx )
 {
-       if ( ctx.HasComments() )
-
-               return &mRefTempl;
-       else
-               return &mDeadRefTempl;
+    if ( ctx.HasComments() )
+        return &mRefTempl;
+    else
+        return &mDeadRefTempl;
 }
 
 string RipperDocGen::GetScopedName( spContext& ofCtx )
 {
-       if ( ofCtx.IsInFile() ) return ofCtx.GetName();
-       else
-               return ofCtx.GetOutterContext()->GetName() + 
-                          "::" + ofCtx.GetName();
+    if ( ofCtx.IsInFile() )
+        return ofCtx.GetName();
+    else
+        return ofCtx.GetOutterContext()->GetName() +
+               "::" + ofCtx.GetName();
 }
 
-void RipperDocGen::AddToCurrentClass( ScriptSection* pSection, spContext& ctx, 
-                                                                         const char* subSectionName )
+void RipperDocGen::AddToCurrentClass( ScriptSection* pSection, spContext& ctx,
+                                      const char* subSectionName )
 {
-       string sName;
+    string sName;
 
-       if ( ctx.mVisibility == SP_VIS_PROTECTED )
+    if ( ctx.mVisibility == SP_VIS_PROTECTED )
+        sName = "Protected members/";
+    else
+        if ( ctx.mVisibility == SP_VIS_PRIVATE )
+            sName = "Private members/";
+        else
+            sName = "Public members/";
 
-               sName = "Protected members/";
-       else
-       if ( ctx.mVisibility == SP_VIS_PRIVATE )
+    sName += subSectionName;
 
-               sName = "Private members/";
-       else
-               sName = "Public members/";
+    ScriptSection* pSect = mpCurClassSect->GetSubsection( sName.c_str() );
 
-       sName += subSectionName;
+    if ( CheckIfUncommented( ctx, *pSect ) )
+    {
+        delete pSection;
+        return;
+    }
 
-       ScriptSection* pSect = mpCurClassSect->GetSubsection( sName.c_str() );
+    pSect->AddReference( pSection );
 
-       if ( CheckIfUncommented( ctx, *pSect ) )
-       {
-               delete pSection;
-               return;
-       }
-
-       pSect->AddReference( pSection );
-
-       mpCurClassSect->AddSection( pSection );
+    mpCurClassSect->AddSection( pSection );
 }
 
 void RipperDocGen::LinkSuperClassRefs()
 {
-       MMemberListT clLst;
-
-       // collect all classes in the context tree
-       mpFileBinderCtx->GetContextList( clLst, SP_CTX_CLASS );
-
-       for( size_t i = 0; i != clLst.size(); ++i )
-       {
-               spClass& cl = *((spClass*)clLst[i]);
-
-               // FIXME:: why sometimes GetUserData() returns NULL?
-               if ( !cl.GetUserData() )
-                       continue;
-
-               ScriptSection* pClSect = (ScriptSection*)cl.GetUserData();
-               ScriptSection* pSuperSect = pClSect->GetSubsection("Derived from");
-
-               for( size_t n = 0; n != cl.mSuperClassNames.size(); ++n )
-               {
-                       string& superClName = cl.mSuperClassNames[n];
-
-                       spClass* pFound = NULL;
-
-                       string* name;
-
-                       for( size_t k = 0; k != clLst.size(); ++k )
-                       {
-                               name = &clLst[k]->GetName();
-
-                               if ( clLst[k]->GetName() == superClName )
-                               {
-                                       pFound = (spClass*)clLst[k];
-                                       break;
-                               }
-                       }
-
-                       if ( !pFound )
-                       {
-                               ScriptSection* pNotFound = 
-                                       new ScriptSection( superClName, "", 0, &mDeadRefTempl );
-
-                               pSuperSect->AddReference( pNotFound );
-                       }
-                       else
-                               if ( pFound->GetUserData() )
-                               
-                                       pSuperSect->AddReference( 
-                                               (ScriptSection*)pFound->GetUserData() );
-               }
-       }
+    MMemberListT clLst;
+
+    // collect all classes in the context tree
+    mpFileBinderCtx->GetContextList( clLst, SP_CTX_CLASS );
+
+    for( size_t i = 0; i != clLst.size(); ++i )
+    {
+        spClass& cl = *((spClass*)clLst[i]);
+
+        // FIXME:: why sometimes GetUserData() returns NULL?
+        if ( !cl.GetUserData() )
+            continue;
+
+        ScriptSection* pClSect = (ScriptSection*)cl.GetUserData();
+        ScriptSection* pSuperSect = pClSect->GetSubsection("Derived from");
+
+        for( size_t n = 0; n != cl.mSuperClassNames.size(); ++n )
+        {
+            string& superClName = cl.mSuperClassNames[n];
+
+            spClass* pFound = NULL;
+
+            for( size_t k = 0; k != clLst.size(); ++k )
+            {
+                if ( clLst[k]->GetName() == superClName )
+                {
+                    pFound = (spClass*)clLst[k];
+                    break;
+                }
+            }
+
+            if ( !pFound )
+            {
+                ScriptSection* pNotFound =
+                    new ScriptSection( superClName, "", 0, &mDeadRefTempl );
+
+                pSuperSect->AddReference( pNotFound );
+            }
+            else
+                if ( pFound->GetUserData() )
+
+                    pSuperSect->AddReference(
+                        (ScriptSection*)pFound->GetUserData() );
+        }
+    }
 }
 
 void RipperDocGen::ProcessFile( const char* sourceFile )
 {
-       wxSTD cout << "Processing file " << sourceFile << "..." << wxSTD endl;
+    wxSTD cout << "Processing file " << sourceFile << "..." << wxSTD endl;
 
-       spFile* pCtx = mpParser->ParseFile( sourceFile );
+    spFile* pCtx = mpParser->ParseFile( sourceFile );
 
-       if ( pCtx == NULL )
-       {
-               wxSTD cout << "Cannot open file " << sourceFile << ", skipped..." << wxSTD endl;
+    if ( pCtx == NULL )
+    {
+        wxSTD cout << "Cannot open file " << sourceFile << ", skipped..." << wxSTD endl;
 
-               return;
-       }
+        return;
+    }
 
-       VisitAll( *pCtx, TRUE );
+    VisitAll( *pCtx, true );
 
-       mpFileBinderCtx->AddMember( pCtx );
+    mpFileBinderCtx->AddMember( pCtx );
 }
 
 // implementations of "visiting procedures"
 
 void RipperDocGen::VisitEnumeration( spEnumeration& en )
 {
-       // FOR NOW:: do not reference "nameless" enums
-       if ( en.GetName() == "" ) return;
+    // FOR NOW:: do not reference "nameless" enums
+    if ( en.GetName() == "" ) return;
 
-       if ( CheckIfUncommented( en, *mpEnumIdx ) )
-               return;
+    if ( CheckIfUncommented( en, *mpEnumIdx ) )
+        return;
 
-       string body;
-       body += mTags[TAG_BOLD].start;
+    string body;
+    body += mTags[TAG_BOLD].start;
 
-       AppendMulitilineStr( body, en.mEnumContent );
+    AppendMulitilineStr( body, en.mEnumContent );
 
-       body += mTags[TAG_BOLD].end;
+    body += mTags[TAG_BOLD].end;
 
-       string line;
-       AppendHighlightedSource( line, body );
-       AppendComments( en, line );
+    string line;
+    AppendHighlightedSource( line, body );
+    AppendComments( en, line );
 
-       mpEnumIdx->AddSection( 
-               new ScriptSection( en.GetName(), line, 
-                                                  &mSubContentTempl,
-                                                  GetRefTemplFor( en ) ), 1
-       );
+    mpEnumIdx->AddSection(
+        new ScriptSection( en.GetName(), line,
+                           &mSubContentTempl,
+                           GetRefTemplFor( en ) ), 1
+    );
 }
 
 void RipperDocGen::VisitTypeDef( spTypeDef& td )
 {
-       if ( CheckIfUncommented( td, *mpTypeDefIdx ) )
-               return;
-
-       string body;
-       body += mTags[TAG_BOLD].start;
-       body += "typdef ";
-       body += mTags[TAG_BOLD].end;
-
-       AppendMulitilineStr( body, td.mOriginalType );
-       body += td.mOriginalType;
-       body += ' ';
-
-       body += mTags[TAG_BOLD].start;
-       body += td.GetName();
-       body += mTags[TAG_BOLD].end;
-
-       string line;
-       AppendHighlightedSource( line, body );
-       AppendComments( td, line );
-
-       mpTypeDefIdx->AddSection( 
-               new ScriptSection( td.GetName(), line, 
-                                                  &mSubContentTempl,
-                                                  GetRefTemplFor( td ) ), TRUE
-       );
+    if ( CheckIfUncommented( td, *mpTypeDefIdx ) )
+        return;
+
+    string body;
+    body += mTags[TAG_BOLD].start;
+    body += "typdef ";
+    body += mTags[TAG_BOLD].end;
+
+    AppendMulitilineStr( body, td.mOriginalType );
+    body += td.mOriginalType;
+    body += ' ';
+
+    body += mTags[TAG_BOLD].start;
+    body += td.GetName();
+    body += mTags[TAG_BOLD].end;
+
+    string line;
+    AppendHighlightedSource( line, body );
+    AppendComments( td, line );
+
+    mpTypeDefIdx->AddSection(
+        new ScriptSection( td.GetName(), line,
+                           &mSubContentTempl,
+                           GetRefTemplFor( td ) ), true
+    );
 }
 
 void RipperDocGen::VisitPreprocessorLine( spPreprocessorLine& pd )
 {
-       if ( pd.mDefType != SP_PREP_DEF_REDEFINE_SYMBOL )
-
-       
-
-               return;
+    if ( pd.mDefType != SP_PREP_DEF_REDEFINE_SYMBOL )
+        return;
 
+    if ( CheckIfUncommented( pd, *mpMacroIdx ) )
+        return;
 
-       if ( CheckIfUncommented( pd, *mpMacroIdx ) )
-               return;
+    string body;
+    body += mTags[TAG_FIXED_FONT].start;
 
-       string body;
-       body += mTags[TAG_FIXED_FONT].start;
+    string coloredLine = pd.mLine;
+    AppendHighlightedSource( coloredLine, pd.mLine );
 
-       string coloredLine = pd.mLine;
-       AppendHighlightedSource( coloredLine, pd.mLine );
+    AppendMulitilineStr( body, coloredLine );
 
-       AppendMulitilineStr( body, coloredLine );
+    body += mTags[TAG_FIXED_FONT].end;
 
-       body += mTags[TAG_FIXED_FONT].end;
+    AppendComments( pd, body );
 
-       AppendComments( pd, body );
-
-       mpMacroIdx->AddSection( 
-               new ScriptSection( pd.GetName(), body, 
-                                                  &mSubContentTempl,
-                                                  GetRefTemplFor( pd ) ), TRUE
-       );
+    mpMacroIdx->AddSection(
+        new ScriptSection( pd.GetName(), body,
+                           &mSubContentTempl,
+                           GetRefTemplFor( pd ) ), true
+    );
 }
 
 void RipperDocGen::VisitClass( spClass& cl )
 {
-       // FOR NOW:: do not document nested classes -
-       //           nicier visiting method yet needed
-
-       if ( cl.IsInClass() )
-       {
-               SkipChildren(); // spVisitor's method
-               return;
-       }
-
-       string body;
-       AppendComments( cl, body );
+    // FOR NOW:: do not document nested classes -
+    //           nicier visiting method yet needed
 
-       mpCurClassSect =                
-               new ScriptSection( cl.GetName(), body, &mSuperContentTempl, &mRefTempl );
+    if ( cl.IsInClass() )
+    {
+        SkipChildren(); // spVisitor's method
+        return;
+    }
 
-       // set up reference in the class context, pointing back
-       // to the section where this class is represented
-       cl.SetUserData( mpCurClassSect );
+    string body;
+    AppendComments( cl, body );
 
-       ScriptSection* pSuper    = new ScriptSection( "Derived from"    ,"", &mOutLine1Templ,0, 1 );
+    mpCurClassSect =
+        new ScriptSection( cl.GetName(), body, &mSuperContentTempl, &mRefTempl );
 
-       ScriptSection* pPublic    = new ScriptSection( "Public members"    ,"", &mOutLineTempl,0, 1 );
-       ScriptSection* pProtected = new ScriptSection( "Protected members" ,"", &mOutLineTempl,0, 1 );
-       ScriptSection* pPrivate   = new ScriptSection( "Private members"   ,"", &mOutLineTempl,0, 1 );
+    // set up reference in the class context, pointing back
+    // to the section where this class is represented
+    cl.SetUserData( mpCurClassSect );
 
-       pPublic->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) );
-       pPublic->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) );
+    ScriptSection* pSuper    = new ScriptSection( "Derived from"    ,"", &mOutLine1Templ,0, 1 );
 
+    ScriptSection* pPublic    = new ScriptSection( "Public members"    ,"", &mOutLineTempl,0, 1 );
+    ScriptSection* pProtected = new ScriptSection( "Protected members" ,"", &mOutLineTempl,0, 1 );
+    ScriptSection* pPrivate   = new ScriptSection( "Private members"   ,"", &mOutLineTempl,0, 1 );
 
-       pProtected->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) );
-       pProtected->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) );
+    pPublic->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) );
+    pPublic->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) );
 
+    pProtected->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) );
+    pProtected->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) );
 
-       pPrivate->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) );
-       pPrivate->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) );
+    pPrivate->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) );
+    pPrivate->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) );
 
-       mpCurClassSect->AddSection( pSuper    );
-       mpCurClassSect->AddSection( pPublic    );
-       mpCurClassSect->AddSection( pProtected );
-       mpCurClassSect->AddSection( pPrivate   );
+    mpCurClassSect->AddSection( pSuper    );
+    mpCurClassSect->AddSection( pPublic    );
+    mpCurClassSect->AddSection( pProtected );
+    mpCurClassSect->AddSection( pPrivate   );
 
-       mpClassIdx->AddSection( mpCurClassSect, TRUE );
+    mpClassIdx->AddSection( mpCurClassSect, true );
 }
 
 void RipperDocGen::VisitAttribute( spAttribute& attr )
 {
-       string body;
-       body += mTags[TAG_BOLD].start;
-       body += attr.mType;
-       body += mTags[TAG_BOLD].end;
-
-       body += mTags[TAG_ITALIC].start;
-       body += ' ';
-       body += attr.GetName();
-       body += mTags[TAG_ITALIC].end;
-
-       string line;
-       AppendHighlightedSource( line, body );
-       AppendComments( attr, line );
-
-       ScriptSection* pSection = 
-               new ScriptSection( GetScopedName( attr ), line, 
-                                                  &mSubContentTempl,
-                                                  GetRefTemplFor( attr ) );
-
-       if ( attr.mIsConstant )
-       
-               mpConstIdx->AddSection( pSection, TRUE );
-       
-       else
-       if ( !attr.IsInClass() )
-       {
-               if ( CheckIfUncommented( attr, *mpGlobalVarsIdx ) )
-                       return;
-
-               mpGlobalVarsIdx->AddSection( pSection, TRUE );
-       }
-       else
-
-               AddToCurrentClass( pSection, attr, "Attributes" );
+    string body;
+    body += mTags[TAG_BOLD].start;
+    body += attr.mType;
+    body += mTags[TAG_BOLD].end;
+
+    body += mTags[TAG_ITALIC].start;
+    body += ' ';
+    body += attr.GetName();
+    body += mTags[TAG_ITALIC].end;
+
+    string line;
+    AppendHighlightedSource( line, body );
+    AppendComments( attr, line );
+
+    ScriptSection* pSection =
+        new ScriptSection( GetScopedName( attr ), line,
+                           &mSubContentTempl,
+                           GetRefTemplFor( attr ) );
+
+    if ( attr.mIsConstant )
+        mpConstIdx->AddSection( pSection, true );
+    else
+        if ( !attr.IsInClass() )
+        {
+            if ( CheckIfUncommented( attr, *mpGlobalVarsIdx ) )
+                return;
+            mpGlobalVarsIdx->AddSection( pSection, true );
+        }
+        else
+            AddToCurrentClass( pSection, attr, "Attributes" );
 }
 
 void RipperDocGen::VisitOperation( spOperation& op )
 {
-       string body;
+    string body;
 
-       AppendHighlightedSource( body, op.GetFullName(mTags) );
+    AppendHighlightedSource( body, op.GetFullName(mTags) );
 
-       AppendComments( op, body );
+    AppendComments( op, body );
 
-       ScriptSection* pSection = 
-               new ScriptSection( GetScopedName( op ), body, 
-                                                  &mSubContentTempl,
-                                                  GetRefTemplFor( op ) );
+    ScriptSection* pSection =
+        new ScriptSection( GetScopedName( op ), body,
+                           &mSubContentTempl,
+                           GetRefTemplFor( op ) );
 
-       if ( !op.IsInClass() )
-       {
-               if ( CheckIfUncommented( op, *mpGlobalFuncIdx ) )
-                       return;
+    if ( !op.IsInClass() )
+    {
+        if ( CheckIfUncommented( op, *mpGlobalFuncIdx ) )
+            return;
 
-               mpGlobalFuncIdx->AddSection( pSection, 1 );
-       }
-       else
-               AddToCurrentClass( pSection, op, "Operations" );
+        mpGlobalFuncIdx->AddSection( pSection, 1 );
+    }
+    else
+        AddToCurrentClass( pSection, op, "Operations" );
 }
 
-bool RipperDocGen::OnSaveDocument( ScriptStream& stm )
+bool RipperDocGen::OnSaveDocument( ScriptStream& WXUNUSED(stm) )
 {
-       LinkSuperClassRefs();
+    LinkSuperClassRefs();
 
-       // FOR NOW:: doesn't work yet
-       //mpTopIdx->RemoveEmptySections();
+    // FOR NOW:: doesn't work yet
+    //mpTopIdx->RemoveEmptySections();
 
-       return 1; // saving can proceed now 
+    return 1; // saving can proceed now
 }
 
index f20a5f675ec8f214d443ee5b3eaa07593614deed..851b30388cf29660e2ffa5f109adf2c709e60856 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     22/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Aleskandars Gluchovas
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx/wx.h".
 
 static size_t log2(size_t nr)
 {
-       size_t tmp = 0;
-       while (nr >= 2 ) 
-       {
-               nr /= 2;
-               ++tmp;
-       }
-
-       return tmp;
+    size_t tmp = 0;
+    while (nr >= 2 )
+    {
+        nr /= 2;
+        ++tmp;
+    }
+
+    return tmp;
 }
 
 /***** Implementation for class ScriptStream *****/
 
 ScriptStream::ScriptStream()
-       : mpBuf(0),
-         mSize(0),
-         mCapacity(0)
+    : mpBuf(0),
+      mSize(0),
+      mCapacity(0)
 {}
 
 ScriptStream::~ScriptStream()
 {
-       if ( mpBuf ) delete mpBuf;
+    if ( mpBuf ) delete mpBuf;
 }
 
 void ScriptStream::WriteBytes( const void* srcBuf, size_t count )
 {
-       if ( !count ) return;
+    if ( !count ) return;
 
-       // increase the capacity if necessary
-       if ( mSize + count > mCapacity )
-       {
-                       mCapacity = 
-                               (  0x2 << (log2( mSize + count ) + 1 ) );
+    // increase the capacity if necessary
+    if ( mSize + count > mCapacity )
+    {
+        mCapacity =
+            (  0x2 << (log2( mSize + count ) + 1 ) );
 
-                       if ( mCapacity < 128 ) mCapacity = 128;
+        if ( mCapacity < 128 ) mCapacity = 128;
 
-                       char* oldBuf = mpBuf;
+        char* oldBuf = mpBuf;
 
-                       mpBuf = new char[mCapacity];
+        mpBuf = new char[mCapacity];
 
-                       if ( oldBuf )
-                       {
-                               memcpy( mpBuf, oldBuf, mSize );
-                               delete oldBuf;
-                       }
-       }
+        if ( oldBuf )
+        {
+            memcpy( mpBuf, oldBuf, mSize );
+            delete oldBuf;
+        }
+    }
 
-       // append new data
-       memcpy( &mpBuf[mSize], srcBuf, count );
+    // append new data
+    memcpy( &mpBuf[mSize], srcBuf, count );
 
-       mSize += count;
+    mSize += count;
 }
 
 ScriptStream& ScriptStream::operator<<( const char* str )
 {
-       WriteBytes( str, strlen( str ) );
+    WriteBytes( str, strlen( str ) );
 
-       return *this;
+    return *this;
 }
 
 ScriptStream& ScriptStream::operator<<( const string& str )
 {
-       if ( str.length() < 512 )
-       {
-               char buf[512];
-               size_t len = str.length();
+    if ( str.length() < 512 )
+    {
+        char buf[512];
+        size_t len = str.length();
 
-               for( size_t i = 0; i != len; ++i )
-                       buf[i] = str[i];
+        for( size_t i = 0; i != len; ++i )
+            buf[i] = str[i];
 
-               WriteBytes( buf, len );
-       }
-       else
-               WriteBytes( str.c_str(), str.length() );
+        WriteBytes( buf, len );
+    }
+    else
+        WriteBytes( str.c_str(), str.length() );
 
-       return *this;
+    return *this;
 }
 
 ScriptStream& ScriptStream::operator<<( char ch )
 {
-       WriteBytes( &ch, 1 );
+    WriteBytes( &ch, 1 );
 
-       return *this;
+    return *this;
 }
 
 void ScriptStream::endl()
 {
-       char ch = '\n';
-       WriteBytes( &ch, 1 );
+    char ch = '\n';
+    WriteBytes( &ch, 1 );
 }
 
 /***** Implementation for class ScriptTemplate *****/
 
 ScriptTemplate::ScriptTemplate( const string& templateText )
 {
-       string tmp = templateText;
+    string tmp = templateText;
 
-       mTText = (char*)malloc( tmp.length() + 1 );
+    mTText = (char*)malloc( tmp.length() + 1 );
 
-       strcpy( mTText, tmp.c_str() );
+    strcpy( mTText, tmp.c_str() );
 }
 
 ScriptTemplate::~ScriptTemplate()
 {
-       for( size_t i = 0; i != mVars.size(); ++i )
+    for( size_t i = 0; i != mVars.size(); ++i )
 
-               delete mVars[i];
+        delete mVars[i];
 
-       free( mTText );
+    free( mTText );
 }
 
 bool ScriptTemplate::HasVar( const char* name )
 {
-       for( size_t i = 0; i != mVars.size(); ++i ) 
+    for( size_t i = 0; i != mVars.size(); ++i )
 
-               if ( strcmp( mVars[i]->mName, name ) == 0 )
+        if ( strcmp( mVars[i]->mName, name ) == 0 )
 
-                       return 1;
+            return 1;
 
-       return 0;
+    return 0;
 }
 
 void ScriptTemplate::AddStringVar ( const char* name, int ofs )
 {
-       mVars.push_back( new TVarInfo( name, ofs, TVAR_STRING ) );
+    mVars.push_back( new TVarInfo( name, ofs, TVAR_STRING ) );
 }
 
 void ScriptTemplate::AddIntegerVar( const char* name, int ofs )
 {
-       mVars.push_back( new TVarInfo( name, ofs, TVAR_INTEGER ) );
+    mVars.push_back( new TVarInfo( name, ofs, TVAR_INTEGER ) );
 }
 
 void ScriptTemplate::AddDoubleVar ( const char* name, int ofs )
 {
-       mVars.push_back( new TVarInfo( name, ofs, TVAR_DOUBLE ) );
+    mVars.push_back( new TVarInfo( name, ofs, TVAR_DOUBLE ) );
 }
 
 void ScriptTemplate::AddObjectRefArray( const char*     name,
-                                                                               int                         ofsRefToFirstObj,
-                                                                               int                         ofsObjSizeInt,
-                                                                               int                         ofsObjRefTempl
-                                                                         )
+                                        int                ofsRefToFirstObj,
+                                        int                ofsObjSizeInt,
+                                        int                ofsObjRefTempl
+                                      )
 {
-       TArrayInfo* pInfo = new TArrayInfo( name );
+    TArrayInfo* pInfo = new TArrayInfo( name );
 
-       mVars.push_back( pInfo );
+    mVars.push_back( pInfo );
 
-       pInfo->mRefOfs         = ofsRefToFirstObj;
-       pInfo->mSizeIntOfs     = ofsObjSizeInt;
-       pInfo->mObjRefTemplOfs = ofsObjRefTempl;
+    pInfo->mRefOfs         = ofsRefToFirstObj;
+    pInfo->mSizeIntOfs     = ofsObjSizeInt;
+    pInfo->mObjRefTemplOfs = ofsObjRefTempl;
 }
 
-inline void ScriptTemplate::PrintVar( TVarInfo*   pInfo, 
-                                                                   void*       dataObj, 
-                                                                       ScriptStream& stm )
+inline void ScriptTemplate::PrintVar( TVarInfo*   pInfo,
+                                    void*       dataObj,
+                                    ScriptStream& stm )
 {
-       char buf[128];
-
-       switch ( pInfo->mType )
-       {
-               case TVAR_INTEGER :
-                       {
-                               sprintf(buf, "%d",*( (int*) ((char*)dataObj + pInfo->mOfs) ) );
-                               
-                               stm.WriteBytes( buf, strlen(buf ) );
-                               break;
-                       }
-
-               case TVAR_STRING :
-                       {
-                               string& str = *( (string*) ((char*)dataObj+pInfo->mOfs) );
-
-                               const char* cs = str.c_str();
+    char buf[128];
+
+    switch ( pInfo->mType )
+    {
+        case TVAR_INTEGER :
+            {
+                sprintf(buf, "%d",*( (int*) ((char*)dataObj + pInfo->mOfs) ) );
+                
+                stm.WriteBytes( buf, strlen(buf ) );
+                break;
+            }
+
+        case TVAR_STRING :
+            {
+                string& str = *( (string*) ((char*)dataObj+pInfo->mOfs) );
+
+                const char* cs = str.c_str();
 #ifdef DEBUG_WEIRED_OFFSETS
-                               cout << "DBG:: cs address is " << (int)cs << endl;
-                               cout << "DBG:: str address is " << (int)(&str) << endl;
-                               cout << "DBG:: dataObj points to " << (int)dataObj << endl;
-                               cout << "DBG:: pInfo->mOfs value is " << (int)pInfo->mOfs << endl;
-                               cout << "DBG:: d+pInfo->mOfs is " << (int)((char*)dataObj + pInfo->mOfs) << endl;
-                               cout << "DBG:: pInfo->mName is " << pInfo->mName << endl;
-                               cout << "DBG:: pInfo->mType is " << pInfo->mType << endl;
-                               cout << "DBG:: end of dump. " << endl;
-
-                               cout << "DBG:: cs value is " << endl << cs << endl;
+                cout << "DBG:: cs address is " << (int)cs << endl;
+                cout << "DBG:: str address is " << (int)(&str) << endl;
+                cout << "DBG:: dataObj points to " << (int)dataObj << endl;
+                cout << "DBG:: pInfo->mOfs value is " << (int)pInfo->mOfs << endl;
+                cout << "DBG:: d+pInfo->mOfs is " << (int)((char*)dataObj + pInfo->mOfs) << endl;
+                cout << "DBG:: pInfo->mName is " << pInfo->mName << endl;
+                cout << "DBG:: pInfo->mType is " << pInfo->mType << endl;
+                cout << "DBG:: end of dump. " << endl;
+
+                cout << "DBG:: cs value is " << endl << cs << endl;
 #endif
-                               stm.WriteBytes( cs, strlen(cs) );
-                               break;
-                       }
-
-               case TVAR_DOUBLE :
-                       {
-                               sprintf( buf, "%f", 
-                                            *( (double*)( (char*)dataObj+pInfo->mOfs)  ) );
-
-                               stm.WriteBytes( buf, strlen(buf ) );
-                               break;
-                       }
-
-               case TVAR_REF_ARRAY :
-                       {
-                               TArrayInfo& info = *((TArrayInfo*)pInfo);
-
-                               int sz = *((int*) ( (char*)dataObj+info.mSizeIntOfs ));
-                               if ( !sz ) 
-                               {
-                                       // DBG::
-                                       int u = 0;
-                                       ++u;
-                                       break;
-                               }
-
-                               int*   array = *((int**)( (char*)dataObj+info.mRefOfs ));
-       
-                               ScriptTemplate* pRefTempl;
-
-                               for( int i = 0; i != sz; ++i )
-                               {
-                                       pRefTempl = 
-                                               *((ScriptTemplate**)((char*)(array[i])+info.mObjRefTemplOfs));
-
-                                       pRefTempl->PrintScript( (void*)array[i], stm );
-                               }
-
-                               break;
-                       }
-
-               default : break;
-       }
+                stm.WriteBytes( cs, strlen(cs) );
+                break;
+            }
+
+        case TVAR_DOUBLE :
+            {
+                sprintf( buf, "%f",
+                         *( (double*)( (char*)dataObj+pInfo->mOfs)  ) );
+
+                stm.WriteBytes( buf, strlen(buf ) );
+                break;
+            }
+
+        case TVAR_REF_ARRAY :
+            {
+                TArrayInfo& info = *((TArrayInfo*)pInfo);
+
+                int sz = *((int*) ( (char*)dataObj+info.mSizeIntOfs ));
+                if ( !sz )
+                {
+                    // DBG::
+                    int u = 0;
+                    ++u;
+                    break;
+                }
+
+                int*   array = *((int**)( (char*)dataObj+info.mRefOfs ));
+    
+                ScriptTemplate* pRefTempl;
+
+                for( int i = 0; i != sz; ++i )
+                {
+                    pRefTempl =
+                        *((ScriptTemplate**)((char*)(array[i])+info.mObjRefTemplOfs));
+
+                    pRefTempl->PrintScript( (void*)array[i], stm );
+                }
+
+                break;
+            }
+
+        default : break;
+    }
 }
 
 void ScriptTemplate::PrintScript( void* dataObj, ScriptStream& stm )
 {
-       char* cur   = mTText;
+    char* cur   = mTText;
 
-       // template parsing loop
-       do
-       {
-               char* start = cur;
+    // template parsing loop
+    do
+    {
+        char* start = cur;
 
-               while( *cur != '\0' && *cur != '$' ) ++cur;
+        while( *cur != '\0' && *cur != '$' ) ++cur;
 
-               // flush text collected between variables
-               stm.WriteBytes( start, cur - start );
+        // flush text collected between variables
+        stm.WriteBytes( start, cur - start );
 
-               if ( *cur == '\0' ) break;
+        if ( *cur == '\0' ) break;
 
-               cur += 2; // skip to the name of the var
+        cur += 2; // skip to the name of the var
 
-               start = cur;
+        start = cur;
 
-               while( *cur != ')' ) ++cur;
+        while( *cur != ')' ) ++cur;
 
-               // put terminating zero temorarely
+        // put terminating zero temorarely
 
-               *cur = '\0';
+        *cur = '\0';
 
-               // look up variable
+        // look up variable
 
-               size_t sz = mVars.size();
-               bool found = 0;
+        size_t sz = mVars.size();
+        // bool found = false;
 
-               for( size_t i = 0; i != sz; ++i ) 
-               {
-                       if ( strcmp( mVars[i]->mName, start ) == 0 )
-                       {
-                               PrintVar( mVars[i], dataObj, stm );
+        for( size_t i = 0; i != sz; ++i )
+        {
+            if ( strcmp( mVars[i]->mName, start ) == 0 )
+            {
+                PrintVar( mVars[i], dataObj, stm );
 
-                               *cur = ')';     // remove terminating zero
-                               ++cur;
-                               found = 1;
-                               break;
-                       }
-               }
+                *cur = ')';    // remove terminating zero
+                ++cur;
+                // found = 1;
+                break;
+            }
+        }
 
-               // variable referred by template script is not
-               // registered to this tempalte object
-               // ASSERT( found ); 
+        // variable referred by template script is not
+        // registered to this tempalte object
+        // ASSERT( found );
 
-       } while(1);
+    } while(1);
 }
 
 /***** implementation for class ScriptSection *****/
@@ -320,301 +320,301 @@ void ScriptTemplate::PrintScript( void* dataObj, ScriptStream& stm )
 int ScriptSection::mIdCounter = 0;
 
 ScriptSection::ScriptSection( const string&   name,
-                                                     const string&   body,
-                                                         ScriptTemplate* pSectionTemplate,
-                                                         ScriptTemplate* pReferenceTemplate,
-                                                         bool            autoHide,
-                                                         bool            sorted
-                                                       )
-       : mpParent ( NULL ),
+                              const string&   body,
+                              ScriptTemplate* pSectionTemplate,
+                              ScriptTemplate* pReferenceTemplate,
+                              bool            autoHide,
+                              bool            sorted
+                            )
+    : mpParent ( NULL ),
 
-         mName    ( name ),
-         mBody    ( body ),
+      mName    ( name ),
+      mBody    ( body ),
 
-         mAutoHide( autoHide ),
-         mSortOn  ( sorted ),
+      mAutoHide( autoHide ),
+      mSortOn  ( sorted ),
 
-         mpSectTempl( pSectionTemplate ),
-         mpRefTempl ( pReferenceTemplate ),
+      mpSectTempl( pSectionTemplate ),
+      mpRefTempl ( pReferenceTemplate ),
 
-         mRefCount( 0 ),
-         mArrSize( 0 )
+      mRefCount( 0 ),
+      mArrSize( 0 )
 {
-       // generate GUID
+    // generate GUID
 
-       char buf[32];
-       sprintf( buf, "%d", ++mIdCounter );
-       mId = buf;
+    char buf[32];
+    sprintf( buf, "%d", ++mIdCounter );
+    mId = buf;
 }
 
 ScriptSection::~ScriptSection()
 {
-       SectListT lst = mSubsections;
+    SectListT lst = mSubsections;
 
-       while( mSubsections.size() )
+    while( mSubsections.size() )
 
-               mSubsections[0]->RemoveRef();
+        mSubsections[0]->RemoveRef();
 
-       for( size_t i = 0; i != mReferences.size(); ++i )
+    for( size_t i = 0; i != mReferences.size(); ++i )
 
-               mReferences[i]->RemoveRef();
+        mReferences[i]->RemoveRef();
 }
 
 void ScriptSection::AddRef()
 {
-       ++mRefCount;
+    ++mRefCount;
 }
 
 void ScriptSection::RemoveRef()
 {
-       if ( !mRefCount || !(--mRefCount) )
-       {
-               if (mpParent)
-               {
-                       // remove ourselves from parent's list
-
-                       SectListT& lst = mpParent->mSubsections;
-                       for( size_t i = 0; i != lst.size(); ++i )
-
-                               if ( lst[i] == this )
-                               {
-                                       lst.erase( &lst[i] );
-                                       break;
-                               }
-               }
-
-               delete this;
-       }
+    if ( !mRefCount || !(--mRefCount) )
+    {
+        if (mpParent)
+        {
+            // remove ourselves from parent's list
+
+            SectListT& lst = mpParent->mSubsections;
+            for( size_t i = 0; i != lst.size(); ++i )
+
+                if ( lst[i] == this )
+                {
+                    lst.erase( &lst[i] );
+                    break;
+                }
+        }
+
+        delete this;
+    }
 }
 
 ScriptSection* ScriptSection::GetSubsection( const char* name )
 {
-       // FOR NOW:: fixed section name length
-       char buf[128];
+    // FOR NOW:: fixed section name length
+    char buf[128];
 
-       size_t cur = 0;
+    size_t cur = 0;
 
-       while( name[cur] && name[cur] != '/' )
-       {
-               buf[cur] = name[cur];
-               ++cur;
-       }
+    while( name[cur] && name[cur] != '/' )
+    {
+        buf[cur] = name[cur];
+        ++cur;
+    }
 
-       // ASSERT( cur < sizeof(buf) );
+    // ASSERT( cur < sizeof(buf) );
 
-       buf[cur] = '\0';
+    buf[cur] = '\0';
 
-       size_t sz = mSubsections.size();
+    size_t sz = mSubsections.size();
 
-       for( size_t i = 0; i != sz; ++i )
-       {
-               // DBG::
-               //ScriptSection& sect = *mSubsections[i];
+    for( size_t i = 0; i != sz; ++i )
+    {
+        // DBG::
+        //ScriptSection& sect = *mSubsections[i];
 
-               if ( mSubsections[i]->mName == buf )
-               {
-                       if ( name[cur] == '/' )
+        if ( mSubsections[i]->mName == buf )
+        {
+            if ( name[cur] == '/' )
 
-                               // search recursivelly
-                               return mSubsections[i]->GetSubsection( &name[cur+1] );
-                       else
-                               return mSubsections[i];
-               }
-       }
+                // search recursivelly
+                return mSubsections[i]->GetSubsection( &name[cur+1] );
+            else
+                return mSubsections[i];
+        }
+    }
 
-       return 0;
+    return 0;
 }
 
 void ScriptSection::AddSection( ScriptSection* pSection,
-                                                           bool addToReferencesToo
-                                                         )
+                                bool addToReferencesToo
+                              )
 {
-       mSubsections.push_back( pSection );
+    mSubsections.push_back( pSection );
 
-       pSection->AddRef();
+    pSection->AddRef();
 
-       // can add section to multiple containers
-       // ASSERT( pSection->mpParent == 0 );
+    // can add section to multiple containers
+    // ASSERT( pSection->mpParent == 0 );
 
-       pSection->mpParent = this;
+    pSection->mpParent = this;
 
-       if ( addToReferencesToo )
+    if ( addToReferencesToo )
 
-               AddReference( pSection );
+        AddReference( pSection );
 }
 
 void ScriptSection::AddReference( ScriptSection* pReferredSection )
 {
-       mReferences.push_back( pReferredSection );
+    mReferences.push_back( pReferredSection );
 
-       pReferredSection->AddRef();
+    pReferredSection->AddRef();
 
-       // set up mandatory fields used by ScriptTemplate
-       mArrSize  = mReferences.size();
-       if ( mArrSize )
-               mRefFirst = (void*)&mReferences[0];
+    // set up mandatory fields used by ScriptTemplate
+    mArrSize  = mReferences.size();
+    if ( mArrSize )
+        mRefFirst = (void*)&mReferences[0];
 }
 
 SectListT& ScriptSection::GetSubsections()
 {
-       return mSubsections;
+    return mSubsections;
 }
 
 // static method:
 void ScriptSection::RegisterTemplate( ScriptTemplate& sectionTempalte )
 {
-       int nameOfs, bodyOfs, idOfs,
-               arrRefOfs, arrSizeOfs, refTemplOfs;
+    int nameOfs, bodyOfs, idOfs,
+        arrRefOfs, arrSizeOfs, refTemplOfs;
 
-       // obtaining offsets of member vars
-       
-       GET_VAR_OFS( ScriptSection, mName,     &nameOfs    )
-       GET_VAR_OFS( ScriptSection, mBody,     &bodyOfs    )
-       GET_VAR_OFS( ScriptSection, mId,       &idOfs      )
-       GET_VAR_OFS( ScriptSection, mRefFirst, &arrRefOfs  )
-       GET_VAR_OFS( ScriptSection, mArrSize,  &arrSizeOfs )
+    // obtaining offsets of member vars
+    
+    GET_VAR_OFS( ScriptSection, mName,     &nameOfs    )
+    GET_VAR_OFS( ScriptSection, mBody,     &bodyOfs    )
+    GET_VAR_OFS( ScriptSection, mId,       &idOfs      )
+    GET_VAR_OFS( ScriptSection, mRefFirst, &arrRefOfs  )
+    GET_VAR_OFS( ScriptSection, mArrSize,  &arrSizeOfs )
 
-       GET_VAR_OFS( ScriptSection, mpRefTempl, &refTemplOfs )
+    GET_VAR_OFS( ScriptSection, mpRefTempl, &refTemplOfs )
 
-       // registering member variables with given script template
+    // registering member variables with given script template
 
-       sectionTempalte.AddStringVar( "NAME", nameOfs );
-       sectionTempalte.AddStringVar( "BODY", bodyOfs );
-       sectionTempalte.AddStringVar( "ID",   idOfs   );
+    sectionTempalte.AddStringVar( "NAME", nameOfs );
+    sectionTempalte.AddStringVar( "BODY", bodyOfs );
+    sectionTempalte.AddStringVar( "ID",   idOfs   );
 
-       sectionTempalte.AddObjectRefArray( "REFLIST",
-                                                                          arrRefOfs, arrSizeOfs, refTemplOfs );
+    sectionTempalte.AddObjectRefArray( "REFLIST",
+                                       arrRefOfs, arrSizeOfs, refTemplOfs );
 }
 
 void ScriptSection::Print( ScriptStream& stm )
 {
-       // TBD:: sorting
+    // TBD:: sorting
 
-       // print out this content first
-       if ( mpSectTempl )
+    // print out this content first
+    if ( mpSectTempl )
 
-               mpSectTempl->PrintScript( this, stm );
+        mpSectTempl->PrintScript( this, stm );
 
-       // attach contents subsections at the end of this content
+    // attach contents subsections at the end of this content
 
-       for( size_t i = 0; i != mSubsections.size(); ++i )
+    for( size_t i = 0; i != mSubsections.size(); ++i )
 
-               mSubsections[i]->Print( stm );
+        mSubsections[i]->Print( stm );
 }
 
 void ScriptSection::DoRemoveEmptySections(int& nRemoved, SectListT& removedLst)
 {
-       for( size_t i = 0; i != mSubsections.size(); ++i )
-       {
-               ScriptSection& sect = *mSubsections[i];
-
-               sect.DoRemoveEmptySections( nRemoved, removedLst );
-
-               if (sect.mAutoHide )
-                       
-                       if ( sect.mReferences.size() == 0 )
-                       {
-                               bool found = 0;
-                               for( size_t k = 0; k != removedLst.size(); ++k )
-
-                                       if ( removedLst[k] == &sect )
-                                       {
-                                               found = 1;
-                                               break;
-                                       }
-                               
-                               if ( !found )
-                               {
-                                       removedLst.push_back( &sect );
-                                       ++nRemoved;
-
-                                       delete &sect;
-                                       --i;
-                               }
-                       }
-       }
+    for( size_t i = 0; i != mSubsections.size(); ++i )
+    {
+        ScriptSection& sect = *mSubsections[i];
+
+        sect.DoRemoveEmptySections( nRemoved, removedLst );
+
+        if (sect.mAutoHide )
+            
+            if ( sect.mReferences.size() == 0 )
+            {
+                bool found = false;
+                for( size_t k = 0; k != removedLst.size(); ++k )
+
+                    if ( removedLst[k] == &sect )
+                    {
+                        found = 1;
+                        break;
+                    }
+                
+                if ( !found )
+                {
+                    removedLst.push_back( &sect );
+                    ++nRemoved;
+
+                    delete &sect;
+                    --i;
+                }
+            }
+    }
 }
 
 void ScriptSection::DoRemoveDeadLinks( SectListT& removedLst)
 {
-       size_t dsz = removedLst.size();
-
-       for( size_t i = 0; i != mSubsections.size(); ++i )
-       {
-               mSubsections[i]->DoRemoveDeadLinks( removedLst );
-       }
-
-       for( size_t n = 0; n != mReferences.size(); ++n )
-       {
-               for( size_t k = 0; k != dsz; ++k )
-
-                       if ( removedLst[k] == mReferences[n] )
-                       {
-                               mReferences.erase( &mReferences[n] );
-                               --n;
-
-                               // set up mandatory fields used by ScriptTemplate
-                               mArrSize  = mReferences.size();
-                               if ( mArrSize )
-                                       mRefFirst = (void*)&mReferences[0];
-
-                               break;
-                       }
-       }
+    size_t dsz = removedLst.size();
+
+    for( size_t i = 0; i != mSubsections.size(); ++i )
+    {
+        mSubsections[i]->DoRemoveDeadLinks( removedLst );
+    }
+
+    for( size_t n = 0; n != mReferences.size(); ++n )
+    {
+        for( size_t k = 0; k != dsz; ++k )
+
+            if ( removedLst[k] == mReferences[n] )
+            {
+                mReferences.erase( &mReferences[n] );
+                --n;
+
+                // set up mandatory fields used by ScriptTemplate
+                mArrSize  = mReferences.size();
+                if ( mArrSize )
+                    mRefFirst = (void*)&mReferences[0];
+
+                break;
+            }
+    }
 }
 
 
 void ScriptSection::RemoveEmptySections()
 {
-       // FIXME:: this is very_very_very slow alg.! +"doesn't work"
+    // FIXME:: this is very_very_very slow alg.! +"doesn't work"
 
-       int nRemoved = 0;
+    int nRemoved = 0;
 
-       do
-       {
-               SectListT removedLst;
-               nRemoved = 0;
+    do
+    {
+        SectListT removedLst;
+        nRemoved = 0;
 
-               DoRemoveEmptySections( nRemoved, removedLst );
+        DoRemoveEmptySections( nRemoved, removedLst );
 
-               DoRemoveDeadLinks( removedLst );
-       }
-       while( nRemoved );
+        DoRemoveDeadLinks( removedLst );
+    }
+    while( nRemoved );
 }
 
 /***** Iimplementation for class DocGeneratorBase *****/
 
-bool DocGeneratorBase::SaveDocument( const char*    fname, 
-                                                                    const char*    fopenOptions,
-                                                                    ScriptSection* pFromSection
-                                                                  )
+bool DocGeneratorBase::SaveDocument( const char*    fname,
+                                     const char*    fopenOptions,
+                                     ScriptSection* pFromSection
+                                   )
 {
-       FILE* fp = fopen( fname, fopenOptions );
+    FILE* fp = fopen( fname, fopenOptions );
 
-       if ( (int)fp == -1 ) return 0;
+    if ( (int)fp == -1 ) return 0;
 
-       ScriptStream stm;
+    ScriptStream stm;
 
-       // check if derived class agrees about saving it
-       if ( !OnSaveDocument( stm ) ) return 0;
+    // check if derived class agrees about saving it
+    if ( !OnSaveDocument( stm ) ) return 0;
 
-       if ( pFromSection )
+    if ( pFromSection )
 
-               pFromSection->Print( stm );
-       else
-       {
-               ScriptSection* pTopSect = GetTopSection();
-               // ASSERT( pTopSect );
-               pTopSect->Print( stm );
-       }
+        pFromSection->Print( stm );
+    else
+    {
+        ScriptSection* pTopSect = GetTopSection();
+        // ASSERT( pTopSect );
+        pTopSect->Print( stm );
+    }
 
-       size_t nWrite = fwrite( stm.GetBuf(), 1, stm.GetBufSize(), fp );
+    size_t nWrite = fwrite( stm.GetBuf(), 1, stm.GetBufSize(), fp );
 
-       if ( nWrite != stm.GetBufSize() ) return 0;
+    if ( nWrite != stm.GetBufSize() ) return 0;
 
-       fclose( fp );
+    fclose( fp );
 
-       return 1;
+    return 1;
 
-       // that^s it
+    // that^s it
 }
index 0c58ea54529f0f756256930fefabf9211b508e66..e0e3baed20394a1cb29156fb2f13c63d1bfda9dd 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     22/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Aleskandars Gluchovas
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -32,8 +32,8 @@ const int MAX_KEYWORD_LEN = 16;
 
 struct KeywordT
 {
-       char  keyWord[MAX_KEYWORD_LEN];
-       int   rank;
+    char  keyWord[MAX_KEYWORD_LEN];
+    int   rank;
 };
 
 // source fragment ranks :
@@ -46,630 +46,633 @@ struct KeywordT
 
 static KeywordT __gKeyWords[] =
 {
-       { "for", 1 },
-       { "FOR", 1 },
-       { "For", 1 },
-       
-       { "next", 1 },
-       { "Next", 1 },
-       { "NEXT", 1 },
+    { "for", 1 },
+    { "FOR", 1 },
+    { "For", 1 },
+    
+    { "next", 1 },
+    { "Next", 1 },
+    { "NEXT", 1 },
 
-       { "if", 1 },
-       { "If", 1 },
-       { "IF", 1 },
+    { "if", 1 },
+    { "If", 1 },
+    { "IF", 1 },
 
-       { "then", 1 },
-       { "Then", 1 },
-       { "THEN", 1 },
+    { "then", 1 },
+    { "Then", 1 },
+    { "THEN", 1 },
 
-       { "else", 1 },
-       { "Else", 1 },
-       { "ELSE", 1 },
-                
-       { "do", 1 },
-       { "Do", 1 },
-       { "DO", 1 },
+    { "else", 1 },
+    { "Else", 1 },
+    { "ELSE", 1 },
+        
+    { "do", 1 },
+    { "Do", 1 },
+    { "DO", 1 },
 
 
-       { "break", 1 },
-       { "Break", 1 },
-       { "BREAK", 1 },
+    { "break", 1 },
+    { "Break", 1 },
+    { "BREAK", 1 },
 
-       { "continue", 1 },
+    { "continue", 1 },
 
-       { "goto", 1 },
-       { "Goto", 1 },
-       { "GOTO", 1 },
+    { "goto", 1 },
+    { "Goto", 1 },
+    { "GOTO", 1 },
 
-       { "switch",  1 },
-       { "default", 1 },
-       { "case",    1 },
+    { "switch",  1 },
+    { "default", 1 },
+    { "case",    1 },
 
-       { "repeat", 1 },
-       { "Repeat", 1 },
-       { "REPEAT", 1 },
+    { "repeat", 1 },
+    { "Repeat", 1 },
+    { "REPEAT", 1 },
 
-       { "until", 1 },
-       { "Until", 1 },
-       { "UNTIL", 1 },
+    { "until", 1 },
+    { "Until", 1 },
+    { "UNTIL", 1 },
 
-       { "return", 1 },
-       { "Return", 1 },
-       { "RETURN", 1 },
+    { "return", 1 },
+    { "Return", 1 },
+    { "RETURN", 1 },
 
-       { "unit",      1 },
-       { "Unit",      1 },
-       { "UNIT",      1 },
+    { "unit",      1 },
+    { "Unit",      1 },
+    { "UNIT",      1 },
 
-       { "procedure", 1 },
-       { "Procedure", 1 },
-       { "PROCEDURE", 1 },
+    { "procedure", 1 },
+    { "Procedure", 1 },
+    { "PROCEDURE", 1 },
 
-       { "function", 1 },
-       { "Function", 1 },
-       { "FUNCTION", 1 },
+    { "function", 1 },
+    { "Function", 1 },
+    { "FUNCTION", 1 },
 
-       { "begin", 1 },
-       { "Begin", 1 },
-       { "BEGIN", 1 },
+    { "begin", 1 },
+    { "Begin", 1 },
+    { "BEGIN", 1 },
 
-       { "End", 1 },
-       { "END", 1 },
+    { "End", 1 },
+    { "END", 1 },
 
-       ////////////////////////////////////////////////////
+    ////////////////////////////////////////////////////
 
-       { "enum",     1 },
-       { "static",   1 },
-       { "const",    1 },
-       { "mutable",  1 },
-       { "volatile", 1 },
-       { "__asm",    1 },
-       { "asm",      1 },
+    { "enum",     1 },
+    { "static",   1 },
+    { "const",    1 },
+    { "mutable",  1 },
+    { "volatile", 1 },
+    { "__asm",    1 },
+    { "asm",      1 },
 
-       { "typeid",   1 },
-       { "sizeof",   1 },
-       { "typeof",   1 },
+    { "typeid",   1 },
+    { "sizeof",   1 },
+    { "typeof",   1 },
 
 
-       { "native",   1 },
+    { "native",   1 },
 
-       { "#include", 1 },
-       { "#define",  1 },
-       { "#def",     1 },
-       { "#undef",   1 },
+    { "#include", 1 },
+    { "#define",  1 },
+    { "#def",     1 },
+    { "#undef",   1 },
     { "#ifdef",   1 },
-       { "#ifndef",  1 },
-       { "#if",      1 },
-       { "#endif",   1 },
-       { "#elif",    1 },
-       { "#else",    1 },
-       { "#pragma",  1 },
-       { "#line",    1 },
-
-       { "package",  1 },
-       { "import",   1 },
-       { "export",   1 },
-
-       ////////////////////////////////////////////////////
-
-       { "dynamic_cast",     1 },
-       { "const_cast",       1 },
-
-       //////// some hacks for VB /////////
-
-       { "sub", 1 },
-       { "Sub", 1 },
-       { "SUB", 1 },
-       { "as",  1 },
-       { "As",  1 },
-       { "AS",  1 },
-
-       /////// data types ///////
-
-       { "int" ,    1 },
-       { "integer", 1 },
-       { "Integer", 1 },
-       { "INTEGER", 1 },
-
-       { "real", 1 },
-       { "Real", 1 },
-       { "REAL", 1 },
-
-       { "float", 1 },
-       { "Float", 1 },
-       { "FLOAT", 1 },
-
-       { "char",  1 },
-       { "Char",  1 },
-       { "CHAR",  1 },
-
-       { "register",   1 },
-
-       { "string", 1 },
-       { "String", 1 },
-       { "STRING", 1 },
+    { "#ifndef",  1 },
+    { "#if",      1 },
+    { "#endif",   1 },
+    { "#elif",    1 },
+    { "#else",    1 },
+    { "#pragma",  1 },
+    { "#line",    1 },
+
+    { "package",  1 },
+    { "import",   1 },
+    { "export",   1 },
+
+    ////////////////////////////////////////////////////
+
+    { "dynamic_cast",     1 },
+    { "const_cast",       1 },
+
+    //////// some hacks for VB /////////
+
+    { "sub", 1 },
+    { "Sub", 1 },
+    { "SUB", 1 },
+    { "as",  1 },
+    { "As",  1 },
+    { "AS",  1 },
+
+    /////// data types ///////
+
+    { "int" ,    1 },
+    { "integer", 1 },
+    { "Integer", 1 },
+    { "INTEGER", 1 },
+
+    { "real", 1 },
+    { "Real", 1 },
+    { "REAL", 1 },
+
+    { "float", 1 },
+    { "Float", 1 },
+    { "FLOAT", 1 },
+
+    { "char",  1 },
+    { "Char",  1 },
+    { "CHAR",  1 },
+
+    { "register",   1 },
+
+    { "string", 1 },
+    { "String", 1 },
+    { "STRING", 1 },
 
-       { "array", 1 },
-       { "Array", 1 },
-       { "ARRAY", 1 },
+    { "array", 1 },
+    { "Array", 1 },
+    { "ARRAY", 1 },
 
-       { "packed", 1 },
-       { "Packed", 1 },
-       { "PACKED", 1 },
+    { "packed", 1 },
+    { "Packed", 1 },
+    { "PACKED", 1 },
 
-       { "property", 1 },
-       { "Property", 1 },
-       { "PROPERTY", 1 },
+    { "property", 1 },
+    { "Property", 1 },
+    { "PROPERTY", 1 },
 
-       { "unsigned", 1 },
+    { "unsigned", 1 },
 
-       { "long",   1 },
-       { "double", 1 },
-       { "short",  1 },
-       { "bool",   1 },
+    { "long",   1 },
+    { "double", 1 },
+    { "short",  1 },
+    { "bool",   1 },
 
-       { "longint", 1 },
-       { "Longint", 1 },
-       { "LONGINT", 1 },
+    { "longint", 1 },
+    { "Longint", 1 },
+    { "LONGINT", 1 },
 
-       { "extended", 1 },
-       { "Extended", 1 },
-       { "EXTENTED", 1 },
+    { "extended", 1 },
+    { "Extended", 1 },
+    { "EXTENTED", 1 },
 
-       { "pointer", 1 },
-       { "Pointer", 1 },
-       { "POINTER", 1 },
+    { "pointer", 1 },
+    { "Pointer", 1 },
+    { "POINTER", 1 },
 
-       { "and",     1 },
-       { "And",     1 },
-       { "AND",     1 },
-       { "or",      1 },
-       { "Or",      1 },
-       { "OR",      1 },
-       { "xor",     1 },
-       { "Xor",     1 },
-       { "XOR",     1 },
-
-       { "void",       1 },
-       { "__stdcall",  1 },
-       { "__declspec", 1 },
-       { "extern",     1 },
-       { "stdcall",    1 },
-       { "dllimport",  1 },
-       { "dllexport",  1 },
-       { "__cdecl",    1 },
-       { "cdecl",      1 },
-       { "template",   1 },
-       { "typedef",    1 },
-       { "naked",      1 },
-
-       { "try",        1 },
-       { "catch",      1 },
-       { "throw",      2 }, // C++
-       { "throws",     1 }, // Java
-
-
-       { "finalize",   1 },
-
-       // "STL-suport"
-
-       { "size_t",     1 },
-       { "NPOS",       1 },
-       { "vector",     1 },
-       { "list",       1 },
-       { "map",        1 },
-       { "multimap",   1 },
-
-       { "external", 1 },
-       { "External", 1 },
-       { "EXTERNAL", 1 },
-
-       //////////// meta-information //////////////
-
-       { "virtual", 2 },
-       { "Virtual", 2 },
-
-       { "override", 2 },
-       { "Override", 2 },
-
-       { "class", 2 },
-       { "Class", 2 },
-       { "CLASS", 2 },
-
-       { "struct", 2 }, 
-       { "union",  2 },
-
-       { "record", 2 },
-       { "Record", 2 },
-       { "RECORD", 2 },
-
-       { "form",     1 },
-       { "Form",     1 },
-       { "FORM",     1 },
-
-       { "namespace", 2 },
-
-       { "interface" , 2 },
-       { "abstract",   2 },
-
-       { "Interface" , 2 },
-       { "INTERFACE" , 2 },
-
-       { "implementation", 2 },
-       { "Implementation", 2 },
-       { "IMPLEMENTATION", 2 },
-
-       { "label", 2 },
-       { "Label", 2 },
-       { "LABEL", 2 },
-
-       { "implements", 2 },
-
-       { "public",    2 },
-       { "private",   2 },
-       { "protected", 2 },
-
-       { "this", 2 },
-       { "This", 2 },
-       { "THIS", 2 },
-
-       { "new", 2 },
-       { "New", 2 },
-       { "NEW", 2 },
-       
-       { "delete", 2 },
-       { "inline", 2 },
-
-       { "operator",  2 },
-
-       { "Inherited", 2 },
-       { "Inherited", 2 },
-       
-       { "final", 2 },
-       { "implements", 2 },
-       { "super", 2 },
-
-       // even more...
-       { "java",      2 },
-       { "Java",      2 },
-       { "JAVA",      2 },
-       { "delphi",    2 },
-       { "Delphi",    2 },
-       { "SmallTalk", 2 },
-       { "Smalltalk", 2 },
-       { "smalltalk", 2 },
-       { "assembler", 2 },
-       { "Assembler", 2 },
-       { "Basic",     2 },
-       { "BASIC",     2 },
-       { "basic",     2 },
-       { "CORBA",     2 },
-       { "COBOL",     2 },
-       { "ADA",       2 },
-       { "LISP",      2 },
-       
-       // just for fun...
-       { "life",        2 },
-       { "sucks",       2 },
-       { "rules",       2 },
-       { "Quake",       2 },
-       { "QuakeWorld",  2 },
-       { "[ag_slammer]",2 },
-       { "Aleksandras", 2 },
-       { "Gluchovas"  , 2 },
-       { "Alex",        2 },
-       { "alex",        2 },
-       { "aleks",       2 },
-       { "aleksas",     3 },
-       { "AlexSoft",    2 },
-       { "Alexsoft",    2 },
-       { "SpringSky",   2 },
-       { "SK_Team",     2 },
-       { "soften",      2 },
-       { "UB40",        2 },
-       { "U96",         2 }
+    { "and",     1 },
+    { "And",     1 },
+    { "AND",     1 },
+    { "or",      1 },
+    { "Or",      1 },
+    { "OR",      1 },
+    { "xor",     1 },
+    { "Xor",     1 },
+    { "XOR",     1 },
+
+    { "void",       1 },
+    { "__stdcall",  1 },
+    { "__declspec",    1 },
+    { "extern",     1 },
+    { "stdcall",    1 },
+    { "dllimport",  1 },
+    { "dllexport",  1 },
+    { "__cdecl",    1 },
+    { "cdecl",      1 },
+    { "template",   1 },
+    { "typedef",    1 },
+    { "naked",      1 },
+
+    { "try",        1 },
+    { "catch",      1 },
+    { "throw",      2 }, // C++
+    { "throws",     1 }, // Java
+
+
+    { "finalize",   1 },
+
+    // "STL-suport"
+
+    { "size_t",     1 },
+    { "NPOS",       1 },
+    { "vector",     1 },
+    { "list",       1 },
+    { "map",        1 },
+    { "multimap",   1 },
+
+    { "external", 1 },
+    { "External", 1 },
+    { "EXTERNAL", 1 },
+
+    //////////// meta-information //////////////
+
+    { "virtual", 2 },
+    { "Virtual", 2 },
+
+    { "override", 2 },
+    { "Override", 2 },
+
+    { "class", 2 },
+    { "Class", 2 },
+    { "CLASS", 2 },
+
+    { "struct", 2 },
+    { "union",  2 },
+
+    { "record", 2 },
+    { "Record", 2 },
+    { "RECORD", 2 },
+
+    { "form",     1 },
+    { "Form",     1 },
+    { "FORM",     1 },
+
+    { "namespace", 2 },
+
+    { "interface" , 2 },
+    { "abstract",   2 },
+
+    { "Interface" , 2 },
+    { "INTERFACE" , 2 },
+
+    { "implementation", 2 },
+    { "Implementation", 2 },
+    { "IMPLEMENTATION", 2 },
+
+    { "label", 2 },
+    { "Label", 2 },
+    { "LABEL", 2 },
+
+    { "implements", 2 },
+
+    { "public",    2 },
+    { "private",   2 },
+    { "protected", 2 },
+
+    { "this", 2 },
+    { "This", 2 },
+    { "THIS", 2 },
+
+    { "new", 2 },
+    { "New", 2 },
+    { "NEW", 2 },
+    
+    { "delete", 2 },
+    { "inline", 2 },
+
+    { "operator",  2 },
+
+    { "Inherited", 2 },
+    { "Inherited", 2 },
+    
+    { "final", 2 },
+    { "implements", 2 },
+    { "super", 2 },
+
+    // even more...
+    { "java",      2 },
+    { "Java",      2 },
+    { "JAVA",      2 },
+    { "delphi",    2 },
+    { "Delphi",    2 },
+    { "SmallTalk", 2 },
+    { "Smalltalk", 2 },
+    { "smalltalk", 2 },
+    { "assembler", 2 },
+    { "Assembler", 2 },
+    { "Basic",     2 },
+    { "BASIC",     2 },
+    { "basic",     2 },
+    { "CORBA",     2 },
+    { "COBOL",     2 },
+    { "ADA",       2 },
+    { "LISP",      2 },
+    
+    // just for fun...
+    { "life",        2 },
+    { "sucks",       2 },
+    { "rules",       2 },
+    { "Quake",       2 },
+    { "QuakeWorld",  2 },
+    { "[ag_slammer]",2 },
+    { "Aleksandras", 2 },
+    { "Gluchovas"  , 2 },
+    { "Alex",        2 },
+    { "alex",        2 },
+    { "aleks",       2 },
+    { "aleksas",     3 },
+    { "AlexSoft",    2 },
+    { "Alexsoft",    2 },
+    { "SpringSky",   2 },
+    { "SK_Team",     2 },
+    { "soften",      2 },
+    { "UB40",        2 },
+    { "U96",         2 }
 };
 
-struct less_c_str 
+struct less_c_str
 {
-    inline bool operator()( char* x, char* y) const 
-       {       return ( strcmp( x,y ) < 0 );
-       }
+    inline bool operator()( char* x, char* y) const
+    {     return ( strcmp( x,y ) < 0 );
+    }
 };
 
 #if defined( wxUSE_TEMPLATE_STL )
 
-       typedef map< char*, char*, less_c_str > KeywordMapT;
+    typedef map< char*, char*, less_c_str > KeywordMapT;
 
 #else
 
-       typedef char* CharPtrT;
-       typedef WXSTL_MAP( CharPtrT, CharPtrT ,less_c_str) KeywordMapT;
+    typedef char* CharPtrT;
+    typedef WXSTL_MAP( CharPtrT, CharPtrT ,less_c_str) KeywordMapT;
 
 #endif
 
 static KeywordMapT __gMultiLangMap;
 static int         __gMapReady = 0;
 
-void check_keyword_map( int keywordMapNr )
+void check_keyword_map( int WXUNUSED(keywordMapNr) )
 {
-       if ( !__gMapReady )
-       {
-               __gMapReady = 1;
+    if ( !__gMapReady )
+    {
+        __gMapReady = 1;
 
-               // "make sure" the address of the first member of non-polimorphic class
-               // coinsides with the address of the instance
+        // "make sure" the address of the first member of non-polimorphic class
+        // coinsides with the address of the instance
 
 /*
-               KeywordT dummy;
+        KeywordT dummy;
 
-               if ( (char*)& dummy != &dummy.keyWord[0] )
-                       throw;
+        if ( (char*)& dummy != &dummy.keyWord[0] )
+            throw;
 */
 
-               int size = sizeof(__gKeyWords) / sizeof( KeywordT );
+        int size = sizeof(__gKeyWords) / sizeof( KeywordT );
 
-               for( int i = 0; i != size; ++i )
+        for( int i = 0; i != size; ++i )
 
-                       __gMultiLangMap.insert( 
-                                       KeywordMapT::value_type( (char*)&__gKeyWords[i],
-                                                                                        (char*)&__gKeyWords[i]
-                                                                                  )
-                                                                 );    
-       }
+            __gMultiLangMap.insert(
+                    KeywordMapT::value_type( (char*)&__gKeyWords[i],
+                                             (char*)&__gKeyWords[i]
+                                           )
+                                  );    
+    }
 }
 
 int get_rank( char* start, char* end )
 {
-       // FIXME:: what if end is no longer leagal adress?
+    // FIXME:: what if end is no longer leagal adress?
 
-       char tmp = *end;
-       *end = '\0'; // put temporary terminator
+    char tmp = *end;
+    *end = '\0'; // put temporary terminator
 
-       KeywordMapT::iterator i; 
+    KeywordMapT::iterator i;
 
-       if (  (i = __gMultiLangMap.find( start ) ) != __gMultiLangMap.end() )
-       {
-               KeywordT* pKey = (KeywordT*)(*i).second;
+    if (  (i = __gMultiLangMap.find( start ) ) != __gMultiLangMap.end() )
+    {
+        KeywordT* pKey = (KeywordT*)(*i).second;
 
-               *end = tmp;
+        *end = tmp;
 
-               return pKey->rank;
-       }
-       else
-       {
-               *end = tmp;
-               return 0;
-       }
+        return pKey->rank;
+    }
+    else
+    {
+        *end = tmp;
+        return 0;
+    }
 }
 
 static inline void store_range( SPBlockListT& results, int rank, int range_len )
 {
-       if ( !range_len ) return;
+    if ( !range_len ) return;
 
-       results.push_back ( ( rank << 16 ) | ( range_len ) );
+    results.push_back ( ( rank << 16 ) | ( range_len ) );
 }
 
 
-#define STORE_RANGE  store_range( results, cur_rank, cur_range_len );\
-                        cur_rank = cur_range_len = 0;
+#define STORE_RANGE  store_range( results, cur_rank, cur_range_len ); \
+                   cur_rank = cur_range_len = 0;                    \
+                     wxUnusedVar( cur_rank );
 
 #define NEXT_CHAR cur_range_len++; \
-                     ++cur;           \
-                                 continue;
+                  ++cur;           \
+                  continue;
 
 static inline int is_alpha( char ch )
 {
-       return ( (( ch >= '_' ) && ( ch <= 'z' )) ||
-                    (( ch >= 'A' ) && ( ch <= 'Z' ))
-                  );
+    return ( (( ch >= '_' ) && ( ch <= 'z' )) ||
+             (( ch >= 'A' ) && ( ch <= 'Z' ))
+           );
 }
 
-  // _       .       .
+  // _       .          .
   // Ziema atEjo netikEtai
 
-static void heighlight_syntax( char* str,   int strLen, 
-                                                          SPBlockListT& results, bool& isComment )
+static void heighlight_syntax( char* str,   int strLen,
+                               SPBlockListT& results, bool& isComment )
 {
-       bool isMultiline = 0;
-       char* cur = str;
-       char* end = str + strLen;
-
-       int cur_rank      = ( isComment == 1 ) ? RANK_GREEN : RANK_BLACK;
-       int cur_range_len = 0;
-
-       while ( cur != end )
-       {
-               int has_next = ( cur+1 != end );
-
-               if ( isComment )
-               {
-                       if ( *cur == '*' )
-                               if ( has_next && *(cur+1) == '/' )
-                               {
-                                        // turn off multiline comment mode
-                                        cur           += 2;
-                                        cur_range_len += 2;
-                                        isComment      = 0;
-                                        isMultiline    = 0;
-                                        STORE_RANGE;
-
-                                        continue;
-                               }
-
-                       ++cur_range_len;
-                       ++cur;
-                       continue;
-               }
-
-               /*
-               if ( *cur == 10 )
-                       if ( isComment )
-                          if ( isMultiline )
-               {
-                        cur_rank      = RANK_GREEN;
-                        cur_range_len = end - cur;
-                        STORE_RANGE;
-                        isComment = 0;
-                        isMultiline = 0;
-                        continue;
-               }*/
-
-               if ( *cur == '/' )
-               {
-                       if ( has_next )
-                       {
-                                if ( *(cur+1) == '/' )
-                                {
-                                        STORE_RANGE;
-
-                                        char* eol = cur;
-                                        while ( eol < end && *eol != 10 )
-                                                ++eol;
-
-                                        cur_rank      = RANK_GREEN;
-                                        cur_range_len = eol - cur;
-                                        cur = eol;
-                                        STORE_RANGE;
-
-                                        continue;
-                                }
-
-                                if ( *(cur+1) == '*' )
-                                {
-                                        STORE_RANGE;
-                                        cur_rank      = RANK_GREEN;
-                                        cur_range_len = 2;
-                                        isComment     = 1;
-                                        cur          += 2;
-                                        isMultiline   = 1;
-                                        continue;
-                                }
-                       }
-                       
-                       NEXT_CHAR;
-               }
-
-           if (  ( is_alpha( *cur ) || *(cur) == '#' ) 
-                         && has_next 
-                  )
-               {
-                       if ( is_alpha( *(cur+1) ) )
-                       {
-                               char* start = cur;
-                               cur += 2;
-
-                               while ( cur != end && is_alpha(*cur) ) ++cur;
-
-                               int wordRank;
-                               
-                               if ( (wordRank = get_rank( start, cur )) > 0 )
-                               {
-                                       STORE_RANGE;
-
-                                       store_range( results, wordRank, int(cur-start) );
-                       cur_rank = cur_range_len = 0;
-                                       continue;
-                               }
-
-                               cur_range_len += ( cur-start );
-                               continue;
-                       }
-                       else
-                               NEXT_CHAR;
-               }
-
-               NEXT_CHAR;
-       }
-
-       if ( cur_range_len > 0 )  STORE_RANGE;
+    bool isMultiline = false;
+    char* cur = str;
+    char* end = str + strLen;
+
+    int cur_rank      = ( isComment == 1 ) ? RANK_GREEN : RANK_BLACK;
+    int cur_range_len = 0;
+
+    while (    cur != end )
+    {
+        int has_next = ( cur+1 != end );
+
+        if ( isComment )
+        {
+            if ( *cur == '*' )
+                if ( has_next && *(cur+1) == '/' )
+                {
+                     // turn off multiline comment mode
+                     cur           += 2;
+                     cur_range_len += 2;
+                     isComment      = 0;
+                     isMultiline    = 0;
+                     STORE_RANGE;
+
+                     continue;
+                }
+
+            ++cur_range_len;
+            ++cur;
+            continue;
+        }
+
+        /*
+        if ( *cur == 10 )
+            if ( isComment )
+               if ( isMultiline )
+        {
+             cur_rank      = RANK_GREEN;
+             cur_range_len = end - cur;
+             STORE_RANGE;
+             isComment = 0;
+             isMultiline = 0;
+             continue;
+        }*/
+
+        if ( *cur == '/' )
+        {
+            if ( has_next )
+            {
+                 if ( *(cur+1) == '/' )
+                 {
+                     STORE_RANGE;
+
+                     char* eol = cur;
+                     while ( eol < end && *eol != 10 )
+                         ++eol;
+
+                     cur_rank      = RANK_GREEN;
+                     cur_range_len = eol - cur;
+                     cur = eol;
+                     STORE_RANGE;
+
+                      continue;
+                 }
+
+                 if ( *(cur+1) == '*' )
+                 {
+                     STORE_RANGE;
+                     cur_rank      = RANK_GREEN;
+                     cur_range_len = 2;
+                     isComment     = 1;
+                     cur          += 2;
+                     isMultiline   = 1;
+                     continue;
+                 }
+            }
+            
+            NEXT_CHAR;
+        }
+
+        if (  ( is_alpha( *cur ) || *(cur) == '#' )
+              && has_next
+           )
+        {
+            if ( is_alpha( *(cur+1) ) )
+            {
+                char* start = cur;
+                cur += 2;
+
+                while ( cur != end && is_alpha(*cur) ) ++cur;
+
+                int wordRank;
+                
+                if ( (wordRank = get_rank( start, cur )) > 0 )
+                {
+                    STORE_RANGE;
+
+                    store_range( results, wordRank, int(cur-start) );
+                    cur_rank = cur_range_len = 0;
+                    continue;
+                }
+
+                cur_range_len += ( cur-start );
+                continue;
+            }
+            else
+                NEXT_CHAR;
+        }
+
+        NEXT_CHAR;
+    }
+
+    if ( cur_range_len > 0 )  STORE_RANGE;
+
+      wxUnusedVar(isMultiline);
 }
 
 /***** Implementation for class SourcePainter ******/
 
 SourcePainter::SourcePainter( bool assembleResultString )
-       : mCollectResultsOn( assembleResultString ),
-         mIsInComment( FALSE ),
-         mCommentIsMultiline( FALSE )
+    : mCollectResultsOn( assembleResultString ),
+      mIsInComment( false ),
+      mCommentIsMultiline( false )
 {
-       check_keyword_map(0);
+    check_keyword_map(0);
 }
 
 void SourcePainter::ProcessSource( char* src, int srcLen )
 {
-       // TBD:: multilne state...
+    // TBD:: multilne state...
 
-       heighlight_syntax( src, srcLen, mBlocks, mIsInComment );
+    heighlight_syntax( src, srcLen, mBlocks, mIsInComment );
 
-       if ( mCollectResultsOn )
-       
-               mResultStr += string( src, srcLen );
+    if ( mCollectResultsOn )
+    
+        mResultStr += string( src, srcLen );
 }
 
 void SourcePainter::SetState( bool isInComment,
-                                                         bool commentIsMultiline )
+                              bool commentIsMultiline )
 {
-       mIsInComment        = isInComment;
-       mCommentIsMultiline = commentIsMultiline;
+    mIsInComment        = isInComment;
+    mCommentIsMultiline = commentIsMultiline;
 }
 
 void SourcePainter::Init(bool assembleResultString)
 {
-       mIsInComment        = 0;
-       mCommentIsMultiline = 0;
-       mCollectResultsOn   = assembleResultString;
+    mIsInComment        = 0;
+    mCommentIsMultiline = 0;
+    mCollectResultsOn   = assembleResultString;
 
-       mResultStr = "";
+    mResultStr = "";
 
-       mBlocks.erase( mBlocks.begin(), mBlocks.end() );
+    mBlocks.erase( mBlocks.begin(), mBlocks.end() );
 }
 
-static int rank_tags_map[] = 
-{ 
-       TAG_BLACK_FONT, 
-       TAG_BLUE_FONT,
-       TAG_RED_FONT,
-       TAG_GREEN_FONT
+static int rank_tags_map[] =
+{
+    TAG_BLACK_FONT,
+    TAG_BLUE_FONT,
+    TAG_RED_FONT,
+    TAG_GREEN_FONT
 };
 
 void SourcePainter::GetResultString(string& result, MarkupTagsT tags)
 {
-       // this method works, only if results of processing 
-       // are collected
-       // ASSERT( mCollectResultsOn ); 
-       result = "";
+    // this method works, only if results of processing
+    // are collected
+    // ASSERT( mCollectResultsOn );
+      result = "";
 
-       unsigned pos = 0;
+    unsigned pos = 0;
 
-       for( size_t i = 0; i != mBlocks.size(); ++i )
-       {
-               int desc = mBlocks[i];
+    for( size_t i = 0; i != mBlocks.size(); ++i )
+    {
+        int desc = mBlocks[i];
 
-               unsigned len  = desc & 0xFFFF;
-               int rank = (desc >> 16) & 0xFFFF;
+        unsigned len  = desc & 0xFFFF;
+        int rank = (desc >> 16) & 0xFFFF;
 
-               result += tags[ rank_tags_map[rank] ].start;
+        result += tags[ rank_tags_map[rank] ].start;
 
-               for( unsigned n = 0; n != len; ++n )
-               
-                       result += mResultStr[(unsigned int)(pos+n)];
+        for( unsigned n = 0; n != len; ++n )
+        
+            result += mResultStr[(unsigned int)(pos+n)];
 
-               pos += len;
+        pos += len;
 
-               result += tags[ rank_tags_map[rank] ].end;
-       }
+        result += tags[ rank_tags_map[rank] ].end;
+    }
 }
 
 SPBlockListT& SourcePainter::GetBlocks()
 {
-       return mBlocks;
+    return mBlocks;
 }
 
 bool SourcePainter::IsKeyword( char* word, int wordLen )
 {
-       check_keyword_map(0);
+    check_keyword_map(0);
 
-       int rank = get_rank( word, word + wordLen );
+    int rank = get_rank( word, word + wordLen );
 
-       return (  rank == RANK_BLUE || rank == RANK_RED );
+    return (  rank == RANK_BLUE || rank == RANK_RED );
 }