Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: mmkider on March 30, 2009, 02:27:32 pm

Title: Minor bugs-fixed.
Post by: mmkider on March 30, 2009, 02:27:32 pm
I found some bugs for index-error in the codeblocks.
they are very minor bugs.
see that

Code
Index: debuggeroptionsprjdlg.cpp
===================================================================
--- debuggeroptionsprjdlg.cpp (revision 5492)
+++ debuggeroptionsprjdlg.cpp (working copy)
@@ -91,7 +91,7 @@
     {
         lstBox->Delete(idx);
     }
-    if((size_t)idx > lstBox->GetCount())
+    if((size_t)idx >= lstBox->GetCount())
     {
         idx--;
     }
@@ -150,7 +150,7 @@
         // if we renamed it, just break, there can only be one map per target
         break;
     }


Code
Index: cbproject.cpp
===================================================================
--- cbproject.cpp (revision 5492)
+++ cbproject.cpp (working copy)
@@ -1972,7 +1972,7 @@
             if (vt.Index(nameOrder[i]) != wxNOT_FOUND)
             {
                 vt.Remove(nameOrder[i]);
-                vt.Insert(nameOrder[i], i);
+         vt.Insert(nameOrder[i],vt.Count()<=i? vt.Count()-1:i);
             }
         }
     }

[attachment deleted by admin]
Title: Re: Minor bugs-fixed.
Post by: mmkider on April 03, 2009, 04:48:26 am
In rev 5497 of codeblocks.

Quote
618F1513  D:\WIDE_ARM\Development\WindowsPlatform\Src\ExeProject\CodeBlocks_debug\src\devel\codeblocks.dll:618F1513  ProjectOptionsDlg::OnUpdateUI(wxUpdateUIEvent&)  D:/WIDE_ARM/Development/WindowsPlatform/Src/ExeProject/CodeBlocks_debug/src/sdk/projectoptionsdlg.cpp:1031

Code
    XRCCTRL(*this, "btnExecutionDir", wxTextCtrl)->Enable(customMake);
need change code to
Code
    XRCCTRL(*this, "btnExecutionDir", wxButton)->Enable(customMake);
Title: Re: Minor bugs-fixed.
Post by: Jenna on April 03, 2009, 06:38:25 am
In rev 5497 of codeblocks.

Quote
618F1513  D:\WIDE_ARM\Development\WindowsPlatform\Src\ExeProject\CodeBlocks_debug\src\devel\codeblocks.dll:618F1513  ProjectOptionsDlg::OnUpdateUI(wxUpdateUIEvent&)  D:/WIDE_ARM/Development/WindowsPlatform/Src/ExeProject/CodeBlocks_debug/src/sdk/projectoptionsdlg.cpp:1031

Code
    XRCCTRL(*this, "btnExecutionDir", wxTextCtrl)->Enable(customMake);
need change code to
Code
    XRCCTRL(*this, "btnExecutionDir", wxButton)->Enable(customMake);

fixed in svn r5498

Thank you !
Title: Re: Minor bugs-fixed.
Post by: mmkider on May 27, 2009, 03:14:50 am
Fixed:
       1.  Path of generated files always keep $file_dir  in the   generated files (to be further compiled) windows.
       2. Insert index need be checked.

Code
Index: cbproject.cpp
===================================================================
--- cbproject.cpp (revision 5611)
+++ cbproject.cpp (working copy)
@@ -749,7 +749,7 @@
             for (size_t i = 0; i < tool->generatedFiles.GetCount(); ++i)
             {
                 tmp.SetFullName(tool->generatedFiles[i]);
-                wxString tmps = tmp.GetFullPath();
+                wxString tmps = tmp.GetFullName();
                 // any macro replacements here, should also be done in
                 // CompilerCommandGenerator::GenerateCommandLine !!!
                 tmps.Replace(_T("$file_basename"), f->file.GetName()); // old way - remove later
@@ -2008,7 +2008,7 @@
             if (vt.Index(nameOrder[i]) != wxNOT_FOUND)
             {
                 vt.Remove(nameOrder[i]);
-                vt.Insert(nameOrder[i], i);
+         vt.Insert(nameOrder[i],vt.Count()<=i? vt.Count()-1:i);
             }
         }
     }

[attachment deleted by admin]
Title: Re: Minor bugs-fixed.
Post by: MortenMacFly on May 27, 2009, 09:03:34 am
       1.  Path of generated files always keep $file_dir  in the   generated files (to be further compiled) windows.
I would love to apply that one (the other one I have already applied in my local copy), but I don't understand. Can you try to explain differently / in other words / with an example, please?!
Title: Re: Minor bugs-fixed.
Post by: mmkider on May 27, 2009, 09:29:07 am
       1.  Path of generated files always keep $file_dir  in the   generated files (to be further compiled) windows.
I would love to apply that one (the other one I have already applied in my local copy), but I don't understand. Can you try to explain differently / in other words / with an example, please?!
I try explain this.
If I have a special file(test.bin) in the $(PROJECT_DIR)/Special/.
And I keyin some thing in advanced compiler option, see pic.
In this code.
Code
-                wxString tmps = tmp.GetFullPath();
I alway get auto-generated/Special/test.o.

In this follow code.
Code
+                wxString tmps = tmp.GetFullName();
I can get auto-generated/test.o.
I think this is correct result, because I only keyin $file_name.o not $file_dir/$file_name.o in the generated files window.

I hope you can understand my mind  in my poor english. :lol:


[attachment deleted by admin]
Title: Re: Minor bugs-fixed.
Post by: mmkider on June 16, 2009, 01:19:38 pm
Lost initial variable.
Code
Index: cbtool.h
===================================================================
--- cbtool.h (revision 5651)
+++ cbtool.h (working copy)
@@ -21,7 +21,7 @@
         LAUNCH_VISIBLE_DETACHED
     };
 
-    cbTool() { m_MenuId = -1; }
+    cbTool() { m_LaunchOption=LAUNCH_NEW_CONSOLE_WINDOW;m_MenuId = -1; }
     // getters
     wxString GetName() const {return m_Name;}
     wxString GetCommand() const {return m_Command;}