|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79507 - trunk/tools/build/v2/engine
From: jurko.gospodnetic_at_[hidden]
Date: 2012-07-14 13:28:51
Author: jurko
Date: 2012-07-14 13:28:50 EDT (Sat, 14 Jul 2012)
New Revision: 79507
URL: http://svn.boost.org/trac/boost/changeset/79507
Log:
Boost Jam code cleanup - extracted code for getting a timestamp for the current system time to timestamp_current().
Text files modified:
trunk/tools/build/v2/engine/execunix.c | 4 ++--
trunk/tools/build/v2/engine/jam.c | 2 +-
trunk/tools/build/v2/engine/make1.c | 2 +-
trunk/tools/build/v2/engine/timestamp.c | 6 ++++++
trunk/tools/build/v2/engine/timestamp.h | 1 +
5 files changed, 11 insertions(+), 4 deletions(-)
Modified: trunk/tools/build/v2/engine/execunix.c
==============================================================================
--- trunk/tools/build/v2/engine/execunix.c (original)
+++ trunk/tools/build/v2/engine/execunix.c 2012-07-14 13:28:50 EDT (Sat, 14 Jul 2012)
@@ -184,7 +184,7 @@
/* Start the command */
- timestamp_init( &cmdtab[ slot ].start_dt, time( 0 ), 0 );
+ timestamp_current( &cmdtab[ slot ].start_dt );
if ( 0 < globs.timeout )
{
@@ -506,7 +506,7 @@
time_info.user = (double)( new_time.tms_cutime -
old_time.tms_cutime ) / CLOCKS_PER_SEC;
timestamp_copy( &time_info.start, &cmdtab[ i ].start_dt );
- timestamp_init( &time_info.end, time( 0 ), 0 );
+ timestamp_current( &time_info.end );
old_time = new_time;
}
Modified: trunk/tools/build/v2/engine/jam.c
==============================================================================
--- trunk/tools/build/v2/engine/jam.c (original)
+++ trunk/tools/build/v2/engine/jam.c 2012-07-14 13:28:50 EDT (Sat, 14 Jul 2012)
@@ -388,7 +388,7 @@
/* Set JAMDATE. */
{
timestamp current;
- timestamp_init( ¤t, time( 0 ), 0 );
+ timestamp_current( ¤t );
var_set( root_module(), constant_JAMDATE, list_new( outf_time(
¤t ) ), VAR_SET );
}
Modified: trunk/tools/build/v2/engine/make1.c
==============================================================================
--- trunk/tools/build/v2/engine/make1.c (original)
+++ trunk/tools/build/v2/engine/make1.c 2012-07-14 13:28:50 EDT (Sat, 14 Jul 2012)
@@ -513,7 +513,7 @@
if ( globs.noexec || cmd->noop )
{
timing_info time_info = { 0 };
- timestamp_init( &time_info.start, time( 0 ), 0 );
+ timestamp_current( &time_info.start );
timestamp_copy( &time_info.end, &time_info.start );
make1c_closure( t, EXEC_CMD_OK, &time_info, "", "", EXIT_OK );
}
Modified: trunk/tools/build/v2/engine/timestamp.c
==============================================================================
--- trunk/tools/build/v2/engine/timestamp.c (original)
+++ trunk/tools/build/v2/engine/timestamp.c 2012-07-14 13:28:50 EDT (Sat, 14 Jul 2012)
@@ -90,6 +90,12 @@
}
+void timestamp_current( timestamp * const t )
+{
+ timestamp_init( t, time( 0 ), 0 );
+}
+
+
int timestamp_empty( timestamp const * const time )
{
return !time->secs && !time->nsecs;
Modified: trunk/tools/build/v2/engine/timestamp.h
==============================================================================
--- trunk/tools/build/v2/engine/timestamp.h (original)
+++ trunk/tools/build/v2/engine/timestamp.h 2012-07-14 13:28:50 EDT (Sat, 14 Jul 2012)
@@ -24,6 +24,7 @@
void timestamp_clear( timestamp * const time );
int timestamp_cmp( timestamp const * const lhs, timestamp const * const rhs );
void timestamp_copy( timestamp * const target, timestamp const * const source );
+void timestamp_current( timestamp * const time );
int timestamp_empty( timestamp const * const time );
void timestamp_from_path( timestamp * const time, OBJECT * const path );
void timestamp_init( timestamp * const time, time_t const secs, int const nsecs
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