From 842a23eb0b341f56100ce7dea429eaa306811f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Wed, 4 Jul 2012 09:04:29 +0000 Subject: [PATCH] Boost Jam cleanup - minor stylistic changes. [SVN r79255] --- v2/engine/builtins.c | 37 ++++++++++++++++++------------------- v2/engine/compile.c | 39 ++++++++------------------------------- 2 files changed, 26 insertions(+), 50 deletions(-) diff --git a/v2/engine/builtins.c b/v2/engine/builtins.c index d140829f8..22485ceb1 100644 --- a/v2/engine/builtins.c +++ b/v2/engine/builtins.c @@ -359,7 +359,7 @@ void load_builtins() bind_builtin( "W32_GETREG", builtin_system_registry, 0, args ); } - + { char const * args[] = { "key_path", ":", "result-type", 0 }; bind_builtin( "W32_GETREGNAMES", @@ -476,11 +476,10 @@ LIST * builtin_calc( FRAME * frame, int flags ) LIST * builtin_depends( FRAME * frame, int flags ) { - LIST * targets = lol_get( frame->args, 0 ); - LIST * sources = lol_get( frame->args, 1 ); - LISTITER iter, end; - - iter = list_begin( targets ), end = list_end( targets ); + LIST * const targets = lol_get( frame->args, 0 ); + LIST * const sources = lol_get( frame->args, 1 ); + LISTITER iter = list_begin( targets ); + LISTITER end = list_end( targets ); for ( ; iter != end; iter = list_next( iter ) ) { TARGET * t = bindtarget( list_item( iter ) ); @@ -489,7 +488,6 @@ LIST * builtin_depends( FRAME * frame, int flags ) * if necessary. The internal include TARGET shares the name of its * parent. */ - if ( flags ) { if ( !t->includes ) @@ -508,7 +506,7 @@ LIST * builtin_depends( FRAME * frame, int flags ) end = list_end( sources ); for ( ; iter != end; iter = list_next( iter ) ) { - TARGET * s = bindtarget( list_item( iter ) ); + TARGET * const s = bindtarget( list_item( iter ) ); if ( flags ) { LISTITER t_iter = list_begin( targets ); @@ -1062,11 +1060,11 @@ LIST * builtin_varnames( FRAME * frame, int flags ) LIST * builtin_delete_module( FRAME * frame, int flags ) { - LIST * arg0 = lol_get( frame->args, 0 ); - LIST * result = L0; - module_t * source_module = bindmodule( !list_empty(arg0) ? list_front(arg0) : 0 ); + LIST * const arg0 = lol_get( frame->args, 0 ); + module_t * source_module = bindmodule( list_empty( arg0 ) ? 0 : list_front( + arg0 ) ); delete_module( source_module ); - return result; + return L0; } @@ -1177,18 +1175,19 @@ LIST * builtin_import( FRAME * frame, int flags ) LIST * builtin_export( FRAME * frame, int flags ) { - LIST * module_list = lol_get( frame->args, 0 ); - LIST * rules = lol_get( frame->args, 1 ); - module_t * m = bindmodule( !list_empty( module_list ) ? list_front( module_list ) : 0 ); + LIST * const module_list = lol_get( frame->args, 0 ); + LIST * const rules = lol_get( frame->args, 1 ); + module_t * const m = bindmodule( list_empty( module_list ) ? 0 : list_front( + module_list ) ); - LISTITER iter = list_begin( rules ), end = list_end( rules ); + LISTITER iter = list_begin( rules ); + LISTITER const end = list_end( rules ); for ( ; iter != end; iter = list_next( iter ) ) { RULE * r; - - if ( !m->rules || !(r = (RULE *)hash_find( m->rules, list_item( iter ) ) ) ) + if ( !m->rules || !( r = (RULE *)hash_find( m->rules, list_item( iter ) + ) ) ) unknown_rule( frame, "EXPORT", m, list_item( iter ) ); - r->exported = 1; } return L0; diff --git a/v2/engine/compile.c b/v2/engine/compile.c index 261716b40..3cbe3631f 100644 --- a/v2/engine/compile.c +++ b/v2/engine/compile.c @@ -64,45 +64,25 @@ * builtin_echo() - ECHO rule * builtin_exit() - EXIT rule * builtin_flags() - NOCARE, NOTFILE, TEMPORARY rule - * - * 02/03/94 (seiwald) - Changed trace output to read "setting" instead of - * the awkward sounding "settings". - * 04/12/94 (seiwald) - Combined build_depends() with build_includes(). - * 04/12/94 (seiwald) - actionlist() now just appends a single action. - * 04/13/94 (seiwald) - added shorthand L0 for null list pointer - * 05/13/94 (seiwald) - include files are now bound as targets, and thus - * can make use of $(SEARCH) - * 06/01/94 (seiwald) - new 'actions existing' does existing sources - * 08/23/94 (seiwald) - Support for '+=' (append to variable) - * 12/20/94 (seiwald) - NOTIME renamed NOTFILE. - * 01/22/95 (seiwald) - Exit rule. - * 02/02/95 (seiwald) - Always rule; LEAVES rule. - * 02/14/95 (seiwald) - NoUpdate rule. - * 09/11/00 (seiwald) - new evaluate_rule() for headers(). - * 09/11/00 (seiwald) - compile_xxx() now return LIST *. - * New compile_append() and compile_list() in - * support of building lists here, rather than - * in jamgram.yy. - * 01/10/00 (seiwald) - built-ins split out to builtin.c. */ -static void debug_compile( int which, const char * s, FRAME * frame ); +static void debug_compile( int which, const char * s, FRAME * ); int glob( const char * s, const char * c ); /* Internal functions from builtins.c */ -void backtrace( FRAME * frame ); -void backtrace_line( FRAME * frame ); -void print_source_line( FRAME * frame ); +void backtrace( FRAME * ); +void backtrace_line( FRAME * ); +void print_source_line( FRAME * ); void unknown_rule( FRAME *, char const * key, module_t *, OBJECT * rule_name ); struct frame * frame_before_python_call; static OBJECT * module_scope; -void frame_init( FRAME* frame ) +void frame_init( FRAME * frame ) { frame->prev = 0; frame->prev_user = 0; - lol_init(frame->args); + lol_init( frame->args ); frame->module = root_module(); frame->rulename = "module scope"; frame->file = 0; @@ -120,14 +100,11 @@ void frame_free( FRAME* frame ) * evaluate_rule() - execute a rule invocation. */ -LIST * -evaluate_rule( - OBJECT * rulename, - FRAME * frame ) +LIST * evaluate_rule( OBJECT * rulename, FRAME * frame ) { LIST * result = L0; RULE * rule; - profile_frame prof[1]; + profile_frame prof[ 1 ]; module_t * prev_module = frame->module; rule = bindrule( rulename, frame->module );