Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77522 - in trunk/tools/build/v2/engine: . modules
From: steven_at_[hidden]
Date: 2012-03-24 19:03:13


Author: steven_watanabe
Date: 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
New Revision: 77522
URL: http://svn.boost.org/trac/boost/changeset/77522

Log:
Make list_new take one argument. Rename the two argument form to list_push_back.
Text files modified:
   trunk/tools/build/v2/engine/builtins.c | 66 ++++++++++++++++++++--------------------
   trunk/tools/build/v2/engine/filent.c | 4 +-
   trunk/tools/build/v2/engine/filesys.c | 2
   trunk/tools/build/v2/engine/fileunix.c | 2
   trunk/tools/build/v2/engine/function.c | 28 ++++++++--------
   trunk/tools/build/v2/engine/hcache.c | 4 +-
   trunk/tools/build/v2/engine/headers.c | 8 ++--
   trunk/tools/build/v2/engine/jam.c | 16 ++++----
   trunk/tools/build/v2/engine/lists.c | 28 ++++++++++++++--
   trunk/tools/build/v2/engine/lists.h | 3 +
   trunk/tools/build/v2/engine/make.c | 2
   trunk/tools/build/v2/engine/make1.c | 16 ++++----
   trunk/tools/build/v2/engine/modules.c | 2
   trunk/tools/build/v2/engine/modules/order.c | 2
   trunk/tools/build/v2/engine/modules/path.c | 2
   trunk/tools/build/v2/engine/modules/property-set.c | 4 +-
   trunk/tools/build/v2/engine/modules/regex.c | 2
   trunk/tools/build/v2/engine/modules/sequence.c | 2
   trunk/tools/build/v2/engine/modules/set.c | 2
   trunk/tools/build/v2/engine/pwd.c | 2
   trunk/tools/build/v2/engine/search.c | 4 +-
   trunk/tools/build/v2/engine/subst.c | 2
   trunk/tools/build/v2/engine/variable.c | 16 ++++----
   trunk/tools/build/v2/engine/w32_getreg.c | 12 +++---
   24 files changed, 126 insertions(+), 105 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-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -463,7 +463,7 @@
     }
 
     sprintf( buffer, "%ld", result_value );
- result = list_new( result, object_new( buffer ) );
+ result = list_push_back( result, object_new( buffer ) );
     return result;
 }
 
@@ -660,7 +660,7 @@
     {
         if ( !glob( object_str( list_item( iter ) ), buf->value ) )
         {
- globbing->results = list_new( globbing->results, object_copy( file ) );
+ globbing->results = list_push_back( globbing->results, object_copy( file ) );
             break;
         }
     }
@@ -683,7 +683,7 @@
     {
         string_append( s, object_str( list_item( iter ) ) );
         downcase_inplace( s->value );
- result = list_append( result, list_new( L0, object_new( s->value ) ) );
+ result = list_push_back( result, object_new( s->value ) );
         string_truncate( s, 0 );
     }
 
@@ -740,14 +740,14 @@
     time_t time;
     timestamp( file, &time );
     return time > 0
- ? list_new( list, object_copy( file ) )
+ ? list_push_back( list, object_copy( file ) )
         : list;
 }
 
 
 LIST * glob1( OBJECT * dirname, OBJECT * pattern )
 {
- LIST * plist = list_new( L0, object_copy(pattern) );
+ LIST * plist = list_new( object_copy(pattern) );
     struct globbing globbing;
 
     globbing.results = L0;
@@ -811,7 +811,7 @@
 
             dirs = has_wildcards( dirname->value )
                 ? glob_recursive( dirname->value )
- : list_new( dirs, object_new( dirname->value ) );
+ : list_push_back( dirs, object_new( dirname->value ) );
 
             if ( has_wildcards( basename->value ) )
             {
@@ -920,7 +920,7 @@
                 for ( i = 1; i <= top; ++i )
                 {
                     string_append_range( buf, re->startp[ i ], re->endp[ i ] );
- result = list_new( result, object_new( buf->value ) );
+ result = list_push_back( result, object_new( buf->value ) );
                     string_truncate( buf, 0 );
                 }
             }
@@ -948,7 +948,7 @@
     t = strtok( buf->value, delimiters) ;
     while ( t )
     {
- result = list_new( result, object_new( t ) );
+ result = list_push_back( result, object_new( t ) );
         t = strtok( NULL, delimiters );
     }
 
@@ -990,7 +990,7 @@
     RULE * r = (RULE *)r_;
     LIST * * result = (LIST * *)result_;
     if ( r->exported )
- *result = list_new( *result, object_copy( r->name ) );
+ *result = list_push_back( *result, object_copy( r->name ) );
 }
 
 
