Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79493 - trunk/tools/build/v2/engine
From: jurko.gospodnetic_at_[hidden]
Date: 2012-07-14 07:35:30


Author: jurko
Date: 2012-07-14 07:35:29 EDT (Sat, 14 Jul 2012)
New Revision: 79493
URL: http://svn.boost.org/trac/boost/changeset/79493

Log:
Boost Jam code cleanup - minor stylistic code changes & comment updates.
Text files modified:
   trunk/tools/build/v2/engine/execnt.c | 71 +++++++++++++++++++++------------------
   1 files changed, 38 insertions(+), 33 deletions(-)

Modified: trunk/tools/build/v2/engine/execnt.c
==============================================================================
--- trunk/tools/build/v2/engine/execnt.c (original)
+++ trunk/tools/build/v2/engine/execnt.c 2012-07-14 07:35:29 EDT (Sat, 14 Jul 2012)
@@ -11,7 +11,34 @@
  * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
  */
 
+/*
+ * execnt.c - execute a shell command on Windows NT
+ *
+ * If $(JAMSHELL) is defined, uses that to formulate the actual command. The
+ * default is: cmd.exe /Q/C
+ *
+ * In $(JAMSHELL), % expands to the command string and ! expands to the slot
+ * number (starting at 1) for multiprocess (-j) invocations. If $(JAMSHELL) does
+ * not include a %, it is tacked on as the last argument.
+ *
+ * Each $(JAMSHELL) placeholder must be specified as a separate individual
+ * element in a jam variable value.
+ *
+ * Do not just set JAMSHELL to cmd.exe - it will not work!
+ *
+ * External routines:
+ * exec_check() - preprocess and validate the command
+ * exec_cmd() - launch an async command execution
+ * exec_wait() - wait for any of the async command processes to
+ * terminate
+ *
+ * Internal routines:
+ * filetime_dt() - Windows FILETIME --> POSIX time_t conversion
+ * filetime_seconds() - Windows FILETIME --> number of seconds conversion
+ */
+
 #include "jam.h"
+#ifdef USE_EXECNT
 #include "execcmd.h"
 
 #include "lists.h"
@@ -25,33 +52,11 @@
 #include <math.h>
 #include <time.h>
 
-#ifdef USE_EXECNT
-
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <process.h>
 #include <tlhelp32.h>
 
-/*
- * execnt.c - execute a shell command on Windows NT
- *
- * If $(JAMSHELL) is defined, uses that to formulate the actual command. The
- * default is: cmd.exe /Q/C
- *
- * In $(JAMSHELL), % expands to the command string and ! expands to the slot
- * number (starting at 1) for multiprocess (-j) invocations. If $(JAMSHELL) does
- * not include a %, it is tacked on as the last argument.
- *
- * Each $(JAMSHELL) placeholder must be specified as a separate individual
- * element in a jam variable value.
- *
- * Do not just set JAMSHELL to cmd.exe - it will not work!
- *
- * External routines:
- * exec_check() - preprocess and validate the command.
- * exec_cmd() - launch an async command execution.
- * exec_wait() - wait for any of the async command processes to terminate.
- */
 
 /* get the maximum shell command line length according to the OS */
 static int maxline();
@@ -65,8 +70,6 @@
 static FILETIME add_FILETIME( FILETIME t1, FILETIME t2 );
 /* */
 static FILETIME negate_FILETIME( FILETIME t );
-/* convert a FILETIME to a number of seconds */
-static double filetime_seconds( FILETIME t );
 /* record the timing info for the process */
 static void record_times( HANDLE, timing_info * );
 /* calc the current running time of an *active* process */
@@ -203,7 +206,7 @@
 
 
 /*
- * exec_check() - preprocess and validate the command.
+ * exec_check() - preprocess and validate the command
  */
 
 int exec_check
@@ -264,7 +267,7 @@
 
 
 /*
- * exec_cmd() - launch an async command execution.
+ * exec_cmd() - launch an async command execution
  *
  * We assume exec_check() already verified that the given command can have its
  * command string constructed as requested.
@@ -351,10 +354,10 @@
 
 
 /*
- * exec_wait()
- * * wait and drive at most one execution completion.
- * * waits for one command to complete, while processing the i/o for all
- * ongoing commands.
+ * exec_wait() - wait for any of the async command processes to terminate
+ *
+ * Wait and drive at most one execution completion, while processing the I/O for
+ * all ongoing commands.
  */
 
 void exec_wait()
@@ -672,10 +675,10 @@
 
 
 /*
- * Convert a FILETIME to a number of seconds.
+ * filetime_seconds() - Windows FILETIME --> number of seconds conversion
  */
 
-static double filetime_seconds( FILETIME t )
+static double filetime_seconds( FILETIME const t )
 {
     return t.dwHighDateTime * ( (double)( 1UL << 31 ) * 2.0 * 1.0e-7 ) +
         t.dwLowDateTime * 1.0e-7;
@@ -683,11 +686,13 @@
 
 
 /*
+ * filetime_dt() - Windows FILETIME --> POSIX time_t conversion
+ *
  * What should be a simple conversion, turns out to be horribly complicated by
  * the defficiencies of MSVC and the Win32 API.
  */
 
-static time_t filetime_dt( FILETIME t_utc )
+static time_t filetime_dt( FILETIME const t_utc )
 {
     static int calc_time_diff = 1;
     static double time_diff;


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