News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

A few bugs & patches for them.

Started by Mephistopheles, October 30, 2008, 06:47:39 PM

Previous topic - Next topic

Mephistopheles

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:
--- 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:
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:
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)?

Mephistopheles

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 :)

Biplab

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.

TheTuxKeeper

#3
I just wanted to note that the second issue is still there :)
Nightly builds for openSUSE

Biplab

Quote from: TheTuxKeeper on February 17, 2009, 05:45:03 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.