@@ -1019,7 +1019,7 @@
 static void add_hash_key( void * np, void * result_ )
 {
     LIST * * result = (LIST * *)result_;
- *result = list_new( *result, object_copy( *(OBJECT * *)np ) );
+ *result = list_push_back( *result, object_copy( *(OBJECT * *)np ) );
 }
 
 
@@ -1272,10 +1272,10 @@
             string_append( module_name, object_str( frame->module->name ) );
             string_append( module_name, "." );
         }
- result = list_new( result, object_new( file ) );
- result = list_new( result, object_new( buf ) );
- result = list_new( result, object_new( module_name->value ) );
- result = list_new( result, object_new( frame->rulename ) );
+ result = list_push_back( result, object_new( file ) );
+ result = list_push_back( result, object_new( buf ) );
+ result = list_push_back( result, object_new( module_name->value ) );
+ result = list_push_back( result, object_new( frame->rulename ) );
         string_free( module_name );
     }
     return result;
@@ -1306,7 +1306,7 @@
     if ( frame->module == root_module() )
         return L0;
     else
- return list_new( L0, object_copy( frame->module->name ) );
+ return list_new( object_copy( frame->module->name ) );
 }
 
 
@@ -1412,7 +1412,7 @@
     last_update_now_status = status;
         
     if ( status == 0 )
- return list_new( L0, object_copy( constant_ok ) );
+ return list_new( object_copy( constant_ok ) );
     else
         return L0;
 }
@@ -1578,7 +1578,7 @@
     string_free( out );
     string_free( in );
 
- return list_new( L0, result );
+ return list_new( result );
 }
 
 
@@ -1619,7 +1619,7 @@
     {
         int expected_version = atoi( object_str( list_front( version ) ) );
         if ( np->version == expected_version )
- return list_new( L0, object_copy( constant_true ) );
+ return list_new( object_copy( constant_true ) );
     }
     return L0;
 }
@@ -1653,8 +1653,8 @@
 
         get_source_line( nearest_user_frame, &file, &line );
         sprintf( buf, "%d", line );
- result = list_new( result, object_new( file ) );
- result = list_new( result, object_new( buf ) );
+ result = list_push_back( result, object_new( file ) );
+ result = list_push_back( result, object_new( buf ) );
         return result;
     }
 }
@@ -1664,7 +1664,7 @@
 {
     LIST * name = lol_get( frame->args, 0 );
     return file_is_file( list_front( name ) ) == 1
- ? list_new( L0, object_copy( constant_true ) )
+ ? list_new( object_copy( constant_true ) )
         : L0 ;
 }
 
@@ -1687,7 +1687,7 @@
     for (di = 0; di < 16; ++di)
         sprintf( hex_output + di * 2, "%02x", digest[di] );
 
- return list_new( L0, object_new( hex_output ) );
+ return list_new( object_new( hex_output ) );
 }
 
 LIST *builtin_file_open( FRAME * frame, int flags )
@@ -1709,7 +1709,7 @@
     if (fd != -1)
     {
         sprintf( buffer, "%d", fd );
- return list_new( L0, object_new( buffer ) );
+ return list_new( object_new( buffer ) );
     }
     else
     {
@@ -1725,7 +1725,7 @@
     int current = strlen( object_str( string ) );
     int desired = atoi( width_s );
     if (current >= desired)
- return list_new (L0, object_copy( string ) );
+ return list_new( object_copy( string ) );
     else
     {
         char * buffer = BJAM_MALLOC( desired + 1 );
@@ -1736,7 +1736,7 @@
         for ( i = current; i < desired; ++i )
             buffer[i] = ' ';
         buffer[desired] = '\0';
- result = list_new( L0, object_new( buffer ) );
+ result = list_new( object_new( buffer ) );
         BJAM_FREE( buffer );
         return result;
     }
@@ -1762,7 +1762,7 @@
     char * p = executable_path( saved_argv0 );
     if ( p )
     {
- LIST* result = list_new( L0, object_new( p ) );
+ LIST* result = list_new( object_new( p ) );
         free( p );
         return result;
     }
@@ -1778,7 +1778,7 @@
 
     if ( file_mkdir( object_str( list_front( path ) ) ) == 0 )
     {
- LIST * result = list_new ( L0, object_copy( list_front( path ) ) );
+ LIST * result = list_new( object_copy( list_front( path ) ) );
         return result;
     }
     else
@@ -1875,7 +1875,7 @@
         }
         else
         {
- l = list_new( l, object_new( *elements ) );
+ l = list_push_back( l, object_new( *elements ) );
         }
         ++elements;
     }
