Page 1 of 1

[CELayoutEditor Update] Lint, asserts and bug fixes

Posted: Thu Nov 22, 2007 16:32
by fjeronimo
Hello guys,

It's time for a new SVN update.

The update includes important bug fixes and internal changes that increase performance and code quality. PC-Lint ( was also used to solve several issues.

Here's the detailed contents:


Update features:

- New: _CPPUNWIND - Added explicit _CPPUNWIND to force CPP exception handling in Visual Studio 2005 & 2003 because in some cases the /EHsc compiler options gets ignored.

- New: Asserts - Added many assert verifications to the solution.

- New: PC-Lint configuration files - Added PC-Lint configuration files to CELayoutEditor at Docs\Lint. See PC-Lint entry below for more details.

- New: Log macros - Added LOG_EXCEPTION_SAFE macro, useful for catching exceptions inside a destructor (which should never throw exceptions).

- Change: PC-Lint - Run PC-Lint (8.00w) on the project. Many style changes including (but not limited to):
    * Removed unused variables.
    * Removed unused includes.
    * Prevented exceptions in destructors.
    * Nomenclature fixes (still a long way to go).
    * Initialized variables (notably during construction).
    * Added code validations (e.g. null pointer checks).
    * Renamed local variables that were hiding other global (or possibly even local) elements of lower scope.
    * Explicitly marked unused function return value as (void)func().
    * Added C++ casts where needed (static and const casts).
    * Removed unreachable code warnings.
    * Added missing destructors.
    * Avoided, whenever possible, calling virtual members during construction and destruction (since the base versions of these functions and never the derived would be called).
    * Used scoping operator to access static class members whenever possible (instead of using the instances directly).
    * Prevented unqualified virtual function calls.
    * Preferred constructor initialization list instead of assignment inside constructor for variable setup.
    * Reduced prototype coercion.
- Change: Const use - Improved const use throughout the code (including const member functions, const parameters and const ref parameters).

- Change: Replaced static_cast by wx_static_cast, which is safer and reverts back to C-style casting if static_cast is not supported.

- Bugfix: Memory leaks - Cleaned a couple of memory leaks by freeing allocated custodial pointers.

- Bugfix: Empty view check - Fixed a situation in EditorCanvas::OnKeyDown() that would cause a fatal error when trying to perform operations on an empty view.

- BugFix: Text colour crash - Fixed a crash in EditorDocument::HandleColoursUpdate when the user tried to modify the text color (via shift drag) of a window that didn't support the TextColours property.

- Bugfix: Default color - Fixed a bug in EditorDocument::HandleColoursUpdate() where the default color was always being chosen as the upper left corner of the rectangle (i.e. missing break statements in the switch/case).

- Bugfix: Mouse movement modification - Fixed a bug in EditorDocument::HandleMouseMoved where the function was always flagging a modification even when one wasn't being performed.


Have fun.

Posted: Thu Nov 22, 2007 20:39
by scriptkid
Wow :)

Posted: Fri Nov 23, 2007 09:42
by fjeronimo
Thanks :)

Posted: Sat Nov 24, 2007 17:39
by Pompei2
yeah you do a really good job i can only encourage you to continue :P

Posted: Sun Nov 25, 2007 22:11
by fjeronimo
Thanks pompei2. We plan to keep on making many more changes... :)