News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Minor bugs-fixed.

Started by mmkider, March 30, 2009, 02:27:32 PM

Previous topic - Next topic

mmkider

I found some bugs for index-error in the codeblocks.
they are very minor bugs.
see that


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;
     }




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]

mmkider

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


    XRCCTRL(*this, "btnExecutionDir", wxTextCtrl)->Enable(customMake);

need change code to

    XRCCTRL(*this, "btnExecutionDir", wxButton)->Enable(customMake);

Jenna

Quote from: 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


    XRCCTRL(*this, "btnExecutionDir", wxTextCtrl)->Enable(customMake);

need change code to

    XRCCTRL(*this, "btnExecutionDir", wxButton)->Enable(customMake);


fixed in svn r5498

Thank you !

mmkider

#3
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.


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]

MortenMacFly

Quote from: mmkider on May 27, 2009, 03:14:50 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?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mmkider

#5
Quote from: MortenMacFly on May 27, 2009, 09:03:34 AM
Quote from: mmkider on May 27, 2009, 03:14:50 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.

-                wxString tmps = tmp.GetFullPath();

I alway get auto-generated/Special/test.o.

In this follow 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]

mmkider

Lost initial variable.

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;}