Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80113 - trunk/tools/build/v2/engine
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-21 11:43:31


Author: jurko
Date: 2012-08-21 11:43:30 EDT (Tue, 21 Aug 2012)
New Revision: 80113
URL: http://svn.boost.org/trac/boost/changeset/80113

Log:
Boost Jam cleanup - minor stylistic changes.
Text files modified:
   trunk/tools/build/v2/engine/class.c | 24 +++--
   trunk/tools/build/v2/engine/debug.c | 30 +++---
   trunk/tools/build/v2/engine/debug.h | 32 +++---
   trunk/tools/build/v2/engine/function.c | 171 ++++++++++++++++++++-------------------
   trunk/tools/build/v2/engine/modules.c | 8 +
   5 files changed, 140 insertions(+), 125 deletions(-)

Modified: trunk/tools/build/v2/engine/class.c
==============================================================================
--- trunk/tools/build/v2/engine/class.c (original)
+++ trunk/tools/build/v2/engine/class.c 2012-08-21 11:43:30 EDT (Tue, 21 Aug 2012)
@@ -1,12 +1,16 @@
-/* Copyright Vladimir Prus 2003. Distributed under the Boost */
-/* Software License, Version 1.0. (See accompanying */
-/* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */
+/*
+ * Copyright Vladimir Prus 2003.
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ */
 
 #include "class.h"
 
 #include "constants.h"
 #include "frames.h"
 #include "hash.h"
+#include "lists.h"
 #include "object.h"
 #include "rules.h"
 #include "strings.h"
@@ -123,7 +127,6 @@
     module_t * class_module = 0;
     module_t * outer_module = frame->module;
     int found;
- LISTITER iter, end;
 
     if ( !classes )
         classes = hashinit( sizeof( OBJECT * ), "classes" );
@@ -135,7 +138,8 @@
     }
     else
     {
- printf( "Class %s already defined\n", object_str( list_front( xname ) ) );
+ printf( "Class %s already defined\n", object_str( list_front( xname ) )
+ );
         abort();
     }
     check_defined( bases );
@@ -145,10 +149,12 @@
     var_set( class_module, constant_name, xname, VAR_SET );
     var_set( class_module, constant_bases, bases, VAR_SET );
 
- iter = list_begin( bases );
- end = list_end( bases );
- for ( ; iter != end; iter = list_next( iter ) )
- import_base_rules( class_module, list_item( iter ) );
+ {
+ LISTITER iter = list_begin( bases );
+ LISTITER const end = list_end( bases );
+ for ( ; iter != end; iter = list_next( iter ) )
+ import_base_rules( class_module, list_item( iter ) );
+ }
 
     return name;
 }

Modified: trunk/tools/build/v2/engine/debug.c
==============================================================================
--- trunk/tools/build/v2/engine/debug.c (original)
+++ trunk/tools/build/v2/engine/debug.c 2012-08-21 11:43:30 EDT (Tue, 21 Aug 2012)
@@ -1,21 +1,20 @@
 /*
- Copyright Rene Rivera 2005.
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
-*/
+ * Copyright Rene Rivera 2005.
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ */
 
 #include "jam.h"
+#include "debug.h"
 
 #include "hash.h"
 
-#include <time.h>
-#include <assert.h>
-
 
 static profile_frame * profile_stack = 0;
 static struct hash * profile_hash = 0;
-static profile_info profile_other = { 0, 0, 0, 0, 0, 0 };
-static profile_info profile_total = { 0, 0, 0, 0, 0, 0 };
+static profile_info profile_other = { 0 };
+static profile_info profile_total = { 0 };
 
 
 profile_frame * profile_init( OBJECT * rulename, profile_frame * frame )
@@ -42,7 +41,11 @@
             if ( !found )
             {
                 p->name = rulename;
- p->cumulative = p->net = p->num_entries = p->stack_count = p->memory = 0;
+ p->cumulative = 0;
+ p->net = 0;
+ p->num_entries = 0;
+ p->stack_count = 0;
+ p->memory = 0;
             }
         }
         else
