Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80111 - trunk/tools/build/v2/engine
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-21 10:30:14


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

Log:
Boost Jam cleanup - minor stylistic changes.
Text files modified:
   trunk/tools/build/v2/engine/filent.c | 3
   trunk/tools/build/v2/engine/pathunix.c | 4
   trunk/tools/build/v2/engine/search.c | 14 ++--
   trunk/tools/build/v2/engine/timestamp.c | 138 +++++++++++++++++++--------------------
   4 files changed, 79 insertions(+), 80 deletions(-)

Modified: trunk/tools/build/v2/engine/filent.c
==============================================================================
--- trunk/tools/build/v2/engine/filent.c (original)
+++ trunk/tools/build/v2/engine/filent.c 2012-08-21 10:30:13 EDT (Tue, 21 Aug 2012)
@@ -69,7 +69,7 @@
     f.f_dir.ptr = object_str( d->name );
     f.f_dir.len = d_length;
 
- /* Prepare file search specification for the findfirst() API. */
+ /* Prepare file search specification for the FindXXX() Windows API. */
     if ( !d_length )
         string_copy( pathspec, ".\\*" );
     else
@@ -108,6 +108,7 @@
 
             f.f_base.ptr = finfo.cFileName;
             f.f_base.len = strlen( finfo.cFileName );
+
             string_truncate( pathname, 0 );
             path_build( &f, pathname );
 

Modified: trunk/tools/build/v2/engine/pathunix.c
==============================================================================
--- trunk/tools/build/v2/engine/pathunix.c (original)
+++ trunk/tools/build/v2/engine/pathunix.c 2012-08-21 10:30:13 EDT (Tue, 21 Aug 2012)
@@ -263,7 +263,7 @@
  * Appends the canonic path to the end of the given 'string' object.
  *
  * FIXME: This function is still work-in-progress as it originally did not
