Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80257 - trunk/tools/build/v2/engine/modules
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-27 07:07:03


Author: jurko
Date: 2012-08-27 07:07:03 EDT (Mon, 27 Aug 2012)
New Revision: 80257
URL: http://svn.boost.org/trac/boost/changeset/80257

Log:
Internal Boost Jam cleanup - minor stylistic changes in Boost Jam's modules/regex.c module.
Text files modified:
   trunk/tools/build/v2/engine/modules/regex.c | 28 ++++++++++++++++------------
   1 files changed, 16 insertions(+), 12 deletions(-)

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-08-27 07:07:03 EDT (Mon, 27 Aug 2012)
@@ -1,6 +1,9 @@
-/* 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 2003. Vladimir Prus
+ * 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 "../mem.h"
 #include "../native.h"
@@ -27,30 +30,27 @@
 
 LIST * regex_transform( FRAME * frame, int flags )
 {
- LIST * l = lol_get( frame->args, 0 );
- LIST * pattern = lol_get( frame->args, 1 );
- LIST * indices_list = lol_get( frame->args, 2 );
+ LIST * const l = lol_get( frame->args, 0 );
+ LIST * const pattern = lol_get( frame->args, 1 );
+ LIST * const indices_list = lol_get( frame->args, 2 );
     int * indices = 0;
     int size;
- int * p;
     LIST * result = L0;
 
- string buf[ 1 ];
- string_new( buf );
-
     if ( !list_empty( indices_list ) )
     {
+ int * p;
         LISTITER iter = list_begin( indices_list );
         LISTITER const end = list_end( indices_list );
         size = list_length( indices_list );
- indices = ( int * )BJAM_MALLOC( size * sizeof( int ) );
+ indices = (int *)BJAM_MALLOC( size * sizeof( int ) );
         for ( p = indices; iter != end; iter = list_next( iter ) )
             *p++ = atoi( object_str( list_item( iter ) ) );
     }
     else
     {
         size = 1;
- indices = ( int * )BJAM_MALLOC( sizeof( int ) );
+ indices = (int *)BJAM_MALLOC( sizeof( int ) );
         *indices = 1;
     }
 
@@ -60,6 +60,10 @@
 
         LISTITER iter = list_begin( l );
         LISTITER const end = list_end( l );
+
+ string buf[ 1 ];
+ string_new( buf );
+
         for ( ; iter != end; iter = list_next( iter ) )
         {
             if ( regexec( re, object_str( list_item( iter ) ) ) )


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