Author Topic: Patches for Todolist and OpenWatcom-Compiler  (Read 5168 times)

Offline yesno

  • Multiple posting newcomer
  • *
  • Posts: 19
Patches for Todolist and OpenWatcom-Compiler
« on: October 25, 2008, 04:56:02 pm »
I have made patches for todolist.cpp, now you can see an entry which is in a //{ comment line (btw. nice)

Code
Index: todolistview.cpp
===================================================================
--- todolistview.cpp (Revision 5286)
+++ todolistview.cpp (Arbeitskopie)
@@ -416,7 +416,7 @@
 //#warning TODO (mandrav#1#): Make viewtododlg understand and display todo notes that are compiler warnings/errors...
 
             // first check what type of comment we have
-            wxString allowedChars = _T(" \t/*");
+            wxString allowedChars = _T(" \t/*{");
             wxChar lastChar = _T('\0');
             while (idx >= 0)
             {

and another one for compilerOW.cpp, compilerOWgenerator.cpp & .h.
compilerOW has some more groups (Executable type options, Object type options, Memory model options and Warning options). The -h -options have been moved to Debug options.
compilerOWgenerator generates now a debug directive for the linker for -d3 too and the appropriate debugger after the -h -option.

Code
Index: compilerOW.cpp
===================================================================
--- compilerOW.cpp (Revision 5286)
+++ compilerOW.cpp (Arbeitskopie)
@@ -117,7 +117,7 @@
     m_Options.AddOption(wxT("optimize floating-point for Pentium"), wxT("-fp5"), category);
     m_Options.AddOption(wxT("optimize floating-point for Pentium Pro"), wxT("-fp6"), category);
 
-    category = wxT("Compiler options");
+    category = wxT("Executable type options");
 
     m_Options.AddOption(wxT("compile and link for DOS"), wxT("-bcl=dos"), category);
     m_Options.AddOption(wxT("compile and link for Linux"), wxT("-bcl=linux"), category);
@@ -126,6 +126,8 @@
     m_Options.AddOption(wxT("compile and link for QNX"), wxT("-bcl=qnx"), category);
     m_Options.AddOption(wxT("compile and link for Windows"), wxT("-bcl=windows"), category);
 
+    category = wxT("Object type options");
+
     m_Options.AddOption(wxT("compile for DOS"), wxT("-bt=dos"), category);
     m_Options.AddOption(wxT("compile for Linux"), wxT("-bt=linux"), category);
     m_Options.AddOption(wxT("compile for NetWare"), wxT("-bt=netware"), category);
@@ -135,6 +137,7 @@
     m_Options.AddOption(wxT("compile for QNX"), wxT("-bt=qnx"), category);
     m_Options.AddOption(wxT("compile for Windows"), wxT("-bt=windows"), category);
 
+    category = wxT("Compiler options");
 
     m_Options.AddOption(wxT("generate browsing information"), wxT("-db"), category);
     m_Options.AddOption(wxT("set error limit number (set ERROR_LIMIT in custom variables)"), wxT("-e=$(ERROR_LIMIT)"), category);
@@ -162,16 +165,7 @@
     m_Options.AddOption(wxT("(C++) check for 8.3 file names"), wxT("-ft"), category);
     m_Options.AddOption(wxT("(C++) no check for 8.3 file names"), wxT("-fx"), category);
     m_Options.AddOption(wxT("set code group name (define CODEGROUP in custom variables)"), wxT("-g=$(CODEGROUP)"), category);
-    m_Options.AddOption(wxT("codeview debug format"), wxT("-hc"), category);
-    m_Options.AddOption(wxT("dwarf debug format"), wxT("-hd"), category);
-    m_Options.AddOption(wxT("watcom debug format"), wxT("-hw"), category);
     m_Options.AddOption(wxT("change char default to signed"), wxT("-j"), category);
-    m_Options.AddOption(wxT("memory model flat"), wxT("-mf"), category);
-    m_Options.AddOption(wxT("memory model small"), wxT("-ms"), category);
-    m_Options.AddOption(wxT("memory model medium"), wxT("-mm"), category);
-    m_Options.AddOption(wxT("memory model compact"), wxT("-mc"), category);
-    m_Options.AddOption(wxT("memory model large"), wxT("-ml"), category);
-    m_Options.AddOption(wxT("memory model huge"), wxT("-mh"), category);
     m_Options.AddOption(wxT("set CODE class name (define CODECLASS in custom variables)"), wxT("-nc=$(CODECLASS)"), category);
     m_Options.AddOption(wxT("set data segment name (define DATANAME in custom variables)"), wxT("-nd=$(DATANAME)"), category);
     m_Options.AddOption(wxT("set module name (define MODULENAME in custom variables)"), wxT("-nm=$(MODULENAME)"), category);
@@ -183,14 +177,6 @@
     m_Options.AddOption(wxT("touch stack through SS first"), wxT("-st"), category);
     m_Options.AddOption(wxT("output func declarations to .def"), wxT("-v"), category);
     m_Options.AddOption(wxT("VC++ compat: alloca allowed in arg lists"), wxT("-vcap"), category);
-    m_Options.AddOption(wxT("set warning level to 0 (suppress warnings)"), wxT("=w=0"), category);
-    m_Options.AddOption(wxT("set warning level to 1"), wxT("-w=1"), category);
-    m_Options.AddOption(wxT("set warning level to 2"), wxT("-w=2"), category);
-    m_Options.AddOption(wxT("set warning level to 3"), wxT("-w=3"), category);
-    m_Options.AddOption(wxT("disable warning message (define DIS_WARN in custom variables)"), wxT("-wcd=$(DIS_WARN)"), category);
-    m_Options.AddOption(wxT("enable warning message (define ENA_WARN in custom variables)"), wxT("-wce=$(ENA_WARN)"), category);
-    m_Options.AddOption(wxT("treat all warnings as errors"), wxT("-we"), category);
-    m_Options.AddOption(wxT("set warning level to max"), wxT("-wx"), category);
     m_Options.AddOption(wxT("(C++) enable RTTI"), wxT("-xr"), category);
     m_Options.AddOption(wxT("disable language extensions (ANSI/ISO compliance)"), wxT("-za"), category);
     m_Options.AddOption(wxT("enable language extensions"), wxT("-ze"), category);
@@ -230,6 +216,26 @@
     m_Options.AddOption(wxT("generate code for MS Windows"), wxT("-zw"), category);
     m_Options.AddOption(wxT("remove @size from __stdcall func."), wxT("-zz"), category);
 
+    category = wxT("Memory model options");
+
+    m_Options.AddOption(wxT("memory model flat"), wxT("-mf"), category);
+    m_Options.AddOption(wxT("memory model small"), wxT("-ms"), category);
+    m_Options.AddOption(wxT("memory model medium"), wxT("-mm"), category);
+    m_Options.AddOption(wxT("memory model compact"), wxT("-mc"), category);
+    m_Options.AddOption(wxT("memory model large"), wxT("-ml"), category);
+    m_Options.AddOption(wxT("memory model huge"), wxT("-mh"), category);
+
+    category = wxT("Warning options");
+
+    m_Options.AddOption(wxT("set warning level to 0 (suppress warnings)"), wxT("-w=0"), category);
+    m_Options.AddOption(wxT("set warning level to 1"), wxT("-w=1"), category);
+    m_Options.AddOption(wxT("set warning level to 2"), wxT("-w=2"), category);
+    m_Options.AddOption(wxT("set warning level to 3"), wxT("-w=3"), category);
+    m_Options.AddOption(wxT("disable warning message (define DIS_WARN in custom variables)"), wxT("-wcd=$(DIS_WARN)"), category);
+    m_Options.AddOption(wxT("enable warning message (define ENA_WARN in custom variables)"), wxT("-wce=$(ENA_WARN)"), category);
+    m_Options.AddOption(wxT("treat all warnings as errors"), wxT("-we"), category);
+    m_Options.AddOption(wxT("set warning level to max"), wxT("-wx"), category);
+
     category = wxT("Debugging options");
 
     m_Options.AddOption(wxT("no debugging information"), wxT("-d0"), category);
@@ -242,6 +248,9 @@
     m_Options.AddOption(wxT("full symbolic debugging with unreferenced type names"), wxT("-d3"), category);
     m_Options.AddOption(wxT("(C++) d3 plus debug inlines; emit inlines as external out-of-line functions"), wxT("-d3i"), category);
     m_Options.AddOption(wxT("(C++) d3 plus debug inlines; emit inlines as static out-of-line functions"), wxT("-d3s"), category);
+    m_Options.AddOption(wxT("codeview debug format"), wxT("-hc"), category);
+    m_Options.AddOption(wxT("dwarf debug format"), wxT("-hd"), category);
+    m_Options.AddOption(wxT("watcom debug format"), wxT("-hw"), category);
 
     category = wxT("Optimization options");
 
Index: compilerOWgenerator.cpp
===================================================================
--- compilerOWgenerator.cpp (Revision 5286)
+++ compilerOWgenerator.cpp (Arbeitskopie)
@@ -24,6 +24,7 @@
 CompilerOWGenerator::CompilerOWGenerator()
 {
     //ctor
+    DebuggerType = wxEmptyString;
 }
 
 CompilerOWGenerator::~CompilerOWGenerator()
@@ -124,6 +125,11 @@
                 {
                     LinkerOptions = LinkerOptions + MapDebugOptions(Temp);
                 }
+                // Debugger Type: -hw (Watcom), -hd (Dwarf), -hc (CodeView)
+                else if (Temp.Matches(_T("-h?")))
+                {
+                  MapDebuggerOptions(Temp);
+                }
                 else if (Temp.StartsWith(_T("-l=")))
                 {
                     Temp = Temp.AfterFirst(_T('='));
@@ -239,11 +245,19 @@
     if (Opt.IsSameAs(_T("-d0"))) // No Debug
         return wxEmptyString;
     if (Opt.IsSameAs(_T("-d1")))
-        return _T("debug watcom lines ");
-    if (Opt.IsSameAs(_T("-d2")))
-        return _T("debug watcom all ");
+        return wxString(_T("debug ")) + DebuggerType + wxString(_T("lines "));
+    if (Opt.IsSameAs(_T("-d2")) || Opt.IsSameAs(_T("-d3")))
+        return wxString(_T("debug ")) + DebuggerType + wxString(_T("all "));
     // Nothing Matched
     return wxEmptyString;
 }
 
+void CompilerOWGenerator::MapDebuggerOptions(const wxString& Opt)
+{
+  if (Opt.IsSameAs(_T("-hw"))) DebuggerType=_T("watcom ");
+  else if (Opt.IsSameAs(_T("-hd"))) DebuggerType=_T("dwarf ");
+  else if (Opt.IsSameAs(_T("-hc"))) DebuggerType=_T("codeview ");
+  else DebuggerType=wxEmptyString;
+}
+
 #endif // __WXMSW__
Index: compilerOWgenerator.h
===================================================================
--- compilerOWgenerator.h (Revision 5286)
+++ compilerOWgenerator.h (Arbeitskopie)
@@ -26,6 +26,10 @@
         wxString MapTargetType(const wxString& Opt, int target_type);
         // This maps debug related compiler options to wlink.exe options
         wxString MapDebugOptions(const wxString& Opt);
+        // Open Watcom supports: Watcom debugger, Dwarf (default), CodeView
+        void MapDebuggerOptions(const wxString& Opt);
+        // Debugger name which will later be used in MapDebugOptions
+        wxString DebuggerType;
 };
 
 