@@ -82,8 +85,8 @@
     if ( DEBUG_PROFILE )
     {
         /* Cumulative time for this call. */
- clock_t t = clock() - frame->entry_time - frame->overhead;
- /* If this rule is already present on the stack, don't add the time for
+ clock_t const t = clock() - frame->entry_time - frame->overhead;
+ /* If this rule is already present on the stack, do not add the time for
          * this instance.
          */
         if ( frame->info->stack_count == 1 )
@@ -108,7 +111,8 @@
 static void dump_profile_entry( void * p_, void * ignored )
 {
     profile_info * p = (profile_info *)p_;
- unsigned long mem_each = ( p->memory / ( p->num_entries ? p->num_entries : 1 ) );
+ unsigned long mem_each = ( p->memory / ( p->num_entries ? p->num_entries : 1
+ ) );
     double cumulative = p->cumulative;
     double net = p->net;
     double q = p->net;

Modified: trunk/tools/build/v2/engine/debug.h
==============================================================================
--- trunk/tools/build/v2/engine/debug.h (original)
+++ trunk/tools/build/v2/engine/debug.h 2012-08-21 11:43:30 EDT (Tue, 21 Aug 2012)
@@ -1,17 +1,19 @@
 /*
- Copyright Rene Rivera 2005.
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
-*/
+ * Copyright Rene Rivera 2005.
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ */
+
 #ifndef BJAM_DEBUG_H
 #define BJAM_DEBUG_H
 
 #include "constants.h"
-#include "jam.h"
+#include "object.h"
 #include <time.h>
 
 
-struct profile_info
+typedef struct profile_info
 {
     /* name of rule being called */
     OBJECT * name;
@@ -25,28 +27,26 @@
     unsigned long stack_count;
     /* bytes of memory allocated by the call */
     unsigned long memory;
-};
-typedef struct profile_info profile_info;
+} profile_info;
 
-struct profile_frame
+typedef struct profile_frame
 {
     /* permanent storage where data accumulates */
- profile_info* info;
+ profile_info * info;
     /* overhead for profiling in this call */
     clock_t overhead;
     /* time of last entry to rule */
     clock_t entry_time;
     /* stack frame of caller */
- struct profile_frame* caller;
+ struct profile_frame * caller;
     /* time spent in subrules */
     clock_t subrules;
-};
-typedef struct profile_frame profile_frame;
+} profile_frame;
 
-profile_frame * profile_init( OBJECT * rulename, profile_frame * frame );
-void profile_enter( OBJECT * rulename, profile_frame * frame );
+profile_frame * profile_init( OBJECT * rulename, profile_frame * );
+void profile_enter( OBJECT * rulename, profile_frame * );
 void profile_memory( long mem );
-void profile_exit( profile_frame * frame );
+void profile_exit( profile_frame * );
 void profile_dump();
 
 #define PROFILE_ENTER( scope ) profile_frame PROF_ ## scope, *PROF_ ## scope ## _p = profile_init( constant_ ## scope, &PROF_ ## scope )

Modified: trunk/tools/build/v2/engine/function.c
==============================================================================
--- trunk/tools/build/v2/engine/function.c (original)
+++ trunk/tools/build/v2/engine/function.c 2012-08-21 11:43:30 EDT (Tue, 21 Aug 2012)
@@ -1,7 +1,8 @@
 /*
- * Copyright 2011 Steven Watanabe
- * Distributed under the Boost Software License, Version 1.0.
- * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+ * Copyright 2011 Steven Watanabe
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
  */
 
 #include "jam.h"
@@ -37,83 +38,83 @@
 void backtrace( FRAME * );
 void backtrace_line( FRAME * );
 