- * necessarily return the canonic path format (could return slightly different
+ * necessarily return the canonic path format (could return slightly different
  * results for certain equivalent path strings) and could accept paths pointing
  * to non-existing file system entities as well.
  *
@@ -348,7 +348,7 @@
             && !( n_length == 2 && n[ 0 ] == '.' && n[ 1 ] == '.' ) )
         {
             WIN32_FIND_DATA fd;
- HANDLE const hf = FindFirstFile( out->value, &fd );
+ HANDLE const hf = FindFirstFileA( out->value, &fd );
             if ( hf != INVALID_HANDLE_VALUE )
             {
                 string_truncate( out, saved_size );

Modified: trunk/tools/build/v2/engine/search.c
==============================================================================
--- trunk/tools/build/v2/engine/search.c (original)
+++ trunk/tools/build/v2/engine/search.c 2012-08-21 10:30:13 EDT (Tue, 21 Aug 2012)
@@ -4,10 +4,11 @@
  * This file is part of Jam - see jam.c for Copyright information.
  */
 
-/* This file is ALSO:
- * 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)
+/* This file is ALSO:
+ * 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"
@@ -235,8 +236,7 @@
 
 static void free_binding( void * xbinding, void * data )
 {
- BINDING * const binding = (BINDING *)xbinding;
- object_free( binding->binding );
+ object_free( ( (BINDING *)xbinding )->binding );
 }
 
 
@@ -244,7 +244,7 @@
 {
     if ( explicit_bindings )
     {
- hashenumerate( explicit_bindings, free_binding, (void *)0 );
+ hashenumerate( explicit_bindings, free_binding, 0 );
         hashdone( explicit_bindings );
     }
 }

Modified: trunk/tools/build/v2/engine/timestamp.c
==============================================================================
--- trunk/tools/build/v2/engine/timestamp.c (original)
+++ trunk/tools/build/v2/engine/timestamp.c 2012-08-21 10:30:13 EDT (Tue, 21 Aug 2012)
@@ -37,7 +37,8 @@
  * BINDING - all known files
  */
 
-typedef struct _binding {
+typedef struct _binding
+{
     OBJECT * name;
     short flags;
 
@@ -56,6 +57,7 @@
 } BINDING;
 
 static struct hash * bindhash = 0;
+
 static void time_enter( void *, OBJECT *, int const found,
     timestamp const * const );
 
@@ -106,9 +108,9 @@
 
 int timestamp_cmp( timestamp const * const lhs, timestamp const * const rhs )
 {
- if ( lhs->secs == rhs->secs )
- return lhs->nsecs - rhs->nsecs;
- return lhs->secs - rhs->secs;
+ return lhs->secs == rhs->secs
+ ? lhs->nsecs - rhs->nsecs
+ : lhs->secs - rhs->secs;
 }
 
 
@@ -172,86 +174,82 @@
         timestamp_clear( &b->time );
     }
 
- if ( b->progress != BIND_INIT )
- goto afterscanning;
-
- b->progress = BIND_NOENTRY;
-
- /* Not found - have to scan for it. */
- path_parse( object_str( normalized_path ), &f1 );
-
- /* Scan directory if not already done so. */
+ if ( b->progress == BIND_INIT )
     {
- int found;
- BINDING * b;
- OBJECT * name;
-
- f2 = f1;
- f2.f_grist.len = 0;
- path_parent( &f2 );
- path_build( &f2, buf );
+ b->progress = BIND_NOENTRY;
 
- name = object_new( buf->value );
+ /* Not found - have to scan for it. */
+ path_parse( object_str( normalized_path ), &f1 );
 
- b = (BINDING *)hash_insert( bindhash, name, &found );
- if ( !found )
+ /* Scan directory if not already done so. */
         {
- b->name = object_copy( name );
- b->flags = 0;
- b->progress = BIND_INIT;
- timestamp_clear( &b->time );
- }
+ int found;
+ BINDING * b;
+ OBJECT * name;
+
+ f2 = f1;
+ f2.f_grist.len = 0;
+ path_parent( &f2 );
+ path_build( &f2, buf );
+
+ name = object_new( buf->value );
+
+ b = (BINDING *)hash_insert( bindhash, name, &found );
+ if ( !found )
+ {
+ b->name = object_copy( name );
+ b->flags = 0;
+ b->progress = BIND_INIT;
+ timestamp_clear( &b->time );
+ }
+
+ if ( !( b->flags & BIND_SCANNED ) )
+ {
+ file_dirscan( name, time_enter, bindhash );
+ b->flags |= BIND_SCANNED;
+ }
 
- if ( !( b->flags & BIND_SCANNED ) )
- {
- file_dirscan( name, time_enter, bindhash );
- b->flags |= BIND_SCANNED;
+ object_free( name );
         }
 
- object_free( name );
- }
-
- /* Scan archive if not already done so. */
- if ( f1.f_member.len )
- {
- int found;
- BINDING * b;
- OBJECT * name;
-
- f2 = f1;
- f2.f_grist.len = 0;
- f2.f_member.len = 0;
- string_truncate( buf, 0 );
- path_build( &f2, buf );
-
- name = object_new( buf->value );
-
- b = (BINDING *)hash_insert( bindhash, name, &found );
- if ( !found )
+ /* Scan archive if not already done so. */
+ if ( f1.f_member.len )
         {
- b->name = object_copy( name );
- b->flags = 0;
- b->progress = BIND_INIT;
- timestamp_clear( &b->time );
- }
+ int found;
+ BINDING * b;
+ OBJECT * name;
+
+ f2 = f1;
+ f2.f_grist.len = 0;
+ f2.f_member.len = 0;
+ string_truncate( buf, 0 );
+ path_build( &f2, buf );
+
+ name = object_new( buf->value );
+
+ b = (BINDING *)hash_insert( bindhash, name, &found );
+ if ( !found )
+ {
+ b->name = object_copy( name );
+ b->flags = 0;
+ b->progress = BIND_INIT;
+ timestamp_clear( &b->time );
+ }
+
+ if ( !( b->flags & BIND_SCANNED ) )
+ {
+ file_archscan( buf->value, time_enter, bindhash );
+ b->flags |= BIND_SCANNED;
+ }
 
- if ( !( b->flags & BIND_SCANNED ) )
- {
- file_archscan( buf->value, time_enter, bindhash );
- b->flags |= BIND_SCANNED;
+ object_free( name );
         }
-
- object_free( name );
     }
 
- afterscanning:
-
     if ( b->progress == BIND_SPOTTED )
- {
- b->progress = file_time( b->name, &b->time ) < 0
+ b->progress = file_time( b->name, &b->time ) < 0
             ? BIND_MISSING
             : BIND_FOUND;
- }
 
     if ( b->progress == BIND_FOUND )
         timestamp_copy( time, &b->time );
@@ -356,7 +354,7 @@
 {
     if ( bindhash )
     {
- hashenumerate( bindhash, free_timestamps, (void *)0 );
+ hashenumerate( bindhash, free_timestamps, 0 );
         hashdone( bindhash );
     }
 }


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