It were nice to apply the patches.

Thanks in advance and with regards
yes no

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Patches for Todolist and OpenWatcom-Compiler
« Reply #1 on: October 25, 2008, 05:49:07 pm »
I've applied patch for the OpenWatcom compiler. Thanks for the patch.

Can you please explain the To-Do list patch? Thanks again. :)
Be a part of the solution, not a part of the problem.

Offline yesno

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Patches for Todolist and OpenWatcom-Compiler
« Reply #2 on: October 25, 2008, 06:23:52 pm »
About the TODO-patch:

The '{' character is now an allowed character like whitespaces and will be skipped too rather than telling the program it were not a comment.

Thanks for applying the other patch.

With regards
yes no

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Patches for Todolist and OpenWatcom-Compiler
« Reply #3 on: October 25, 2008, 07:55:05 pm »
The '{' character is now an allowed character like whitespaces and will be skipped too rather than telling the program it were not a comment.
Hmmm... Sorry, but I'm afraid I still don't get it. Can you provide a ToDo item where this would apply / make sense?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline yesno

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Patches for Todolist and OpenWatcom-Compiler
« Reply #4 on: October 26, 2008, 03:14:12 pm »
The patch could be useful when testing a lot of functions &&&, for example:

Code
//{ TODO Test classWX::functionYZ(const classWX&)
// Testcases:
// .
// .
void test_functionYZ(void)
{
}
//}

With regards
yes no

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Patches for Todolist and OpenWatcom-Compiler
« Reply #5 on: October 26, 2008, 03:38:42 pm »
The patch could be useful when testing a lot of functions &&&, for example:

Code
//{ TODO Test classWX::functionYZ(const classWX&)
// Testcases:
// .
// .
void test_functionYZ(void)
{
}
//}

With regards
yes no

Is it widely used or just your preference? In case it's used widely then I see the usefulness of this patch. Otherwise not.
Be a part of the solution, not a part of the problem.

Offline yesno

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Patches for Todolist and OpenWatcom-Compiler
« Reply #6 on: October 27, 2008, 11:44:47 am »
I think, it's indeed my preference. Sorry and forget it.

With regards
yes no