print_current_time: added leading underscore to variables allocated

inside macros.
This commit is contained in:
Joel Sherrill
1996-08-08 16:53:32 +00:00
parent 66e519c1c1
commit 8b1c1ae6f0
3 changed files with 24 additions and 24 deletions

View File

@@ -65,16 +65,16 @@
#define print_current_time(s1, s2) \ #define print_current_time(s1, s2) \
do { \ do { \
char buffer[32]; \ char _buffer[32]; \
int status; \ int _status; \
struct timespec tv; \ struct timespec _tv; \
\ \
status = clock_gettime( CLOCK_REALTIME, &tv ); \ _status = clock_gettime( CLOCK_REALTIME, &_tv ); \
assert( !status ); \ assert( !_status ); \
\ \
(void) ctime_r( &tv.tv_sec, buffer ); \ (void) ctime_r( &_tv.tv_sec, _buffer ); \
buffer[ strlen( buffer ) - 1 ] = 0; \ _buffer[ strlen( _buffer ) - 1 ] = 0; \
printf( "%s%s%s\n", s1, buffer, s2 ); \ printf( "%s%s%s\n", s1, _buffer, s2 ); \
fflush(stdout); \ fflush(stdout); \
} while ( 0 ) } while ( 0 )

View File

@@ -65,16 +65,16 @@
#define print_current_time(s1, s2) \ #define print_current_time(s1, s2) \
do { \ do { \
char buffer[32]; \ char _buffer[32]; \
int status; \ int _status; \
struct timespec tv; \ struct timespec _tv; \
\ \
status = clock_gettime( CLOCK_REALTIME, &tv ); \ _status = clock_gettime( CLOCK_REALTIME, &_tv ); \
assert( !status ); \ assert( !_status ); \
\ \
(void) ctime_r( &tv.tv_sec, buffer ); \ (void) ctime_r( &_tv.tv_sec, _buffer ); \
buffer[ strlen( buffer ) - 1 ] = 0; \ _buffer[ strlen( _buffer ) - 1 ] = 0; \
printf( "%s%s%s\n", s1, buffer, s2 ); \ printf( "%s%s%s\n", s1, _buffer, s2 ); \
fflush(stdout); \ fflush(stdout); \
} while ( 0 ) } while ( 0 )

View File

@@ -65,16 +65,16 @@
#define print_current_time(s1, s2) \ #define print_current_time(s1, s2) \
do { \ do { \
char buffer[32]; \ char _buffer[32]; \
int status; \ int _status; \
struct timespec tv; \ struct timespec _tv; \
\ \
status = clock_gettime( CLOCK_REALTIME, &tv ); \ _status = clock_gettime( CLOCK_REALTIME, &_tv ); \
assert( !status ); \ assert( !_status ); \
\ \
(void) ctime_r( &tv.tv_sec, buffer ); \ (void) ctime_r( &_tv.tv_sec, _buffer ); \
buffer[ strlen( buffer ) - 1 ] = 0; \ _buffer[ strlen( _buffer ) - 1 ] = 0; \
printf( "%s%s%s\n", s1, buffer, s2 ); \ printf( "%s%s%s\n", s1, _buffer, s2 ); \
fflush(stdout); \ fflush(stdout); \
} while ( 0 ) } while ( 0 )