2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 13:42:14 +00:00

Boost Jam code cleanup - minor stylistic const correctness & comment changes.

[SVN r79110]
This commit is contained in:
Jurko Gospodnetić
2012-06-26 13:49:06 +00:00
parent a70726f44d
commit d1edcc2be9
4 changed files with 37 additions and 35 deletions

View File

@@ -30,11 +30,11 @@ typedef struct timing_info
typedef void (* ExecCmdCallback)
(
void * closure,
int status,
timing_info const *,
char const * invoked_command,
char const * command_output
void * const closure,
int const status,
timing_info const * const,
char const * const invoked_command,
char const * const command_output
);
/* Status codes passed to ExecCmdCallback routines. */
@@ -44,7 +44,7 @@ typedef void (* ExecCmdCallback)
int exec_check
(
string * command,
string const * command,
LIST * * pShell,
int * error_length,
int * error_max_length
@@ -62,8 +62,8 @@ void exec_cmd
ExecCmdCallback func,
void * closure,
LIST * shell,
char const * action,
char const * target
char const * const action,
char const * const target
);
void exec_wait();

View File

@@ -210,7 +210,7 @@ void execnt_unit_test()
int exec_check
(
string * command,
string const * command,
LIST * * pShell,
int * error_length,
int * error_max_length
@@ -278,8 +278,8 @@ void exec_cmd
ExecCmdCallback func,
void * closure,
LIST * shell,
char const * action,
char const * target
char const * const action,
char const * const target
)
{
int const slot = get_free_cmdtab_slot();
@@ -421,7 +421,7 @@ void exec_wait()
/* The dispossition of the command. */
if ( interrupted() )
rstat = EXEC_CMD_INTR;
else if ( cmdtab[ i ].exit_code != 0 )
else if ( cmdtab[ i ].exit_code )
rstat = EXEC_CMD_FAIL;
else
rstat = EXEC_CMD_OK;
@@ -441,14 +441,14 @@ void exec_wait()
(*cmdtab[ i ].func)( cmdtab[ i ].closure, rstat, &time,
cmdtab[ i ].command->value, cmdtab[ i ].buffer_out->value );
/* Clean up the command data, process, etc. No need to clear the
/* Clean up our child process tracking data. No need to clear the
* temporary command file name as it gets reused.
*/
string_renew( cmdtab[ i ].action );
string_renew( cmdtab[ i ].target );
string_renew( cmdtab[ i ].action );
string_renew( cmdtab[ i ].target );
string_renew( cmdtab[ i ].command );
closeWinHandle( &cmdtab[ i ].pi.hProcess );
closeWinHandle( &cmdtab[ i ].pi.hThread );
closeWinHandle( &cmdtab[ i ].pi.hProcess );
closeWinHandle( &cmdtab[ i ].pi.hThread );
closeWinHandle( &cmdtab[ i ].pipe_out[ 0 ] );
closeWinHandle( &cmdtab[ i ].pipe_out[ 1 ] );
closeWinHandle( &cmdtab[ i ].pipe_err[ 0 ] );
@@ -912,7 +912,7 @@ static int try_kill_one()
if ( t > (double)globs.timeout )
{
/* The job may have left an alert dialog around, try and get rid
* of it before killing
* of it before killing.
*/
close_alert( cmdtab[ i ].pi.hProcess );
/* We have a "runaway" job, kill it. */

View File

@@ -104,7 +104,7 @@ static struct
int exec_check
(
string * command,
string const * command,
LIST * * pShell,
int * error_length,
int * error_max_length
@@ -141,8 +141,8 @@ void exec_cmd
ExecCmdCallback func,
void * closure,
LIST * shell,
char const * action,
char const * target
char const * const action,
char const * const target
)
{
int const slot = get_free_cmdtab_slot();
@@ -546,11 +546,11 @@ void exec_wait()
rstat = EXEC_CMD_OK;
/* Call the callback, may call back to jam rule land. Assume -p0
* is in effect so only pass buffer[ 0 ] containing merged
* is in effect so only pass buffer[ OUT ] containing merged
* output.
*/
(*cmdtab[ i ].func)( cmdtab[ i ].closure, rstat, &time_info,
cmdtab[ i ].command, cmdtab[ i ].buffer[ 0 ] );
cmdtab[ i ].command, cmdtab[ i ].buffer[ OUT ] );
BJAM_FREE( cmdtab[ i ].buffer[ OUT ] );
cmdtab[ i ].buffer[ OUT ] = 0;

View File

@@ -99,8 +99,9 @@ static void make1atail ( state * );
static void make1b ( state * );
static void make1c ( state * );
static void make1d ( state * );
static void make_closure( void * closure, int status, timing_info const *,
char const *, char const * );
static void make_closure( void * const closure, int const status,
timing_info const * const, char const * const invoked_command,
char const * const command_output );
typedef struct _stack
{
@@ -838,29 +839,30 @@ static void call_action_rule
/*
* make_closure() - internal function passed as a notification callback for when
* commands finish getting executed by the OS.
* commands finish getting executed by the OS or called directly when faking
* that the commands had been executed by the OS.
*/
static void make_closure
(
void * closure,
int status,
timing_info const * time,
char const * executed_command,
char const * command_output
void * const closure,
int const status,
timing_info const * const time,
char const * const invoked_command,
char const * const command_output
)
{
TARGET * built = (TARGET *)closure;
TARGET * const t = (TARGET *)closure;
--cmdsrunning;
call_timing_rule( built, time );
call_timing_rule( t, time );
if ( DEBUG_EXECCMD )
printf( "%f sec system; %f sec user\n", time->system, time->user );
call_action_rule( built, status, time, executed_command, command_output );
call_action_rule( t, status, time, invoked_command, command_output );
push_state( &state_stack, built, NULL, T_STATE_MAKE1D )->status = status;
push_state( &state_stack, t, NULL, T_STATE_MAKE1D )->status = status;
}