From 511a7d6188f3dd816e960ebcd218dfbbf1b8478b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sat, 28 Jul 2012 08:58:39 +0000 Subject: [PATCH] Boost Jam code cleanup - minor stylistic changes. [SVN r79778] --- v2/engine/filent.c | 2 +- v2/engine/filesys.c | 2 +- v2/engine/filesys.h | 6 ++--- v2/engine/jam.c | 51 ++++++++++++++++++++++--------------------- v2/engine/timestamp.c | 2 +- 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/v2/engine/filent.c b/v2/engine/filent.c index a913d738e..f4f2cd752 100644 --- a/v2/engine/filent.c +++ b/v2/engine/filent.c @@ -183,7 +183,7 @@ int file_mkdir( char const * const path ) /* * file_query_() - query information about a path from the OS - * + * * The following code for collecting information about a single file needs to be * synchronized with how the file_collect_dir_content_() operation is * implemented (collects information about all files in a folder). diff --git a/v2/engine/filesys.c b/v2/engine/filesys.c index 0e61b3fde..7a5a4767d 100644 --- a/v2/engine/filesys.c +++ b/v2/engine/filesys.c @@ -45,7 +45,7 @@ */ void file_dirscan_( file_info_t * const dir, scanback func, void * closure ); int file_collect_dir_content_( file_info_t * const dir ); -int file_query_( file_info_t * const info ); +int file_query_( file_info_t * const ); static void file_dirscan_impl( OBJECT * dir, scanback func, void * closure ); static void free_file_info( void * xfile, void * data ); diff --git a/v2/engine/filesys.h b/v2/engine/filesys.h index 5bce1375e..3c0a28d8f 100644 --- a/v2/engine/filesys.h +++ b/v2/engine/filesys.h @@ -34,7 +34,7 @@ typedef struct file_info_t } file_info_t; typedef void (*scanback)( void * closure, OBJECT * path, int found, - timestamp const * const t ); + timestamp const * const ); void file_archscan( char const * arch, scanback func, void * closure ); @@ -45,10 +45,10 @@ int file_is_file( OBJECT * const path ); int file_mkdir( char const * const path ); file_info_t * file_query( OBJECT * const path ); void file_remove_atexit( OBJECT * const path ); -int file_time( OBJECT * const path, timestamp * const time ); +int file_time( OBJECT * const path, timestamp * const ); /* Internal utility worker functions. */ -int file_query_posix_( file_info_t * const info ); +int file_query_posix_( file_info_t * const ); void file_done(); diff --git a/v2/engine/jam.c b/v2/engine/jam.c index 7a46deddc..43589a39f 100644 --- a/v2/engine/jam.c +++ b/v2/engine/jam.c @@ -123,13 +123,13 @@ /* Macintosh is "special" */ #ifdef OS_MAC - #include +# include #endif /* And UNIX for this. */ #ifdef unix - #include - #include +# include +# include #endif struct globs globs = @@ -159,27 +159,27 @@ static char * othersyms[] = { OSMAJOR, OSMINOR, OSPLAT, JAMVERSYM, 0 }; */ #ifdef OS_MAC - #define use_environ arg_environ - #ifdef MPW - QDGlobals qd; - #endif +# define use_environ arg_environ +# ifdef MPW + QDGlobals qd; +# endif #endif /* on Win32-LCC */ #if defined( OS_NT ) && defined( __LCC__ ) - #define use_environ _environ +# define use_environ _environ #endif -# if defined( __MWERKS__) - #define use_environ _environ +#if defined( __MWERKS__) +# define use_environ _environ extern char * * _environ; #endif #ifndef use_environ - #define use_environ environ - #if !defined( __WATCOM__ ) && !defined( OS_OS2 ) && !defined( OS_NT ) - extern char **environ; - #endif +# define use_environ environ +# if !defined( __WATCOM__ ) && !defined( OS_OS2 ) && !defined( OS_NT ) + extern char **environ; +# endif #endif #if YYDEBUG != 0 @@ -189,10 +189,10 @@ static char * othersyms[] = { OSMAJOR, OSMINOR, OSPLAT, JAMVERSYM, 0 }; #ifndef NDEBUG static void run_unit_tests() { -#if defined( USE_EXECNT ) +# if defined( USE_EXECNT ) extern void execnt_unit_test(); execnt_unit_test(); -#endif +# endif string_unit_test(); } #endif @@ -228,9 +228,9 @@ int main( int argc, char * * argv, char * * arg_environ ) BJAM_MEM_INIT(); -# ifdef OS_MAC +#ifdef OS_MAC InitGraf( &qd.thePort ); -# endif +#endif --argc; ++argv; @@ -263,7 +263,8 @@ int main( int argc, char * * argv, char * * arg_environ ) { printf( "Boost.Jam " ); printf( "Version %s. %s.\n", VERSION, OSMINOR ); - printf( " Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.\n" ); + printf( " Copyright 1993-2002 Christopher Seiwald and Perforce " + "Software, Inc.\n" ); printf( " Copyright 2001 David Turner.\n" ); printf( " Copyright 2001-2004 David Abrahams.\n" ); printf( " Copyright 2002-2008 Rene Rivera.\n" ); @@ -598,7 +599,7 @@ int main( int argc, char * * argv, char * * arg_environ ) */ #if defined(_WIN32) -#include +# include char * executable_path( char const * argv0 ) { char buf[ 1024 ]; @@ -606,7 +607,7 @@ char * executable_path( char const * argv0 ) return ( !ret || ret == sizeof( buf ) ) ? NULL : strdup( buf ); } #elif defined(__APPLE__) /* Not tested */ -#include +# include char *executable_path( char const * argv0 ) { char buf[ 1024 ]; @@ -614,14 +615,14 @@ char *executable_path( char const * argv0 ) return _NSGetExecutablePath( buf, &size ) ? NULL : strdup( buf ); } #elif defined(sun) || defined(__sun) /* Not tested */ -#include +# include char * executable_path( char const * argv0 ) { return strdup( getexecname() ); } #elif defined(__FreeBSD__) -#include +# include char * executable_path( char const * argv0 ) { int mib[ 4 ] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; @@ -631,11 +632,11 @@ char * executable_path( char const * argv0 ) return ( !size || size == sizeof( buf ) ) ? NULL : strndup( buf, size ); } #elif defined(__linux__) -#include +# include char * executable_path( char const * argv0 ) { char buf[ 1024 ]; - ssize_t ret = readlink("/proc/self/exe", buf, sizeof(buf)); + ssize_t const ret = readlink( "/proc/self/exe", buf, sizeof( buf ) ); return ( !ret || ret == sizeof( buf ) ) ? NULL : strndup( buf, ret ); } #else diff --git a/v2/engine/timestamp.c b/v2/engine/timestamp.c index 5b1a26441..d5758bcb7 100644 --- a/v2/engine/timestamp.c +++ b/v2/engine/timestamp.c @@ -331,7 +331,7 @@ static void time_enter( void * closure, OBJECT * target, int const found, static void free_timestamps( void * xbinding, void * data ) { - object_free( ((BINDING *)xbinding)->name ); + object_free( ( (BINDING *)xbinding )->name ); }