Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80254 - trunk/tools/build/v2/engine/modules
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-27 06:41:53


Author: jurko
Date: 2012-08-27 06:41:52 EDT (Mon, 27 Aug 2012)
New Revision: 80254
URL: http://svn.boost.org/trac/boost/changeset/80254

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

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-08-27 06:41:52 EDT (Mon, 27 Aug 2012)
@@ -1,47 +1,58 @@
-/* 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 "../native.h"
 #include "../object.h"
 
-# ifndef max
-# define max( a,b ) ((a)>(b)?(a):(b))
-# endif
 
+#ifndef max
+# define max(a,b) ((a)>(b)?(a):(b))
+#endif
 
-LIST *sequence_select_highest_ranked( FRAME *frame, int flags )
+
+LIST * sequence_select_highest_ranked( FRAME * frame, int flags )
 {
    /* Returns all of 'elements' for which corresponding element in parallel */
    /* list 'rank' is equal to the maximum value in 'rank'. */
 
- LIST* elements = lol_get( frame->args, 0 );
- LIST* rank = lol_get( frame->args, 1 );
- LISTITER iter, end, elements_iter, elements_end;
-
- LIST* result = L0;
- LIST* tmp;
+ LIST * const elements = lol_get( frame->args, 0 );
+ LIST * const rank = lol_get( frame->args, 1 );
+
+ LIST * result = L0;
     int highest_rank = -1;
 
- iter = list_begin(rank), end = list_end(rank);
- for (; iter != end; iter = list_next(iter))
- highest_rank = max(highest_rank, atoi(object_str(list_item(iter))));
-
- iter = list_begin(rank), end = list_end(rank);
- 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_push_back(result, object_copy(list_item(elements_iter)));
+ {
+ LISTITER iter = list_begin( rank );
+ LISTITER const end = list_end( rank );
+ for ( ; iter != end; iter = list_next( iter ) )
+ {
+ int const current = atoi( object_str( list_item( iter ) ) );
+ highest_rank = max( highest_rank, current );
+ }
+ }
+
+ {
+ LISTITER iter = list_begin( rank );
+ LISTITER const end = list_end( rank );
+ LISTITER elements_iter = list_begin( elements );
+ LISTITER const 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_push_back( result, object_copy( list_item(
+ elements_iter ) ) );
+ }
 
     return result;
 }
 
 void init_sequence()
 {
- {
- const char* args[] = { "elements", "*", ":", "rank", "*", 0 };
- declare_native_rule("sequence", "select-highest-ranked", args,
- sequence_select_highest_ranked, 1);
- }
-
+ char const * args[] = { "elements", "*", ":", "rank", "*", 0 };
+ declare_native_rule( "sequence", "select-highest-ranked", args,
+ sequence_select_highest_ranked, 1 );
 }


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