|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79673 - trunk/tools/build/v2/engine
From: jurko.gospodnetic_at_[hidden]
Date: 2012-07-22 11:43:05
Author: jurko
Date: 2012-07-22 11:43:04 EDT (Sun, 22 Jul 2012)
New Revision: 79673
URL: http://svn.boost.org/trac/boost/changeset/79673
Log:
Boost Jam cleanup - minor stylistic changes.
Text files modified:
trunk/tools/build/v2/engine/builtins.c | 2 +-
trunk/tools/build/v2/engine/compile.c | 19 +------------------
trunk/tools/build/v2/engine/function.c | 35 ++++++++++++++++-------------------
trunk/tools/build/v2/engine/hdrmacro.c | 4 ++--
4 files changed, 20 insertions(+), 40 deletions(-)
Modified: trunk/tools/build/v2/engine/builtins.c
==============================================================================
--- trunk/tools/build/v2/engine/builtins.c (original)
+++ trunk/tools/build/v2/engine/builtins.c 2012-07-22 11:43:04 EDT (Sun, 22 Jul 2012)
@@ -19,9 +19,9 @@
#include "native.h"
#include "object.h"
#include "parse.h"
-#include "rules.h"
#include "pathsys.h"
#include "pwd.h"
+#include "rules.h"
#include "strings.h"
#include "subst.h"
#include "timestamp.h"
Modified: trunk/tools/build/v2/engine/compile.c
==============================================================================
--- trunk/tools/build/v2/engine/compile.c (original)
+++ trunk/tools/build/v2/engine/compile.c 2012-07-22 11:43:04 EDT (Sun, 22 Jul 2012)
@@ -14,27 +14,10 @@
* compile.c - compile parsed jam statements
*
* External routines:
- * compile_append() - append list results of two statements
- * compile_eval() - evaluate if to determine which leg to compile
- * compile_foreach() - compile the "for x in y" statement
- * compile_if() - compile 'if' rule
- * compile_while() - compile 'while' rule
- * compile_include() - support for 'include' - call include() on file
- * compile_list() - expand and return a list
- * compile_local() - declare (and set) local variables
- * compile_null() - do nothing -- a stub for parsing
- * compile_on() - run rule under influence of on-target variables
- * compile_rule() - compile a single user defined rule
- * compile_rules() - compile a chain of rules
- * compile_set() - compile the "set variable" statement
- * compile_setcomp() - support for `rule` - save parse tree
- * compile_setexec() - support for `actions` - save execution string
- * compile_settings() - compile the "on =" (set variable on exec) statement
- * compile_switch() - compile 'switch' rule
+ * evaluate_rule() - execute a rule invocation
*
* Internal routines:
* debug_compile() - printf with indent to show rule expansion
- * evaluate_rule() - execute a rule invocation
*/
#include "jam.h"
Modified: trunk/tools/build/v2/engine/function.c
==============================================================================
--- trunk/tools/build/v2/engine/function.c (original)
+++ trunk/tools/build/v2/engine/function.c 2012-07-22 11:43:04 EDT (Sun, 22 Jul 2012)
@@ -34,8 +34,8 @@
#endif
int glob( char const * s, char const * c );
-void backtrace( FRAME * frame );
-void backtrace_line( FRAME * frame );
+void backtrace( FRAME * );
+void backtrace_line( FRAME * );
#define INSTR_PUSH_EMPTY 0
#define INSTR_PUSH_CONSTANT 1
@@ -1280,7 +1280,7 @@
static JAM_FUNCTION * compile_to_function( compiler * c )
{
- JAM_FUNCTION * result = BJAM_MALLOC( sizeof(JAM_FUNCTION) );
+ JAM_FUNCTION * const result = BJAM_MALLOC( sizeof( JAM_FUNCTION ) );
int i;
result->base.type = FUNCTION_JAM;
result->base.reference_count = 1;
@@ -1290,16 +1290,16 @@
result->base.rulename = 0;
result->code_size = c->code->size;
- result->code = BJAM_MALLOC( c->code->size * sizeof(instruction) );
- memcpy( result->code, c->code->data, c->code->size * sizeof(instruction) );
+ result->code = BJAM_MALLOC( c->code->size * sizeof( instruction ) );
+ memcpy( result->code, c->code->data, c->code->size * sizeof( instruction ) );
- result->constants = BJAM_MALLOC( c->constants->size * sizeof(OBJECT *) );
+ result->constants = BJAM_MALLOC( c->constants->size * sizeof( OBJECT * ) );
memcpy( result->constants, c->constants->data, c->constants->size * sizeof(
- OBJECT *) );
+ OBJECT * ) );
result->num_constants = c->constants->size;
result->num_subfunctions = c->rules->size;
- result->functions = BJAM_MALLOC( c->rules->size * sizeof(SUBFUNCTION) );
+ result->functions = BJAM_MALLOC( c->rules->size * sizeof( SUBFUNCTION ) );
for ( i = 0; i < c->rules->size; ++i )
{
struct stored_rule * const rule = &dynamic_array_at( struct stored_rule,
@@ -1311,9 +1311,9 @@
result->functions[ i ].local = rule->local;
}
- result->actions = BJAM_MALLOC( c->actions->size * sizeof(SUBACTION) );
+ result->actions = BJAM_MALLOC( c->actions->size * sizeof( SUBACTION ) );
memcpy( result->actions, c->actions->data, c->actions->size * sizeof(
- SUBACTION) );
+ SUBACTION ) );
result->num_subactions = c->actions->size;
result->generic = 0;
@@ -2508,7 +2508,7 @@
adjust_result( c, RESULT_STACK, result_location );
}
- else if ( parse->type == PARSE_SWITCH )
+ else if ( parse->type == PARSE_SWITCH )
{
int const switch_end = compile_new_label( c );
compile_parse( parse->left, c, RESULT_STACK );
@@ -3369,7 +3369,8 @@
static char check_ptr_size1[ sizeof(LIST *) <= sizeof(void *) ? 1 : -1 ];
static char check_ptr_size2[ sizeof(char *) <= sizeof(void *) ? 1 : -1 ];
-void function_run_actions( FUNCTION * function, FRAME * frame, STACK * s, string * out )
+void function_run_actions( FUNCTION * function, FRAME * frame, STACK * s,
+ string * out )
{
*(string * *)stack_allocate( s, sizeof( string * ) ) = out;
list_free( function_run( function, frame, s ) );
@@ -3377,9 +3378,8 @@
}
/*
- * WARNING: The instruction set is tuned for Jam and
- * is not really generic. Be especially careful about
- * stack push/pop.
+ * WARNING: The instruction set is tuned for Jam and is not really generic. Be
+ * especially careful about stack push/pop.
*/
LIST * function_run( FUNCTION * function_, FRAME * frame, STACK * s )
@@ -3393,7 +3393,7 @@
if ( function_->type == FUNCTION_BUILTIN )
{
- BUILTIN_FUNCTION * f = (BUILTIN_FUNCTION *)function_;
+ BUILTIN_FUNCTION const * const f = (BUILTIN_FUNCTION *)function_;
if ( function_->formal_arguments )
argument_list_check( function_->formal_arguments,
function_->num_formal_arguments, function_, frame );
@@ -3401,13 +3401,11 @@
}
#ifdef HAVE_PYTHON
-
else if ( function_->type == FUNCTION_PYTHON )
{
PYTHON_FUNCTION * f = (PYTHON_FUNCTION *)function_;
return call_python_function( f, frame );
}
-
#endif
assert( function_->type == FUNCTION_JAM );
@@ -3636,7 +3634,6 @@
argument_list_pop( function_->formal_arguments,
function_->num_formal_arguments, frame, s );
#ifndef NDEBUG
-
if ( !( saved_stack == s->data ) )
{
frame->file = function->file;
Modified: trunk/tools/build/v2/engine/hdrmacro.c
==============================================================================
--- trunk/tools/build/v2/engine/hdrmacro.c (original)
+++ trunk/tools/build/v2/engine/hdrmacro.c 2012-07-22 11:43:04 EDT (Sun, 22 Jul 2012)
@@ -14,8 +14,8 @@
* hdrmacro.c - handle header files that define macros used in #include
* statements.
*
- * we look for lines like "#define MACRO <....>" or '#define MACRO " "'
- * in the target file. When found, we then phony up a rule invocation like:
+ * we look for lines like "#define MACRO <....>" or '#define MACRO " "' in
+ * the target file. When found, we then phony up a rule invocation like:
*
* $(HDRRULE) <target> : <resolved included files> ;
*
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk