mirror of
https://github.com/boostorg/build.git
synced 2026-02-20 02:32:13 +00:00
Boost Jam code cleanup - minor stylistic changes.
[SVN r79067]
This commit is contained in:
@@ -80,4 +80,5 @@ int interrupted( void );
|
||||
*/
|
||||
int is_raw_command_request( LIST * shell );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
1955
v2/engine/function.c
1955
v2/engine/function.c
File diff suppressed because it is too large
Load Diff
@@ -12,16 +12,12 @@
|
||||
#define bjam_out (stdout)
|
||||
#define bjam_err (stderr)
|
||||
|
||||
static void out_
|
||||
(
|
||||
char const * data,
|
||||
FILE * io
|
||||
)
|
||||
static void out_( char const * data, FILE * io )
|
||||
{
|
||||
while ( *data )
|
||||
{
|
||||
size_t len = strcspn(data,"\r");
|
||||
data += fwrite(data,1,len,io);
|
||||
size_t const len = strcspn( data, "\r" );
|
||||
data += fwrite( data, 1, len, io );
|
||||
if ( *data == '\r' ) ++data;
|
||||
}
|
||||
}
|
||||
@@ -34,16 +30,14 @@ void out_action
|
||||
char const * command,
|
||||
char const * out_data,
|
||||
char const * err_data,
|
||||
int exit_reason
|
||||
int exit_reason
|
||||
)
|
||||
{
|
||||
/* Print out the action+target line, if the action is quite the action
|
||||
/* Print out the action + target line, if the action is quiet the action
|
||||
* should be null.
|
||||
*/
|
||||
if ( action )
|
||||
{
|
||||
fprintf( bjam_out, "%s %s\n", action, target );
|
||||
}
|
||||
|
||||
/* Print out the command executed if given -d+2. */
|
||||
if ( DEBUG_EXEC )
|
||||
@@ -54,45 +48,25 @@ void out_action
|
||||
|
||||
/* Print out the command executed to the command stream. */
|
||||
if ( globs.cmdout )
|
||||
{
|
||||
fputs( command, globs.cmdout );
|
||||
}
|
||||
|
||||
switch ( exit_reason )
|
||||
{
|
||||
case EXIT_OK:
|
||||
break;
|
||||
case EXIT_FAIL:
|
||||
break;
|
||||
case EXIT_TIMEOUT:
|
||||
{
|
||||
/* Process expired, make user aware with explicit message. */
|
||||
if ( action )
|
||||
{
|
||||
/* But only output for non-quietly actions. */
|
||||
fprintf( bjam_out, "%ld second time limit exceeded\n", globs.timeout );
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* If the process expired, make user aware with an explicit message, but do
|
||||
* this only for non-quiet actions.
|
||||
*/
|
||||
if ( exit_reason == EXIT_TIMEOUT && action )
|
||||
fprintf( bjam_out, "%ld second time limit exceeded\n", globs.timeout );
|
||||
|
||||
/* Print out the command output, if requested, or if the program failed. */
|
||||
if ( action || exit_reason != EXIT_OK)
|
||||
/* Print out the command output, if requested, or if the program failed, but
|
||||
* only output for non-quiet actions.
|
||||
*/
|
||||
if ( action || exit_reason != EXIT_OK )
|
||||
{
|
||||
/* But only output for non-quietly actions. */
|
||||
if ( ( 0 != out_data ) &&
|
||||
if ( out_data &&
|
||||
( ( globs.pipe_action & 1 /* STDOUT_FILENO */ ) ||
|
||||
( globs.pipe_action == 0 ) ) )
|
||||
{
|
||||
out_( out_data, bjam_out );
|
||||
}
|
||||
if ( ( 0 != err_data ) &&
|
||||
( globs.pipe_action & 2 /* STDERR_FILENO */ ) )
|
||||
{
|
||||
if ( err_data && ( globs.pipe_action & 2 /* STDERR_FILENO */ ) )
|
||||
out_( err_data, bjam_err );
|
||||
}
|
||||
}
|
||||
|
||||
fflush( bjam_out );
|
||||
@@ -103,7 +77,7 @@ void out_action
|
||||
|
||||
OBJECT * outf_int( int value )
|
||||
{
|
||||
char buffer[50];
|
||||
char buffer[ 50 ];
|
||||
sprintf( buffer, "%i", value );
|
||||
return object_new( buffer );
|
||||
}
|
||||
@@ -111,7 +85,7 @@ OBJECT * outf_int( int value )
|
||||
|
||||
OBJECT * outf_double( double value )
|
||||
{
|
||||
char buffer[50];
|
||||
char buffer[ 50 ];
|
||||
sprintf( buffer, "%f", value );
|
||||
return object_new( buffer );
|
||||
}
|
||||
@@ -119,7 +93,7 @@ OBJECT * outf_double( double value )
|
||||
|
||||
OBJECT * outf_time( time_t value )
|
||||
{
|
||||
char buffer[50];
|
||||
char buffer[ 50 ];
|
||||
strftime( buffer, 49, "%Y-%m-%d %H:%M:%SZ", gmtime( &value ) );
|
||||
return object_new( buffer );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user