Author Topic: A few bugs & patches for them.  (Read 6424 times)

Offline Mephistopheles

  • Multiple posting newcomer
  • *
  • Posts: 16
A few bugs & patches for them.
« on: October 30, 2008, 06:47:39 pm »
Hello.

I've been using the openSUSE build service for some while to build CodeBlocks RPMs from SVN and since they added quite some checks for the newest (Factory) release a few things came up which had to be fixed:

1. src/mime/codeblocks.desktop:
Code
--- src/mime/codeblocks.desktop
+++ src/mime/codeblocks.desktop
@@ -11,4 +11,3 @@
 Categories=Application;Development;
 StartupNotify=true
 MimeType=application/x-codeblocks;application/x-codeblocks-workspace;
-GenericName[en_GR]=

2. src/sdk/scripting/sqplus/SqPlus.cpp:
Code
diff -Naur codeblocks/src/sdk/scripting/sqplus/SqPlus.cpp codeblocks.modified/src/sdk/scripting/sqplus/SqPlus.cpp
--- codeblocks/src/sdk/scripting/sqplus/SqPlus.cpp      2008-04-21 20:00:32.000000000 +0200
+++ codeblocks.modified/src/sdk/scripting/sqplus/SqPlus.cpp     2008-10-04 18:48:05.000000000 +0200
@@ -64,7 +64,7 @@
   if (vr->access & (VAR_ACCESS_READ_ONLY|VAR_ACCESS_CONSTANT)) {
     ScriptStringVar256 msg;
     const SQChar * el = sa.GetString(2);
-    SCSNPRINTF(msg.s,sizeof(msg),sqT("setVar(): Cannot write to constant: %s"),el);
+    SCSNPRINTF(msg.s,sizeof(msg.s),sqT("setVar(): Cannot write to constant: %s"),el);
     throw SquirrelError(msg.s);
   } // if
   switch (vr->type) {
@@ -114,7 +114,7 @@
   case TypeInfo<SQUserPointer>::TypeID: {
     ScriptStringVar256 msg;
     const SQChar * el = sa.GetString(2);
-    SCSNPRINTF(msg.s,sizeof(msg),sqT("setVar(): Cannot write to an SQUserPointer: %s"),el);
+    SCSNPRINTF(msg.s,sizeof(msg.s),sqT("setVar(): Cannot write to an SQUserPointer: %s"),el);
     throw SquirrelError(msg.s);
   } // case
   case TypeInfo<ScriptStringVarBase>::TypeID: {
@@ -175,7 +175,7 @@
   case VAR_TYPE_INSTANCE:
     if (!CreateNativeClassInstance(sa.GetVMPtr(),vr->typeName,data,0)) { // data = address. Allocates memory.
       ScriptStringVar256 msg;
-      SCSNPRINTF(msg.s,sizeof(msg),sqT("getVar(): Could not create instance: %s"),vr->typeName);
+      SCSNPRINTF(msg.s,sizeof(msg.s),sqT("getVar(): Could not create instance: %s"),vr->typeName);
       throw SquirrelError(msg.s);
     } // if
     return 1;

3. src/plugins/projectsimporter/projectsimporter.cpp:
Code
diff -Naur codeblocks.original/src/plugins/projectsimporter/projectsimporter.cpp codeblocks/src/plugins/projectsimporter/projectsimporter.cpp
--- codeblocks.original/src/plugins/projectsimporter/projectsimporter.cpp       2008-10-30 12:29:48.000000000 +0100
+++ codeblocks/src/plugins/projectsimporter/projectsimporter.cpp        2008-10-30 12:31:02.000000000 +0100
@@ -98,7 +98,11 @@
         menuId = fileMenu->FindItem(_T("Recent files"));
         wxMenuItem* recentFileItem = fileMenu->FindItem(menuId);
         id = menuItems.IndexOf(recentFileItem);
-        id = (id == wxNOT_FOUND) ? 7 : ++id;
+       if (id == wxNOT_FOUND) {
+               id = 7;
+       } else {
+               ++id;
+       }
         // The position is hard-coded to "Recent Files" menu. Please adjust it if necessary
         fileMenu->Insert(++id, wxNewId(), _("&Import project"), m_Menu);
         fileMenu->InsertSeparator(++id);

Could you please review (I'm no C/C++ guy) and apply those patches to the trunk (they can be applied against the current SVN version)?

Offline Mephistopheles

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: A few bugs & patches for them.
« Reply #1 on: December 17, 2008, 01:08:01 pm »
Sorry to bump my own, but the response was so overwhelming .... ;D

Could you (the developers) please have a look at this and / or tell me your preferred way of how to get those patches into the trunk? E.g. I happily make a formal bug report, I just thought that those fixes are so small that it would be unnecessary and posting them here would be quicker to get them reviewed and applied by someone with svn access.

Shortly put the problems are the following:

1. An translation entry without translation makes no sense.
2. You were getting the size from the wrong object.
3. If "id != wxNOT_FOUND" it would result in "id = ++id;" which isn't valid C/C++ afaik.

So, please let me know how I am supposed to get those applied :)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: A few bugs & patches for them.
« Reply #2 on: December 18, 2008, 03:21:49 pm »
I'll apply them. I'm aware of the last one. Remaining ones I need to check once. :)
Be a part of the solution, not a part of the problem.

Offline TheTuxKeeper

  • Regular
  • ***
  • Posts: 293
  • daniel2000
Re: A few bugs & patches for them.
« Reply #3 on: February 17, 2009, 05:45:03 pm »
I just wanted to note that the second issue is still there :)
« Last Edit: February 18, 2009, 11:02:44 am by TheTuxKeeper (aka daniel2000) »
Nightly builds for openSUSE

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: A few bugs & patches for them.
« Reply #4 on: February 25, 2009, 04:38:47 pm »
I just wanted to note that the second issue is still there :)

Applied now. Thanks for reminder. :)
Be a part of the solution, not a part of the problem.