@@ -1918,7 +1918,7 @@
             PyObject * a = PyTuple_GetItem( args, i );
             if ( PyString_Check( a ) )
             {
- lol_add( inner->args, list_new( 0, object_new(
+ lol_add( inner->args, list_new( object_new(
                     PyString_AsString( a ) ) ) );
             }
             else if ( PySequence_Check( a ) )
@@ -1936,7 +1936,7 @@
                         printf( "Invalid parameter type passed from Python\n" );
                         exit( 1 );
                     }
- l = list_new( l, object_new( s ) );
+ l = list_push_back( l, object_new( s ) );
                     Py_DECREF( e );
                 }
                 lol_add( inner->args, l );
@@ -2048,7 +2048,7 @@
                             "bind list has non-string type" );
             return NULL;
         }
- bindlist = list_new( bindlist, object_new( PyString_AsString( next ) ) );
+ bindlist = list_push_back( bindlist, object_new( PyString_AsString( next ) ) );
     }
 
     name_str = object_new( name );
@@ -2285,7 +2285,7 @@
     exit_status = pclose( p );
 
     /* The command output is returned first. */
- result = list_new( L0, object_new( s.value ) );
+ result = list_new( object_new( s.value ) );
     string_free( &s );
 
     /* The command exit result next. */
@@ -2296,7 +2296,7 @@
         else
             exit_status = -1;
         sprintf( buffer, "%d", exit_status );
- result = list_new( result, object_new( buffer ) );
+ result = list_push_back( result, object_new( buffer ) );
     }
 
     return result;

Modified: trunk/tools/build/v2/engine/filent.c
==============================================================================
--- trunk/tools/build/v2/engine/filent.c (original)
+++ trunk/tools/build/v2/engine/filent.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -136,7 +136,7 @@
             string_truncate( filename, 0 );
             path_build( &f, filename );
 
- files = list_new( files, object_new(filename->value) );
+ files = list_push_back( files, object_new(filename->value) );
             ff = file_info( filename->value );
             ff->is_file = finfo->ff_attrib & FA_DIREC ? 0 : 1;
             ff->is_dir = finfo->ff_attrib & FA_DIREC ? 1 : 0;
@@ -170,7 +170,7 @@
 
             filename_obj = object_new( filename->value );
             path_add_key( filename_obj );
- files = list_new( files, filename_obj );
+ files = list_push_back( files, filename_obj );
             ff = file_info( filename_obj );
             ff->is_file = finfo->attrib & _A_SUBDIR ? 0 : 1;
             ff->is_dir = finfo->attrib & _A_SUBDIR ? 1 : 0;

Modified: trunk/tools/build/v2/engine/filesys.c
==============================================================================
--- trunk/tools/build/v2/engine/filesys.c (original)
+++ trunk/tools/build/v2/engine/filesys.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -95,5 +95,5 @@
 
 void file_remove_atexit( OBJECT * path )
 {
- files_to_remove = list_new( files_to_remove, object_copy( path ) );
+ files_to_remove = list_push_back( files_to_remove, object_copy( path ) );
 }

Modified: trunk/tools/build/v2/engine/fileunix.c
==============================================================================
--- trunk/tools/build/v2/engine/fileunix.c (original)
+++ trunk/tools/build/v2/engine/fileunix.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -184,7 +184,7 @@
             path_build( &f, filename, 0 );
 
             filename_obj = object_new( filename->value );
- files = list_new( files, filename_obj );
+ files = list_push_back( files, filename_obj );
             file_query( filename_obj );
         }
         string_free( filename );

Modified: trunk/tools/build/v2/engine/function.c
==============================================================================
--- trunk/tools/build/v2/engine/function.c (original)
+++ trunk/tools/build/v2/engine/function.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -795,7 +795,7 @@
         get_iters( subscript, &iter, &end, length );
         for ( ; iter != end; iter = list_next( iter ) )
         {
- result = list_new( result, object_copy( list_item( iter ) ) );
+ result = list_push_back( result, object_copy( list_item( iter ) ) );
         }
     }
     string_free( buf );
@@ -868,7 +868,7 @@
             /** FIXME: is empty.ptr always null-terminated? */
             var_edit_file( edits[i].empty.ptr, buf, edits + i );
             var_edit_shift( buf, 0, edits + i );
- result = list_new( result, object_new( buf->value ) );
+ result = list_push_back( result, object_new( buf->value ) );
             string_truncate( buf, 0 );
         }
     }
@@ -893,7 +893,7 @@
                 var_edit_file( object_str( list_item( iter ) ), buf, edits + i );
                 var_edit_shift( buf, size, edits + i );
             }
