News:

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

Main Menu

patchs in pipeline

Started by BlueHazzard, July 23, 2013, 06:50:02 PM

Previous topic - Next topic

BlueHazzard

Hi...
i have now time to work a bit on c::b
There are 4 patches i have created on berlios, but no comments... can someone say something about them ;)

Add an option to add the include directory automatically to the project:
http://developer.berlios.de/patch/?func=detailpatch&patch_id=3488&group_id=5358
discussion about this would be welcome (mostly about if the path should be added to the main project, or to every build target)

Bug Fix for script menu entry
http://developer.berlios.de/patch/?func=detailpatch&patch_id=3480&group_id=5358
This Patch fixes a bug, if a script adds a menu entry, and the script gets reloaded, the old script is called by the menu entry and not the new. This patch is not really beautiful, but i think i will rework the scripting framework a bit in the future, to make this more elegant. But for now it works...

Bug Fix for a crash about a buffer overflow in the print function for squirrel
http://developer.berlios.de/patch/?func=detailpatch&patch_id=3479&group_id=5358
This really should be fixed....

Add a option for automatic line truncation in AStyle
http://developer.berlios.de/patch/?func=detailpatch&patch_id=3478&group_id=5358

greetings

Alpha

Quote from: BlueHazzard on July 23, 2013, 06:50:02 PM
There are 4 patches i have created on berlios, but no comments... can someone say something about them ;)
I have been feeling too lazy to review code :).  I will try to look at some this week.

MortenMacFly

Quote from: Alpha on July 24, 2013, 03:45:12 AM
I have been feeling too lazy to review code :).  I will try to look at some this week.
I am testing these myself, too and I'll report back if I see serious regressions.

@alpha: For the astyle thing: Please leave it to me, as I've some more updates on that plugin. I'll assign it to me.
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]

MortenMacFly

Quote from: BlueHazzard on July 23, 2013, 06:50:02 PM
Bug Fix for a crash about a buffer overflow in the print function for squirrel
http://developer.berlios.de/patch/?func=detailpatch&patch_id=3479&group_id=5358
This really should be fixed....
I don't like the design of this one. It introduces a dependency for SQPlus for all plugins using ScriptingManager interface. This essentially breaks the idea of an interface. So "scriptinmanager" should definitely not include sqplus.h.

If thats the case it should be fine. A forward declaration to SQChar might be enough, but I didn't try...
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]

BlueHazzard

Quote from: MortenMacFly on July 24, 2013, 08:26:32 AM
I don't like the design of this one. It introduces a dependency for SQPlus for all plugins using ScriptingManager interface. This essentially breaks the idea of an interface. So "scriptinmanager" should definitely not include sqplus.h.

If thats the case it should be fine. A forward declaration to SQChar might be enough, but I didn't try...

i see your problem... the actual dependency goes to squirrel, but it's the same... i will look into it.
Some questions:

  • how can i forward declare a type in c++?
  • The problem with forward declaration is that SQChar can be wchar_t or char... so i have to put a preprocessorswitch

A other possibility would be to move the function to somewhere else... Maybe a new file like scriptutil.cpp

I'm in a region with limited internet, so my answers won't be immediate.

greetings

stahta01

#5
Quote from: BlueHazzard on July 26, 2013, 10:41:36 PM
The problem with forward declaration is that SQChar can be wchar_t or char... so i have to put a preprocessorswitch

I suggest using "TCHAR" in a declaration like below; but, it might not work.


typedef TCHAR SQChar;


Should work; but, I am just a C programmer. This not says not to use TCHAR in C++ Headers http://blogs.msdn.com/b/andrewarnottms/archive/2008/02/22/why-you-should-never-use-tchar-in-c-header-files.aspx

TCHAR might required header tchar.h

From tchar.h in MinGW GCC installed with CB 12.11.

Quote
/*
* Use TCHAR instead of char or wchar_t. It will be appropriately translated
* if _UNICODE is correctly defined (or not).
*/

Tim S.

PS: I am only a Code::Blocks user; not a CB developer.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

MortenMacFly

Quote from: BlueHazzard on July 26, 2013, 10:41:36 PM
how can i forward declare a type in c++?
Oh that was a typedef and not a class?! - Well than there is no easy solution, forward decl will not work.
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]

p2rkw

struct A; //forward decl
typedef A B;
?

MortenMacFly

Quote from: p2rkw on July 27, 2013, 06:36:54 PM
struct A; //forward decl
typedef A B;
?
Is it that simple? I think I need to have a look at the sources. All my remarks came from the errors when trying to compile all plugins with with the patch.
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]

BlueHazzard

its like
#ifdef UNICODE
typedef SQChar wchar_t
#else
typedef SQchar unsigned char
#endif

in squirrel.h so no easy solution...  We can use a helper file...

greetings