-#define INSTR_PUSH_EMPTY 0
-#define INSTR_PUSH_CONSTANT 1
-#define INSTR_PUSH_ARG 2
-#define INSTR_PUSH_VAR 3
-#define INSTR_PUSH_VAR_FIXED 57
-#define INSTR_PUSH_GROUP 4
-#define INSTR_PUSH_RESULT 5
-#define INSTR_PUSH_APPEND 6
-#define INSTR_SWAP 7
-
-#define INSTR_JUMP_EMPTY 8
-#define INSTR_JUMP_NOT_EMPTY 9
-
-#define INSTR_JUMP 10
-#define INSTR_JUMP_LT 11
-#define INSTR_JUMP_LE 12
-#define INSTR_JUMP_GT 13
-#define INSTR_JUMP_GE 14
-#define INSTR_JUMP_EQ 15
-#define INSTR_JUMP_NE 16
-#define INSTR_JUMP_IN 17
-#define INSTR_JUMP_NOT_IN 18
-
-#define INSTR_JUMP_NOT_GLOB 19
-
-#define INSTR_FOR_INIT 56
-#define INSTR_FOR_LOOP 20
-
-#define INSTR_SET_RESULT 21
-#define INSTR_RETURN 22
-#define INSTR_POP 23
-
-#define INSTR_PUSH_LOCAL 24
-#define INSTR_POP_LOCAL 25
-#define INSTR_SET 26
-#define INSTR_APPEND 27
-#define INSTR_DEFAULT 28
-
-#define INSTR_PUSH_LOCAL_FIXED 58
-#define INSTR_POP_LOCAL_FIXED 59
-#define INSTR_SET_FIXED 60
-#define INSTR_APPEND_FIXED 61
-#define INSTR_DEFAULT_FIXED 62
-
-#define INSTR_PUSH_LOCAL_GROUP 29
-#define INSTR_POP_LOCAL_GROUP 30
-#define INSTR_SET_GROUP 31
-#define INSTR_APPEND_GROUP 32
-#define INSTR_DEFAULT_GROUP 33
-
-#define INSTR_PUSH_ON 34
-#define INSTR_POP_ON 35
-#define INSTR_SET_ON 36
-#define INSTR_APPEND_ON 37
-#define INSTR_DEFAULT_ON 38
-
-#define INSTR_CALL_RULE 39
-
-#define INSTR_APPLY_MODIFIERS 40
-#define INSTR_APPLY_INDEX 41
-#define INSTR_APPLY_INDEX_MODIFIERS 42
-#define INSTR_APPLY_MODIFIERS_GROUP 43
-#define INSTR_APPLY_INDEX_GROUP 44
-#define INSTR_APPLY_INDEX_MODIFIERS_GROUP 45
-#define INSTR_COMBINE_STRINGS 46
-
-#define INSTR_INCLUDE 47
-#define INSTR_RULE 48
-#define INSTR_ACTIONS 49
-#define INSTR_PUSH_MODULE 50
-#define INSTR_POP_MODULE 51
-#define INSTR_CLASS 52
-#define INSTR_BIND_MODULE_VARIABLES 63
-
-#define INSTR_APPEND_STRINGS 53
-#define INSTR_WRITE_FILE 54
-#define INSTR_OUTPUT_STRINGS 55
+#define INSTR_PUSH_EMPTY 0
+#define INSTR_PUSH_CONSTANT 1
+#define INSTR_PUSH_ARG 2
+#define INSTR_PUSH_VAR 3
+#define INSTR_PUSH_VAR_FIXED 57
+#define INSTR_PUSH_GROUP 4
+#define INSTR_PUSH_RESULT 5
+#define INSTR_PUSH_APPEND 6
+#define INSTR_SWAP 7
+
+#define INSTR_JUMP_EMPTY 8
+#define INSTR_JUMP_NOT_EMPTY 9
+
+#define INSTR_JUMP 10
+#define INSTR_JUMP_LT 11
+#define INSTR_JUMP_LE 12
+#define INSTR_JUMP_GT 13
+#define INSTR_JUMP_GE 14
+#define INSTR_JUMP_EQ 15
+#define INSTR_JUMP_NE 16
+#define INSTR_JUMP_IN 17
+#define INSTR_JUMP_NOT_IN 18
+
+#define INSTR_JUMP_NOT_GLOB 19
+
+#define INSTR_FOR_INIT 56
+#define INSTR_FOR_LOOP 20
+
+#define INSTR_SET_RESULT 21
+#define INSTR_RETURN 22
+#define INSTR_POP 23
+
+#define INSTR_PUSH_LOCAL 24
+#define INSTR_POP_LOCAL 25
+#define INSTR_SET 26
+#define INSTR_APPEND 27
+#define INSTR_DEFAULT 28
+
+#define INSTR_PUSH_LOCAL_FIXED 58
+#define INSTR_POP_LOCAL_FIXED 59
+#define INSTR_SET_FIXED 60
+#define INSTR_APPEND_FIXED 61
+#define INSTR_DEFAULT_FIXED 62
+
+#define INSTR_PUSH_LOCAL_GROUP 29
+#define INSTR_POP_LOCAL_GROUP 30
+#define INSTR_SET_GROUP 31
+#define INSTR_APPEND_GROUP 32
+#define INSTR_DEFAULT_GROUP 33
+
+#define INSTR_PUSH_ON 34
+#define INSTR_POP_ON 35
+#define INSTR_SET_ON 36
+#define INSTR_APPEND_ON 37
+#define INSTR_DEFAULT_ON 38
+
+#define INSTR_CALL_RULE 39
+
+#define INSTR_APPLY_MODIFIERS 40
+#define INSTR_APPLY_INDEX 41
+#define INSTR_APPLY_INDEX_MODIFIERS 42
+#define INSTR_APPLY_MODIFIERS_GROUP 43
+#define INSTR_APPLY_INDEX_GROUP 44
+#define INSTR_APPLY_INDEX_MODIFIERS_GROUP 45
+#define INSTR_COMBINE_STRINGS 46
+
+#define INSTR_INCLUDE 47
+#define INSTR_RULE 48
+#define INSTR_ACTIONS 49
+#define INSTR_PUSH_MODULE 50
+#define INSTR_POP_MODULE 51
+#define INSTR_CLASS 52
+#define INSTR_BIND_MODULE_VARIABLES 63
+
+#define INSTR_APPEND_STRINGS 53
+#define INSTR_WRITE_FILE 54
+#define INSTR_OUTPUT_STRINGS 55
 
 typedef struct instruction
 {
@@ -138,7 +139,8 @@
 #define FUNCTION_BUILTIN 0
 #define FUNCTION_JAM 1
 
-struct argument {
+struct argument
+{
     int flags;
 #define ARG_ONE 0
 #define ARG_OPTIONAL 1
@@ -150,7 +152,8 @@
     int index;
 };
 
-struct arg_list {
+struct arg_list
+{
     int size;
     struct argument * args;
 };
@@ -198,7 +201,7 @@
     PyObject * python_function;
 } PYTHON_FUNCTION;
 
-static LIST * call_python_function( PYTHON_FUNCTION * function, FRAME * frame );
+static LIST * call_python_function( PYTHON_FUNCTION *, FRAME * );
 
 #endif
 
@@ -275,7 +278,7 @@
 void * stack_get( STACK * s )
 {
     check_alignment( s );
- return (LIST * *)s->data;
+ return s->data;
 }
 
 LIST * frame_get_local( FRAME * frame, int idx )

Modified: trunk/tools/build/v2/engine/modules.c
==============================================================================
--- trunk/tools/build/v2/engine/modules.c (original)
+++ trunk/tools/build/v2/engine/modules.c 2012-08-21 11:43:30 EDT (Tue, 21 Aug 2012)
@@ -1,8 +1,10 @@
 /*
- * Copyright 2001-2004 David Abrahams.
- * Distributed under the Boost Software License, Version 1.0.
- * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+ * Copyright 2001-2004 David Abrahams.
+ * Distributed under the Boost Software License, Version 1.0.
+ * (See accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
  */
+
 #include "jam.h"
 #include "modules.h"
 


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