- result = list_new( result, object_new( buf->value ) );
+ result = list_push_back( result, object_new( buf->value ) );
             string_truncate( buf, 0 );
         }
         else
@@ -902,7 +902,7 @@
             {
                 var_edit_file( object_str( list_item( iter ) ), buf, edits + i );
                 var_edit_shift( buf, 0, edits + i );
- result = list_new( result, object_new( buf->value ) );
+ result = list_push_back( result, object_new( buf->value ) );
                 string_truncate( buf, 0 );
             }
         }
@@ -980,7 +980,7 @@
             elem[i].size = buf->size;
             string_append( buf, object_str( list_item( elem[i].elem ) ) );
         }
- result = list_new( result, object_new( buf->value ) );
+ result = list_push_back( result, object_new( buf->value ) );
         while ( --i >= 0 )
         {
             if( list_next( elem[i].elem ) != list_end( elem[i].saved ) )
@@ -2664,7 +2664,7 @@
         frame->prev_user = caller->module->user_module ? caller : caller->prev_user;
 
         /* Prepare the argument list */
- lol_add( frame->args, list_new( L0, object_copy( list_item( iter ) ) ) );
+ lol_add( frame->args, list_new( object_copy( list_item( iter ) ) ) );
         error = evaluate_rule( type_name, frame );
 
         if ( !list_empty( error ) )
@@ -2782,7 +2782,7 @@
             case ARG_ONE:
                 if ( actual_iter == actual_end )
                     argument_error( "missing argument", function, frame, formal_arg->arg_name );
- value = list_new( L0, object_copy( list_item( actual_iter ) ) );
+ value = list_new( object_copy( list_item( actual_iter ) ) );
                 actual_iter = list_next( actual_iter );
                 break;
             case ARG_OPTIONAL:
@@ -2790,7 +2790,7 @@
                     value = L0;
                 else
                 {
- value = list_new( L0, object_copy( list_item( actual_iter ) ) );
+ value = list_new( object_copy( list_item( actual_iter ) ) );
                     actual_iter = list_next( actual_iter );
                 }
                 break;
@@ -3413,7 +3413,7 @@
         case INSTR_PUSH_CONSTANT:
         {
             OBJECT * value = function_get_constant( function, code->arg );
- stack_push( s, list_new( L0, object_copy( value ) ) );
+ stack_push( s, list_new( object_copy( value ) ) );
             break;
         }
 
@@ -3602,7 +3602,7 @@
             }
             else
             {
- r = list_new( L0, object_copy( list_item( iter ) ) );
+ r = list_new( object_copy( list_item( iter ) ) );
                 iter = list_next( iter );
                 *(LISTITER *)stack_allocate( s, sizeof( LISTITER ) ) = iter;
                 stack_push( s, r );
@@ -4170,7 +4170,7 @@
             string buf[1];
             string_new( buf );
             combine_strings( s, code->arg, buf );
- stack_push( s, list_new( L0, object_new( buf->value ) ) );
+ stack_push( s, list_new( object_new( buf->value ) ) );
             string_free( buf );
             break;
         }
@@ -4209,7 +4209,7 @@
 
                 /* Replace STDXXX with the temporary file. */
                 list_free( stack_pop( s ) );
- stack_push( s, list_new( L0, object_new( result->value ) ) );
+ stack_push( s, list_new( object_new( result->value ) ) );
                 out = object_str( tmp_filename );
 
                 string_free( result );
@@ -4498,7 +4498,7 @@
                 if ( !s ) {
                     fprintf( stderr, "Non-string object returned by Python call.\n" );
                 } else {
- result = list_new( result, s );
+ result = list_push_back( result, s );
                 }
             }
         }
@@ -4510,7 +4510,7 @@
         {
             OBJECT *s = python_to_string( py_result );
             if (s)
- result = list_new( L0, s );
+ result = list_new( s );
             else
                 /* We have tried all we could. Return empty list. There are
                    cases, e.g. feature.feature function that should return

Modified: trunk/tools/build/v2/engine/hcache.c
==============================================================================
--- trunk/tools/build/v2/engine/hcache.c (original)
+++ trunk/tools/build/v2/engine/hcache.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -248,7 +248,7 @@
                 fprintf( stderr, "invalid %s\n", hcachename );
                 goto bail;
             }
- l = list_new( l, s );
+ l = list_push_back( l, s );
         }
         cachedata.includes = l;
 
@@ -269,7 +269,7 @@
                 fprintf( stderr, "invalid %s\n", hcachename );
                 goto bail;
             }
- l = list_new( l, s );
+ l = list_push_back( l, s );
         }
         cachedata.hdrscan = l;
 

Modified: trunk/tools/build/v2/engine/headers.c
==============================================================================
--- trunk/tools/build/v2/engine/headers.c (original)
+++ trunk/tools/build/v2/engine/headers.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -91,7 +91,7 @@
     {
         FRAME frame[1];
         frame_init( frame );
- lol_add( frame->args, list_new( L0, object_copy( t->name ) ) );
+ lol_add( frame->args, list_new( object_copy( t->name ) ) );
 #ifdef OPT_HEADER_CACHE_EXT
         lol_add( frame->args, hcache( t, rec, re, hdrscan ) );
 #else
@@ -102,7 +102,7 @@
         {
             /* The third argument to HDRRULE is the bound name of
              * $(<) */
- lol_add( frame->args, list_new( L0, object_copy( t->boundname ) ) );
+ lol_add( frame->args, list_new( object_copy( t->boundname ) ) );
 
             list_free( evaluate_rule( list_front( hdrrule ), frame ) );
         }
