Author Topic: patchs in pipeline  (Read 9540 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
patchs in pipeline
« on: July 23, 2013, 06:50:02 pm »
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

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: patchs in pipeline
« Reply #1 on: July 24, 2013, 03:45:12 am »
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: patchs in pipeline
« Reply #2 on: July 24, 2013, 07:48:07 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: patchs in pipeline
« Reply #3 on: July 24, 2013, 08:26:32 am »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: patchs in pipeline
« Reply #4 on: July 26, 2013, 10:41:36 pm »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7607
    • My Best Post
Re: patchs in pipeline
« Reply #5 on: July 26, 2013, 11:23:18 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.

Code
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.
« Last Edit: July 26, 2013, 11:28:50 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: patchs in pipeline
« Reply #6 on: July 27, 2013, 03:48:40 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline p2rkw

  • Almost regular
  • **
  • Posts: 142
Re: patchs in pipeline
« Reply #7 on: July 27, 2013, 06:36:54 pm »
struct A; //forward decl
typedef A B;
?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: patchs in pipeline
« Reply #8 on: July 27, 2013, 06:43:35 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: patchs in pipeline
« Reply #9 on: July 28, 2013, 07:56:18 pm »
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