C code cleanup / News: Recent posts

new idea

while debugging, usually we create an error(), or something like it, so any memory alocation or missing files or any other error, the error() output debug info
the release dont need to waste time doing stuff like that, and waste space with its code
so we just could define error function like this
void error(void)
{
#ifdef DEBUG
/* code
more code
*/
#endif
}
but the call to the function still exist
so we just could write each call to error() between and #ifdef DEBUG #endif
but that is a pain in the ass
user could just register in ccup what function he wants to force cleanup, so its declaration, definition and calls are made into comment
that could be registered in groups
group DEBUG, DEBUG_LEVEL1, DEBUG_UI, DEBUG_NETWORK etc..

Posted by Tovmeod 2004-04-20

Start

Hope this can be useful, the hole idea is to write a parser that cleanup code.
Input is the projects source files
output is the files but with different names and with the code commented

example:
void fn(void); /* declared */
void fn(void)
{
/* code
more code...
*/
}
/* any calls to fn() are made in all project files */
so the difference between the input and the output
is just that
/*
void fn(void); /* declared */
void fn(void)
{
/* code
more code...
*/
}
*/

Posted by Tovmeod 2004-04-20