@@ -173,7 +173,7 @@
                 if ( DEBUG_HEADER )
                     printf( "header found: %s\n", re[i]->startp[1] );
 
- l = list_new( l, object_new( re[i]->startp[1] ) );
+ l = list_push_back( l, object_new( re[i]->startp[1] ) );
             }
 
         /* special treatment for #include MACRO */
@@ -194,7 +194,7 @@
             {
                 if ( DEBUG_HEADER )
                     printf( " resolved to '%s'\n", object_str( header_filename ) );
- l = list_new( l, object_copy( header_filename ) );
+ l = list_push_back( l, object_copy( header_filename ) );
             }
             else
             {

Modified: trunk/tools/build/v2/engine/jam.c
==============================================================================
--- trunk/tools/build/v2/engine/jam.c (original)
+++ trunk/tools/build/v2/engine/jam.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -434,11 +434,11 @@
 #endif
 
         /* Set JAMDATE. */
- var_set( root_module(), constant_JAMDATE, list_new( L0, outf_time(time(0)) ), VAR_SET );
+ var_set( root_module(), constant_JAMDATE, list_new( outf_time(time(0)) ), VAR_SET );
 
         /* Set JAM_VERSION. */
         var_set( root_module(), constant_JAM_VERSION,
- list_new( list_new( list_new( L0,
+ list_push_back( list_push_back( list_new(
                    object_new( VERSION_MAJOR_SYM ) ),
                    object_new( VERSION_MINOR_SYM ) ),
                    object_new( VERSION_PATCH_SYM ) ),
@@ -452,11 +452,11 @@
             if ( uname( &u ) >= 0 )
             {
                 var_set( root_module(), constant_JAMUNAME,
- list_new(
- list_new(
- list_new(
- list_new(
- list_new( L0,
+ list_push_back(
+ list_push_back(
+ list_push_back(
+ list_push_back(
+ list_new(
                                             object_new( u.sysname ) ),
                                          object_new( u.nodename ) ),
                                      object_new( u.release ) ),
@@ -498,7 +498,7 @@
          */
         for ( n = 0; n < arg_c; ++n )
         {
- var_set( root_module(), constant_ARGV, list_new( L0, object_new( arg_v[n] ) ), VAR_APPEND );
+ var_set( root_module(), constant_ARGV, list_new( object_new( arg_v[n] ) ), VAR_APPEND );
         }
 
         /* Initialize built-in rules. */

Modified: trunk/tools/build/v2/engine/lists.c
==============================================================================
--- trunk/tools/build/v2/engine/lists.c (original)
+++ trunk/tools/build/v2/engine/lists.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -122,11 +122,31 @@
         return 0;
 }
 
+LIST * list_new( OBJECT * value )
+{
+ LIST * head;
+ if ( freelist[ 0 ] )
+ {
+ struct freelist_node * result = freelist[ 0 ];
+ freelist[ 0 ] = result->next;
+ head = (LIST *)result;
+ }
+ else
+ {
+ head = BJAM_MALLOC( sizeof( LIST * ) + sizeof( OBJECT * ) );
+ }
+
+ head->impl.size = 1;
+ list_begin( head )[ 0 ] = value;
+
+ return head;
+}
+
 /*
- * list_new() - tack a string onto the end of a list of strings
+ * list_push_back() - tack a string onto the end of a list of strings
  */
 
-LIST * list_new( LIST * head, OBJECT * value )
+LIST * list_push_back( LIST * head, OBJECT * value )
 {
     unsigned int size = list_length( head );
     unsigned int i;
@@ -385,7 +405,7 @@
     {
         if ( !last_added || !object_equal( list_item( iter ), last_added ) )
         {
- result = list_new( result, object_copy( list_item( iter ) ) );
+ result = list_push_back( result, object_copy( list_item( iter ) ) );
             last_added = list_item( iter );
         }
     }
@@ -496,7 +516,7 @@
     for (i = 0; i < n; ++i)
     {
         PyObject *v = PySequence_GetItem(l, i);
- result = list_new (result, object_new (PyString_AsString(v)));
+ result = list_push_back(result, object_new (PyString_AsString(v)));
         Py_DECREF(v);
     }
 

Modified: trunk/tools/build/v2/engine/lists.h
==============================================================================
--- trunk/tools/build/v2/engine/lists.h (original)
+++ trunk/tools/build/v2/engine/lists.h 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -79,11 +79,12 @@
     LIST *list[ LOL_MAX ];
 };
 
+LIST * list_new( OBJECT * value );
 LIST * list_append( LIST *l, LIST *nl );
 LIST * list_copy( LIST *l );
 LIST * list_copy_range( LIST *l, LISTITER first, LISTITER last );
 void list_free( LIST *head );
-LIST * list_new( LIST *head, OBJECT *string );
+LIST * list_push_back( LIST *head, OBJECT *string );
 void list_print( LIST *l );
 int list_length( LIST *l );
 LIST * list_sublist( LIST *l, int start, int count );

Modified: trunk/tools/build/v2/engine/make.c
==============================================================================
--- trunk/tools/build/v2/engine/make.c (original)
+++ trunk/tools/build/v2/engine/make.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -802,7 +802,7 @@
 
 void mark_target_for_updating( OBJECT * target )
 {
- targets_to_update_ = list_new( targets_to_update_, object_copy( target ) );
+ targets_to_update_ = list_push_back( targets_to_update_, object_copy( target ) );
 }
 
 

Modified: trunk/tools/build/v2/engine/make1.c
==============================================================================
--- trunk/tools/build/v2/engine/make1.c (original)
+++ trunk/tools/build/v2/engine/make1.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -708,10 +708,10 @@
         lol_add( frame->args, list_copy_range( timing_rule, list_next( list_begin( timing_rule ) ), list_end( timing_rule ) ) );
 
         /* target :: the name of the target */
- lol_add( frame->args, list_new( L0, object_copy( target->name ) ) );
+ lol_add( frame->args, list_new( object_copy( target->name ) ) );
 
         /* start end user system :: info about the action command */
- lol_add( frame->args, list_new( list_new( list_new( list_new( L0,
+ lol_add( frame->args, list_push_back( list_push_back( list_push_back( list_new(
             outf_time ( time->start ) ),
             outf_time ( time->end ) ),
             outf_double( time->user ) ),
@@ -763,11 +763,11 @@
         lol_add( frame->args, list_copy_range( action_rule, list_next( list_begin( action_rule ) ), list_end( action_rule ) ) );
 
         /* target :: the name of the target */
- lol_add( frame->args, list_new( L0, object_copy( target->name ) ) );
+ lol_add( frame->args, list_new( object_copy( target->name ) ) );
 
         /* command status start end user system :: info about the action command */
         lol_add( frame->args,
- list_new( list_new( list_new( list_new( list_new( list_new( L0,
+ list_push_back( list_push_back( list_push_back( list_push_back( list_push_back( list_new(
                 object_new( executed_command ) ),
                 outf_int( status ) ),
                 outf_time( time->start ) ),
@@ -777,7 +777,7 @@
 
         /* output ? :: the output of the action command */
         if ( command_output )
- lol_add( frame->args, list_new( L0, object_new( command_output ) ) );
+ lol_add( frame->args, list_new( object_new( command_output ) ) );
         else
             lol_add( frame->args, L0 );
 
@@ -1046,7 +1046,7 @@
                 /* Tell the user what didn't fit. */
                 cmd = cmd_new( rule, list_copy( nt ),
                     list_sublist( ns, start, chunk ),
- list_new( L0, object_copy( constant_percent ) ) );
+ list_new( object_copy( constant_percent ) ) );
                 fputs( cmd->buf->value, stdout );
                 exit( EXITBAD );
             }
@@ -1108,7 +1108,7 @@
         }
 
         /* Build new list. */
- l = list_new( l, object_copy( t->boundname ) );
+ l = list_push_back( l, object_copy( t->boundname ) );
     }
 
     return l;
@@ -1139,7 +1139,7 @@
                 make1bind( t );
 
             /* Build a new list. */
- nl = list_new( nl, object_copy( t->boundname ) );
+ nl = list_push_back( nl, object_copy( t->boundname ) );
         }
 
         /* Add to settings chain. */

Modified: trunk/tools/build/v2/engine/modules.c
==============================================================================
--- trunk/tools/build/v2/engine/modules.c (original)
+++ trunk/tools/build/v2/engine/modules.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -193,7 +193,7 @@
     OBJECT * * r = (OBJECT * *)r_;
     LIST * * result = (LIST * *)result_;
 
- *result = list_new( *result, object_copy( *r ) );
+ *result = list_push_back( *result, object_copy( *r ) );
 }
 
 

Modified: trunk/tools/build/v2/engine/modules/order.c
==============================================================================
--- trunk/tools/build/v2/engine/modules/order.c (original)
+++ trunk/tools/build/v2/engine/modules/order.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -115,7 +115,7 @@
             int i;
             iter = list_begin(arg), end = list_end(arg);
             for (i = 0; i < order[index]; ++i, iter = list_next(iter));
- result = list_new(result, object_copy(list_item(iter)));
+ result = list_push_back(result, object_copy(list_item(iter)));
         }
     }
 

Modified: trunk/tools/build/v2/engine/modules/path.c
==============================================================================
--- trunk/tools/build/v2/engine/modules/path.c (original)
+++ trunk/tools/build/v2/engine/modules/path.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -14,7 +14,7 @@
     timestamp(list_front(l), &time);
     if (time != 0)
     {
- return list_new(L0, object_new("true"));
+ return list_new(object_new("true"));
     }
     else
     {

Modified: trunk/tools/build/v2/engine/modules/property-set.c
==============================================================================
--- trunk/tools/build/v2/engine/modules/property-set.c (original)
+++ trunk/tools/build/v2/engine/modules/property-set.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -19,7 +19,7 @@
     string_new(s);
 
     string_append_range(s, f, end+1);
- result = list_new(0, object_new(s->value));
+ result = list_new(object_new(s->value));
 
     string_free(s);
     return result;
@@ -88,7 +88,7 @@
     {
         OBJECT* rulename = object_new("new");
         val = call_rule(rulename, frame,
- list_append(list_new(L0, object_new("property-set")), unique), 0);
+ list_append(list_new(object_new("property-set")), unique), 0);
         object_free(rulename);
 
         var_set(frame->module, name, list_copy(val), VAR_SET);

Modified: trunk/tools/build/v2/engine/modules/regex.c
==============================================================================
--- trunk/tools/build/v2/engine/modules/regex.c (original)
+++ trunk/tools/build/v2/engine/modules/regex.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -75,7 +75,7 @@
                     if (re->startp[index] != re->endp[index])
                     {
                         string_append_range( buf, re->startp[index], re->endp[index] );
- result = list_new( result, object_new( buf->value ) );
+ result = list_push_back( result, object_new( buf->value ) );
                         string_truncate( buf, 0 );
                     }
                 }

Modified: trunk/tools/build/v2/engine/modules/sequence.c
==============================================================================
--- trunk/tools/build/v2/engine/modules/sequence.c (original)
+++ trunk/tools/build/v2/engine/modules/sequence.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -31,7 +31,7 @@
     elements_iter = list_begin(elements), elements_end = list_end(elements);
     for (; iter != end; iter = list_next(iter), elements_iter = list_next(elements_iter))
         if (atoi(object_str(list_item(iter))) == highest_rank)
- result = list_new(result, object_copy(list_item(elements_iter)));
+ result = list_push_back(result, object_copy(list_item(elements_iter)));
 
     return result;
 }

Modified: trunk/tools/build/v2/engine/modules/set.c
==============================================================================
--- trunk/tools/build/v2/engine/modules/set.c (original)
+++ trunk/tools/build/v2/engine/modules/set.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -28,7 +28,7 @@
     for( ; iter != end; iter = list_next( iter ) )
     {
         if (!list_in(a, list_item(iter)))
- result = list_new(result, object_copy(list_item(iter)));
+ result = list_push_back(result, object_copy(list_item(iter)));
     }
     return result;
 }

Modified: trunk/tools/build/v2/engine/pwd.c
==============================================================================
--- trunk/tools/build/v2/engine/pwd.c (original)
+++ trunk/tools/build/v2/engine/pwd.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -64,7 +64,7 @@
             return L0;
         }
     }
- return list_new(L0, object_copy( pwd_result ) );
+ return list_new( object_copy( pwd_result ) );
 }
 
 void pwd_done( void )

Modified: trunk/tools/build/v2/engine/search.c
==============================================================================
--- trunk/tools/build/v2/engine/search.c (original)
+++ trunk/tools/build/v2/engine/search.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -51,9 +51,9 @@
             frame_init( frame );
 
             /* First argument is the target name. */
- lol_add( frame->args, list_new( L0, target ) );
+ lol_add( frame->args, list_new( target ) );
 
- lol_add( frame->args, list_new( L0, boundname ) );
+ lol_add( frame->args, list_new( boundname ) );
             if ( lol_get( frame->args, 1 ) )
                 list_free( evaluate_rule( list_front( bind_rule ), frame ) );
 

Modified: trunk/tools/build/v2/engine/subst.c
==============================================================================
--- trunk/tools/build/v2/engine/subst.c (original)
+++ trunk/tools/build/v2/engine/subst.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -85,7 +85,7 @@
               }
               *out = 0;
 
- result = list_new( result, object_new( buf ) );
+ result = list_push_back( result, object_new( buf ) );
 #undef BUFLEN
           }
       }

Modified: trunk/tools/build/v2/engine/variable.c
==============================================================================
--- trunk/tools/build/v2/engine/variable.c (original)
+++ trunk/tools/build/v2/engine/variable.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -118,7 +118,7 @@
             if ( quoted && preprocess )
             {
                 string_append_range( buf, val + 2, val + len );
- l = list_new( l, object_new( buf->value ) );
+ l = list_push_back( l, object_new( buf->value ) );
                 string_truncate( buf, 0 );
             }
             else
@@ -141,11 +141,11 @@
                 )
                 {
                     string_append_range( buf, pp, p );
- l = list_new( l, object_new( buf->value ) );
+ l = list_push_back( l, object_new( buf->value ) );
                     string_truncate( buf, 0 );
                 }
 
- l = list_new( l, object_new( pp ) );
+ l = list_push_back( l, object_new( pp ) );
             }
 
             /* Get name. */
@@ -176,27 +176,27 @@
     if ( object_equal( symbol, constant_TMPDIR ) )
     {
         list_free( saved_var );
- result = saved_var = list_new( L0, object_new( path_tmpdir() ) );
+ result = saved_var = list_new( object_new( path_tmpdir() ) );
     }
     else if ( object_equal( symbol, constant_TMPNAME ) )
     {
         list_free( saved_var );
- result = saved_var = list_new( L0, path_tmpnam() );
+ result = saved_var = list_new( path_tmpnam() );
     }
     else if ( object_equal( symbol, constant_TMPFILE ) )
     {
         list_free( saved_var );
- result = saved_var = list_new( L0, path_tmpfile() );
+ result = saved_var = list_new( path_tmpfile() );
     }
     else if ( object_equal( symbol, constant_STDOUT ) )
     {
         list_free( saved_var );
- result = saved_var = list_new( L0, object_copy( constant_STDOUT ) );
+ result = saved_var = list_new( object_copy( constant_STDOUT ) );
     }
     else if ( object_equal( symbol, constant_STDERR ) )
     {
         list_free( saved_var );
- result = saved_var = list_new( L0, object_copy( constant_STDERR ) );
+ result = saved_var = list_new( object_copy( constant_STDERR ) );
     }
     else
 #endif

Modified: trunk/tools/build/v2/engine/w32_getreg.c
==============================================================================
--- trunk/tools/build/v2/engine/w32_getreg.c (original)
+++ trunk/tools/build/v2/engine/w32_getreg.c 2012-03-24 19:03:10 EDT (Sat, 24 Mar 2012)
@@ -94,7 +94,7 @@
 
                      expanded->size = len - 1;
 
- result = list_new( result, object_new(expanded->value) );
+ result = list_push_back( result, object_new(expanded->value) );
                      string_free( expanded );
                  }
                  break;
@@ -104,7 +104,7 @@
                      char* s;
 
                      for (s = (char*)data; *s; s += strlen(s) + 1)
- result = list_new( result, object_new(s) );
+ result = list_push_back( result, object_new(s) );
 
                  }
                  break;
@@ -113,12 +113,12 @@
                  {
                      char buf[100];
                      sprintf( buf, "%u", *(PDWORD)data );
- result = list_new( result, object_new(buf) );
+ result = list_push_back( result, object_new(buf) );
                  }
                  break;
 
              case REG_SZ:
- result = list_new( result, object_new( (const char *)data ) );
+ result = list_push_back( result, object_new( (const char *)data ) );
                  break;
             }
         }
@@ -148,7 +148,7 @@
         )
         {
             name[name_size] = 0;
- result = list_append(result, list_new(0, object_new(name)));
+ result = list_append(result, list_new(object_new(name)));
         }
 
         RegCloseKey(key);
@@ -175,7 +175,7 @@
         )
         {
             name[name_size] = 0;
- result = list_append(result, list_new(0, object_new(name)));
+ result = list_append(result, list_new(object_new(name)));
         }
 
         RegCloseKey(key);


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