diff --git a/src/engine/builtins.cpp b/src/engine/builtins.cpp index 9a008f644..de31784b7 100644 --- a/src/engine/builtins.cpp +++ b/src/engine/builtins.cpp @@ -1227,13 +1227,15 @@ LIST * builtin_import( FRAME * frame, int flags ) source_iter = list_next( source_iter ), target_iter = list_next( target_iter ) ) { - RULE * r; - RULE * imported; + RULE * r = nullptr; + RULE * imported = nullptr; if ( !source_module->rules || !(r = (RULE *)hash_find( source_module->rules, list_item( source_iter ) ) ) ) + { unknown_rule( frame, "IMPORT", source_module, list_item( source_iter ) ); + } imported = import_rule( r, target_module, list_item( target_iter ) ); if ( !list_empty( localize ) ) @@ -1281,10 +1283,12 @@ LIST * builtin_export( FRAME * frame, int flags ) LISTITER const end = list_end( rules ); for ( ; iter != end; iter = list_next( iter ) ) { - RULE * r; + RULE * r = nullptr; if ( !m->rules || !( r = (RULE *)hash_find( m->rules, list_item( iter ) ) ) ) + { unknown_rule( frame, "EXPORT", m, list_item( iter ) ); + } r->exported = 1; } return L0; @@ -1989,7 +1993,7 @@ LIST *builtin_readlink( FRAME * frame, int flags ) { break; } - else if ( len < bufsize ) + else if ( size_t(len) < bufsize ) { buf[ len ] = '\0'; result = list_new( object_new( buf ) ); diff --git a/src/engine/class.cpp b/src/engine/class.cpp index ec71f93ad..8d1727f10 100644 --- a/src/engine/class.cpp +++ b/src/engine/class.cpp @@ -129,7 +129,6 @@ OBJECT * make_class_module( LIST * xname, LIST * bases, FRAME * frame ) OBJECT * name = class_module_name( list_front( xname ) ); OBJECT * * pp; module_t * class_module = 0; - module_t * outer_module = frame->module; int found; if ( !classes ) diff --git a/src/engine/debugger.cpp b/src/engine/debugger.cpp index 66aa85cdd..40e9290b0 100644 --- a/src/engine/debugger.cpp +++ b/src/engine/debugger.cpp @@ -341,7 +341,6 @@ static OBJECT * get_filename( OBJECT * path ) PATHNAME path1[ 1 ]; string buf[ 1 ]; OBJECT * result; - const char * root = object_str( cwd() ); path_parse( object_str( path ), path1 ); path1->f_dir.ptr = NULL; path1->f_dir.len = 0; @@ -415,35 +414,6 @@ static void debug_print_source( OBJECT * filename, int line ) } } -static void debug_print_frame( FRAME * frame ) -{ - OBJECT * file = frame->file; - if ( file == NULL ) file = constant_builtin; - printf( "%s ", frame->rulename ); - if ( strcmp( frame->rulename, "module scope" ) != 0 ) - { - printf( "( " ); - if ( frame->args->count ) - { - lol_print( frame->args ); - printf( " " ); - } - printf( ") " ); - } - printf( "at %s:%d", object_str( file ), frame->line ); -} - -static void debug_mi_print_frame( FRAME * frame ) -{ - OBJECT * fullname = make_absolute_path( frame->file ); - printf( "frame={func=\"%s\",args=[],file=\"%s\",fullname=\"%s\",line=\"%d\"}", - frame->rulename, - object_str( frame->file ), - object_str( fullname ), - frame->line ); - object_free( fullname ); -} - static void debug_print_frame_info( FRAME_INFO * frame ) { OBJECT * file = frame->file; @@ -768,7 +738,6 @@ static void debug_child_info( int argc, const char * * argv ) { int frame_number = debug_selected_frame_number; int i; - OBJECT * fullname; FRAME base = *debug_frame; FRAME * frame = &base; base.file = debug_file; @@ -924,7 +893,7 @@ static void debug_parent_child_exited( int pid, int exit_code ) static void debug_parent_child_signalled( int pid, int sigid ) { - + if ( debug_interface == DEBUG_INTERFACE_CONSOLE ) { printf( "Child %d exited on signal %d\n", child_pid, sigid ); @@ -1071,7 +1040,7 @@ void debug_init_handles( const char * in, const char * out ) sscanf( in, "%p", &read_handle ); read_fd = _open_osfhandle( (intptr_t)read_handle, _O_RDONLY ); command_input = _fdopen( read_fd, "r" ); - + sscanf( out, "%p", &write_handle ); write_fd = _open_osfhandle( (intptr_t)write_handle, _O_WRONLY ); command_output = _fdopen( write_fd, "w" ); @@ -1221,7 +1190,6 @@ static void debug_start_child( int argc, const char * * argv ) int write_fd; int read_fd; int pid; - int i; assert( debug_state == DEBUG_NO_CHILD ); if (pipe(pipe1) == -1) { @@ -1538,7 +1506,7 @@ static void debug_parent_clear( int argc, const char * * argv ) { printf( "Deleted breakpoint %d\n", id ); } - + sprintf( buf, "%d", id ); new_args[ 0 ] = "delete"; new_args[ 1 ] = buf; @@ -1578,7 +1546,7 @@ static void debug_parent_backtrace( int argc, const char * * argv ) int depth; int i; FRAME_INFO frame; - + if ( debug_state == DEBUG_NO_CHILD ) { debug_error( "The program is not being run." ); @@ -1622,7 +1590,7 @@ static void debug_parent_quit( int argc, const char * * argv ) static const char * const help_text[][2] = { { - "run", + "run", "run \n" "Creates a new b2 child process passing on the command line." " Terminates\nthe current child (if any).\n" @@ -1834,7 +1802,7 @@ static void debug_mi_format_breakpoint( int id ) } /* fullname */ /* times */ - printf( "" ); + // printf( "" ); printf( "}" ); } @@ -1846,58 +1814,32 @@ static int breakpoint_id_parse( const char * name ) return id; } -static void debug_mi_break_after( int argc, const char * * argv ) -{ - int id; - int count; - --argc; - ++argv; - if ( argc > 0 && strcmp( argv[ 0 ], "--" ) == 0 ) - { - ++argv; - --argc; - } - if ( argc < 2 ) - { - debug_mi_error( "not enough arguments for -break-after." ); - return; - } - else if ( argc > 2 ) - { - debug_mi_error( "too many arguments for -break-after." ); - return; - } - id = atoi( argv[ 0 ] ); - count = atoi( argv[ 1 ] ); - /* FIXME: set ignore count */ -} - static void debug_mi_break_insert( int argc, const char * * argv ) { const char * inner_argv[ 2 ]; - int temporary = 0; /* FIXME: not supported yet */ - int hardware = 0; /* unsupported */ - int force = 1; /* We don't have global debug information... */ + // int temporary = 0; /* FIXME: not supported yet */ + // int hardware = 0; /* unsupported */ + // int force = 1; /* We don't have global debug information... */ int disabled = 0; - int tracepoint = 0; /* unsupported */ - int thread_id = 0; - int ignore_count = 0; - const char * condition; /* FIXME: not supported yet */ + // int tracepoint = 0; /* unsupported */ + // int thread_id = 0; + // int ignore_count = 0; + // const char * condition; /* FIXME: not supported yet */ const char * location; int id; for ( --argc, ++argv; argc; --argc, ++argv ) { if ( strcmp( *argv, "-t" ) == 0 ) { - temporary = 1; + // temporary = 1; } else if ( strcmp( *argv, "-h" ) == 0 ) { - hardware = 1; + // hardware = 1; } else if ( strcmp( *argv, "-f" ) == 0 ) { - force = 1; + // force = 1; } else if ( strcmp( *argv, "-d" ) == 0 ) { @@ -1905,7 +1847,7 @@ static void debug_mi_break_insert( int argc, const char * * argv ) } else if ( strcmp( *argv, "-a" ) == 0 ) { - tracepoint = 1; + // tracepoint = 1; } else if ( strcmp( *argv, "-c" ) == 0 ) { @@ -1915,7 +1857,7 @@ static void debug_mi_break_insert( int argc, const char * * argv ) return; } - condition = argv[ 1 ]; + // condition = argv[ 1 ]; --argc; ++argv; } @@ -1927,7 +1869,7 @@ static void debug_mi_break_insert( int argc, const char * * argv ) return; } - ignore_count = atoi( argv[ 1 ] ); + // ignore_count = atoi( argv[ 1 ] ); --argc; ++argv; } @@ -1939,7 +1881,7 @@ static void debug_mi_break_insert( int argc, const char * * argv ) return; } - thread_id = atoi( argv[ 1 ] ); + // thread_id = atoi( argv[ 1 ] ); --argc; ++argv; } @@ -2130,7 +2072,7 @@ static void debug_mi_break_list( int argc, const char * * argv ) debug_mi_error( "Too many arguments for -break-list" ); return; } - + number = 0; for ( i = 0; i < num_breakpoints; ++i ) if ( breakpoints[ i ].status != BREAKPOINT_DELETED ) @@ -2295,7 +2237,6 @@ static void debug_mi_stack_info_frame( int argc, const char * * argv ) static void debug_mi_stack_list_variables( int argc, const char * * argv ) { - int print_values = 0; #define DEBUG_PRINT_VARIABLES_NO_VALUES 1 #define DEBUG_PRINT_VARIABLES_ALL_VALUES 2 #define DEBUG_PRINT_VARIABLES_SIMPLE_VALUES 3 @@ -2317,15 +2258,15 @@ static void debug_mi_stack_list_variables( int argc, const char * * argv ) } else if ( strcmp( *argv, "--no-values" ) == 0 ) { - print_values = DEBUG_PRINT_VARIABLES_NO_VALUES; + // print_values = DEBUG_PRINT_VARIABLES_NO_VALUES; } else if ( strcmp( *argv, "--all-values" ) == 0 ) { - print_values = DEBUG_PRINT_VARIABLES_ALL_VALUES; + // print_values = DEBUG_PRINT_VARIABLES_ALL_VALUES; } else if ( strcmp( *argv, "--simple-values" ) == 0 ) { - print_values = DEBUG_PRINT_VARIABLES_SIMPLE_VALUES; + // print_values = DEBUG_PRINT_VARIABLES_SIMPLE_VALUES; } else if ( strcmp( *argv, "--" ) == 0 ) { @@ -2350,7 +2291,7 @@ static void debug_mi_stack_list_variables( int argc, const char * * argv ) printf( "^error,msg=\"Too many arguments for -stack-list-variables\"\n(gdb) \n" ); return; } - + { LIST * vars; LISTITER iter, end; @@ -2394,7 +2335,6 @@ static void debug_mi_stack_list_variables( int argc, const char * * argv ) static void debug_mi_stack_list_locals( int argc, const char * * argv ) { - int print_values = 0; #define DEBUG_PRINT_VARIABLES_NO_VALUES 1 #define DEBUG_PRINT_VARIABLES_ALL_VALUES 2 #define DEBUG_PRINT_VARIABLES_SIMPLE_VALUES 3 @@ -2422,15 +2362,15 @@ static void debug_mi_stack_list_locals( int argc, const char * * argv ) } else if ( strcmp( *argv, "--no-values" ) == 0 ) { - print_values = DEBUG_PRINT_VARIABLES_NO_VALUES; + // print_values = DEBUG_PRINT_VARIABLES_NO_VALUES; } else if ( strcmp( *argv, "--all-values" ) == 0 ) { - print_values = DEBUG_PRINT_VARIABLES_ALL_VALUES; + // print_values = DEBUG_PRINT_VARIABLES_ALL_VALUES; } else if ( strcmp( *argv, "--simple-values" ) == 0 ) { - print_values = DEBUG_PRINT_VARIABLES_SIMPLE_VALUES; + // print_values = DEBUG_PRINT_VARIABLES_SIMPLE_VALUES; } else if ( strcmp( *argv, "--" ) == 0 ) { @@ -2455,7 +2395,7 @@ static void debug_mi_stack_list_locals( int argc, const char * * argv ) printf( "^error,msg=\"Too many arguments for -stack-list-variables\"\n(gdb) \n" ); return; } - + { LIST * vars; LISTITER iter, end; @@ -2499,10 +2439,9 @@ static void debug_mi_stack_list_locals( int argc, const char * * argv ) static void debug_mi_stack_list_frames( int argc, const char * * argv ) { - const char * new_args[ 3 ]; int depth; int i; - + if ( debug_state == DEBUG_NO_CHILD ) { debug_mi_format_token(); @@ -2510,9 +2449,6 @@ static void debug_mi_stack_list_frames( int argc, const char * * argv ) return; } - new_args[ 0 ] = "info"; - new_args[ 1 ] = "frame"; - fprintf( command_output, "info depth\n" ); fflush( command_output ); depth = debug_int_read( command_child ); diff --git a/src/engine/execcmd.cpp b/src/engine/execcmd.cpp index 37584d50e..8e6ec4f50 100644 --- a/src/engine/execcmd.cpp +++ b/src/engine/execcmd.cpp @@ -74,7 +74,7 @@ void argv_from_shell( char const * * argv, LIST * shell, char const * command, /* Returns whether the given command string contains lines longer than the given * maximum. */ -int check_cmd_for_too_long_lines( char const * command, int const max, +int check_cmd_for_too_long_lines( char const * command, size_t max, int * const error_length, int * const error_max_length ) { while ( *command ) diff --git a/src/engine/execcmd.h b/src/engine/execcmd.h index bea3df6e3..b39e8ae2d 100644 --- a/src/engine/execcmd.h +++ b/src/engine/execcmd.h @@ -109,7 +109,7 @@ int is_raw_command_request( LIST * shell ); /* Utility worker for exec_check() checking whether all the given command lines * are under the specified length limit. */ -int check_cmd_for_too_long_lines( char const * command, int const max, +int check_cmd_for_too_long_lines( char const * command, size_t max, int * const error_length, int * const error_max_length ); #endif diff --git a/src/engine/execunix.cpp b/src/engine/execunix.cpp index 26076dff9..2740743c7 100644 --- a/src/engine/execunix.cpp +++ b/src/engine/execunix.cpp @@ -184,7 +184,6 @@ void exec_cmd int const slot = get_free_cmdtab_slot(); int out[ 2 ]; int err[ 2 ]; - int len; char const * argv[ MAXARGC + 1 ]; /* +1 for NULL */ /* Initialize default shell. */ @@ -460,8 +459,6 @@ void exec_wait() while ( !finished ) { int i; - struct timeval tv; - struct timeval * ptv = NULL; int select_timeout = globs.timeout; /* Check for timeouts: @@ -485,14 +482,6 @@ void exec_wait() else if ( globs.timeout - consumed < select_timeout ) select_timeout = globs.timeout - consumed; } - - /* If nothing else causes our select() call to exit, force it after - * however long it takes for the next one of our child processes to - * crossed its allotted processing time so we can terminate it. - */ - tv.tv_sec = select_timeout; - tv.tv_usec = 0; - ptv = &tv; } /* select() will wait for I/O on a descriptor, a signal, or timeout. */ diff --git a/src/engine/filesys.cpp b/src/engine/filesys.cpp index f64eeb28e..c4b0756dc 100644 --- a/src/engine/filesys.cpp +++ b/src/engine/filesys.cpp @@ -634,8 +634,6 @@ int filelist_length( FILELIST * list ) void filelist_free( FILELIST * list ) { - FILELISTITER iter; - if ( filelist_empty( list ) ) return; while ( filelist_length( list ) ) filelist_pop_front( list ); diff --git a/src/engine/fileunix.cpp b/src/engine/fileunix.cpp index 50c2c67d6..4c1b6adf3 100644 --- a/src/engine/fileunix.cpp +++ b/src/engine/fileunix.cpp @@ -228,7 +228,6 @@ void file_archscan( char const * arch, scanback func, void * closure ) for ( ; iter != end ; iter = filelist_next( iter ) ) { file_info_t * member_file = filelist_item( iter ); - LIST * symbols = member_file->files; /* Construct member path: 'archive-path(member-name)' */ @@ -308,7 +307,8 @@ int file_collect_archive_content_( file_archive_info_t * const archive ) char * src; char * dest; - strncpy( lar_name, ar_hdr.ar_name, sizeof( ar_hdr.ar_name ) ); + size_t ar_hdr_name_size = sizeof( ar_hdr.ar_name ); // Workaround for sizeof strncpy warning. + strncpy( lar_name, ar_hdr.ar_name, ar_hdr_name_size ); sscanf( ar_hdr.ar_date, "%ld", &lar_date ); sscanf( ar_hdr.ar_size, "%ld", &lar_size ); diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 8996f2705..805a5f590 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -34,7 +34,7 @@ #ifndef FUNCTION_DEBUG_PROFILE #undef PROFILE_ENTER_LOCAL -#define PROFILE_ENTER_LOCAL(x) static int unused_LOCAL_##x = 0 +#define PROFILE_ENTER_LOCAL(x) while (false) #undef PROFILE_EXIT_LOCAL #define PROFILE_EXIT_LOCAL(x) #endif @@ -502,7 +502,6 @@ static LIST * function_call_member_rule( JAM_FUNCTION * function, FRAME * frame, int i; LIST * first = stack_pop( s ); LIST * result = L0; - LIST * trailing; RULE * rule; module_t * module; OBJECT * real_rulename = 0; @@ -773,31 +772,6 @@ static void var_edit_file( char const * in, string * out, VAR_EDITS * edits ) } -/* - * var_edit_translate_path() - translate path to os native format. - */ - -static void var_edit_translate_path( string * out, size_t pos, VAR_EDITS * edits ) -{ - if ( edits->to_windows ) - { - string result[ 1 ]; - int translated; - - /* Translate path to os native format. */ - translated = path_translate_to_os( out->value + pos, result ); - if ( translated ) - { - string_truncate( out, pos ); - string_append( out, result->value ); - edits->to_slashes = 0; - } - - string_free( result ); - } -} - - /* * var_edit_shift() - do upshift/downshift & other mods. */ @@ -2422,17 +2396,6 @@ static void adjust_result( compiler * c, int actual_location, assert( !"invalid result location" ); } -static char const * parse_type( PARSE * parse ) -{ - switch ( parse->type ) - { - case PARSE_APPEND: return "append"; - case PARSE_EVAL: return "eval"; - case PARSE_RULES: return "rules"; - default: return "unknown"; - } -} - static void compile_append_chain( PARSE * parse, compiler * c ) { assert( parse->type == PARSE_APPEND ); @@ -3135,7 +3098,6 @@ void argument_list_check( struct arg_list * formal, int formal_count, for ( j = 0; j < formal[ i ].size; ++j ) { struct argument * formal_arg = &formal[ i ].args[ j ]; - LIST * value; switch ( formal_arg->flags ) { @@ -3149,9 +3111,7 @@ void argument_list_check( struct arg_list * formal, int formal_count, actual_iter = list_next( actual_iter ); break; case ARG_OPTIONAL: - if ( actual_iter == actual_end ) - value = L0; - else + if ( actual_iter != actual_end ) { type_check_range( formal_arg->type_name, actual_iter, list_next( actual_iter ), frame, function, @@ -3851,11 +3811,15 @@ struct align_expansion_item expansion_item e; }; -static char check_align_var_edits[ sizeof(struct align_var_edits) <= sizeof(VAR_EDITS) + sizeof(void *) ? 1 : -1 ]; -static char check_align_expansion_item[ sizeof(struct align_expansion_item) <= sizeof(expansion_item) + sizeof(void *) ? 1 : -1 ]; +static_assert( + sizeof(struct align_var_edits) <= sizeof(VAR_EDITS) + sizeof(void *), + "sizeof(struct align_var_edits) <= sizeof(VAR_EDITS) + sizeof(void *)" ); +static_assert( + sizeof(struct align_expansion_item) <= sizeof(expansion_item) + sizeof(void *), + "sizeof(struct align_expansion_item) <= sizeof(expansion_item) + sizeof(void *)" ); -static char check_ptr_size1[ sizeof(LIST *) <= sizeof(void *) ? 1 : -1 ]; -static char check_ptr_size2[ sizeof(char *) <= sizeof(void *) ? 1 : -1 ]; +static_assert( sizeof(LIST *) <= sizeof(void *), "sizeof(LIST *) <= sizeof(void *)" ); +static_assert( sizeof(char *) <= sizeof(void *), "sizeof(char *) <= sizeof(void *)" ); void function_run_actions( FUNCTION * function, FRAME * frame, STACK * s, string * out ) diff --git a/src/engine/jam.cpp b/src/engine/jam.cpp index b038df033..255f500b5 100644 --- a/src/engine/jam.cpp +++ b/src/engine/jam.cpp @@ -265,7 +265,6 @@ int main( int argc, char * * argv, char * * arg_environ ) int n; char * s; struct bjam_option optv[ N_OPTS ]; - char const * all = "all"; int status; int arg_c = argc; char * * arg_v = argv; diff --git a/src/engine/jam_strings.cpp b/src/engine/jam_strings.cpp index 01d39469d..5094c5e2b 100644 --- a/src/engine/jam_strings.cpp +++ b/src/engine/jam_strings.cpp @@ -74,7 +74,8 @@ static void string_reserve_internal( string * self, size_t capacity ) self->value = (char *)BJAM_MALLOC_ATOMIC( capacity + JAM_STRING_MAGIC_SIZE ); self->value[ 0 ] = 0; - strncat( self->value, self->opt, sizeof(self->opt) ); + size_t opt_size = sizeof(self->opt); // Workaround sizeof in strncat warning. + strncat( self->value, self->opt, opt_size ); assert( strlen( self->value ) <= self->capacity && "Regression test" ); } else @@ -99,19 +100,6 @@ void string_reserve( string * self, size_t capacity ) } -static void extend_full( string * self, char const * start, char const * finish ) -{ - size_t new_size = self->capacity + ( finish - start ); - size_t new_capacity = self->capacity; - size_t old_size = self->capacity; - while ( new_capacity < new_size + 1) - new_capacity <<= 1; - string_reserve_internal( self, new_capacity ); - memcpy( self->value + old_size, start, new_size - old_size ); - self->value[ new_size ] = 0; - self->size = new_size; -} - static void maybe_reserve( string * self, size_t new_size ) { size_t capacity = self->capacity; @@ -203,7 +191,7 @@ void string_unit_test() { { string s[ 1 ]; - int i; + unsigned int i; int const limit = sizeof( s->opt ) * 2 + 2; string_new( s ); assert( s->value == s->opt ); diff --git a/src/engine/lists.cpp b/src/engine/lists.cpp index 065145e00..af602b504 100644 --- a/src/engine/lists.cpp +++ b/src/engine/lists.cpp @@ -64,7 +64,7 @@ LIST * list_append( LIST * l, LIST * nl ) return nl; if ( !list_empty( nl ) ) { - int const l_size = list_length( l ); + unsigned int const l_size = list_length( l ); int const nl_size = list_length( nl ); int const size = l_size + nl_size; unsigned const bucket = get_bucket( size ); @@ -112,7 +112,6 @@ LIST * list_new( OBJECT * value ) LIST * list_push_back( LIST * head, OBJECT * value ) { unsigned int size = list_length( head ); - unsigned int i; if ( DEBUG_LISTS ) out_printf( "list > %s <\n", object_str( value ) ); @@ -199,7 +198,6 @@ static int str_ptr_compare( void const * va, void const * vb ) LIST * list_sort( LIST * l ) { int len; - int ii; LIST * result; if ( !l ) @@ -367,7 +365,7 @@ LIST * list_unique( LIST * sorted_list ) void list_done() { - int i; + unsigned int i; for ( i = 0; i < sizeof( freelist ) / sizeof( freelist[ 0 ] ); ++i ) { LIST * l = freelist[ i ]; diff --git a/src/engine/make1.cpp b/src/engine/make1.cpp index c5d3f5955..61f0614a1 100644 --- a/src/engine/make1.cpp +++ b/src/engine/make1.cpp @@ -62,8 +62,6 @@ static CMD * make1cmds ( TARGET * ); static LIST * make1list ( LIST *, TARGETS *, int flags ); static SETTINGS * make1settings ( struct module_t *, LIST * vars ); static void make1bind ( TARGET * ); -static TARGET * make1findcycle ( TARGET * ); -static void make1breakcycle( TARGET *, TARGET * cycle_root ); static void push_cmds( CMDLIST * cmds, int status ); static int cmd_sem_lock( TARGET * t ); static void cmd_sem_unlock( TARGET * t ); @@ -205,7 +203,7 @@ int make1( LIST * targets ) int status = 0; memset( (char *)counts, 0, sizeof( *counts ) ); - + { LISTITER iter, end; stack temp_stack = { NULL }; @@ -598,8 +596,6 @@ static void make1c( state const * const pState ) } else { - ACTIONS * actions; - /* Tally success/failure for those we tried to update. */ if ( t->progress == T_MAKE_RUNNING ) { @@ -884,7 +880,6 @@ static void make1c_closure CMD * const cmd = (CMD *)t->cmds; char const * rule_name = 0; char const * target_name = 0; - int print_buffer = 0; assert( cmd ); @@ -1287,7 +1282,6 @@ static CMD * make1cmds( TARGET * t ) TARGET * sem = targets_iter->target->semaphore; if ( sem ) { - TARGETS * semiter; if ( ! targets_contains( semaphores, sem ) ) semaphores = targetentry( semaphores, sem ); } diff --git a/src/engine/modules/order.cpp b/src/engine/modules/order.cpp index c5ebeba06..38209b889 100644 --- a/src/engine/modules/order.cpp +++ b/src/engine/modules/order.cpp @@ -127,7 +127,6 @@ LIST * order( FRAME * frame, int flags ) { int i; LISTITER iter = list_begin( arg ); - LISTITER const end = list_end( arg ); for ( i = 0; i < order[ index ]; ++i, iter = list_next( iter ) ); result = list_push_back( result, object_copy( list_item( iter ) ) ); } diff --git a/src/engine/modules/property-set.cpp b/src/engine/modules/property-set.cpp index 20b37694f..400859723 100644 --- a/src/engine/modules/property-set.cpp +++ b/src/engine/modules/property-set.cpp @@ -267,7 +267,6 @@ LIST * property_set_contains_features( FRAME * frame, int flags ) OBJECT * varname = object_new( "self.raw" ); LIST * props = var_get( frame->module, varname ); LIST * features = lol_get( frame->args, 0 ); - LIST * result = L0; LISTITER features_iter = list_begin( features ); LISTITER features_end = list_end( features ) ; object_free( varname ); diff --git a/src/engine/modules/sequence.cpp b/src/engine/modules/sequence.cpp index 08ed30599..cece2cd5b 100644 --- a/src/engine/modules/sequence.cpp +++ b/src/engine/modules/sequence.cpp @@ -43,7 +43,6 @@ LIST * sequence_select_highest_ranked( FRAME * frame, int flags ) LISTITER iter = list_begin( rank ); LISTITER const end = list_end( rank ); LISTITER elements_iter = list_begin( elements ); - LISTITER const elements_end = list_end( elements ); for ( ; iter != end; iter = list_next( iter ), elements_iter = list_next( elements_iter ) ) if ( atoi( object_str( list_item( iter ) ) ) == highest_rank ) diff --git a/src/engine/scan.cpp b/src/engine/scan.cpp index 9ca3310c6..37fc5a1dc 100644 --- a/src/engine/scan.cpp +++ b/src/engine/scan.cpp @@ -237,7 +237,6 @@ int yypeek() #define yyprev() ( incp->string-- ) static int use_new_scanner = 0; -static int expect_whitespace; #define yystartkeyword() if(use_new_scanner) break; else token_warning() #define yyendkeyword() if(use_new_scanner) break; else if ( 1 ) { expect_whitespace = 1; continue; } else (void)0 diff --git a/src/engine/timestamp.cpp b/src/engine/timestamp.cpp index c998730be..af9779fa5 100644 --- a/src/engine/timestamp.cpp +++ b/src/engine/timestamp.cpp @@ -19,8 +19,6 @@ * timestamp_done() - free timestamp tables * * Internal routines: - * time_enter() - internal worker callback for scanning archives & - * directories * free_timestamps() - worker function for freeing timestamp table contents */ @@ -60,18 +58,6 @@ typedef struct _binding static struct hash * bindhash = 0; -static void time_enter( void *, OBJECT *, int const found, - timestamp const * const ); - -static const char * time_progress[] = -{ - "INIT", - "NOENTRY", - "SPOTTED", - "MISSING", - "FOUND" -}; - #ifdef OS_NT /* @@ -162,13 +148,6 @@ void timestamp_from_path( timestamp * const time, OBJECT * const path ) { PROFILE_ENTER( timestamp ); - PATHNAME f1; - PATHNAME f2; - int found; - BINDING * b; - string buf[ 1 ]; - - if ( file_time( path, time ) < 0 ) timestamp_clear( time ); @@ -218,37 +197,6 @@ char const * timestamp_timestr( timestamp const * const time ) } -/* - * time_enter() - internal worker callback for scanning archives & directories - */ - -static void time_enter( void * closure, OBJECT * target, int const found, - timestamp const * const time ) -{ - int item_found; - BINDING * b; - struct hash * const bindhash = (struct hash *)closure; - - target = path_as_key( target ); - - b = (BINDING *)hash_insert( bindhash, target, &item_found ); - if ( !item_found ) - { - b->name = object_copy( target ); - b->flags = 0; - } - - timestamp_copy( &b->time, time ); - b->progress = found ? BIND_FOUND : BIND_SPOTTED; - - if ( DEBUG_BINDSCAN ) - out_printf( "time ( %s ) : %s\n", object_str( target ), time_progress[ - b->progress ] ); - - object_free( target ); -} - - /* * free_timestamps() - worker function for freeing timestamp table contents */ diff --git a/src/engine/yyacc.cpp b/src/engine/yyacc.cpp index b5efc96b5..1ff3223f0 100644 --- a/src/engine/yyacc.cpp +++ b/src/engine/yyacc.cpp @@ -196,13 +196,13 @@ int main(int argc, char ** argv) return result; } -static char * usage[] = { +static const char * usage[] = { "yyacc ", 0 }; void print_usage() { - char ** u; + const char ** u; for (u = usage; *u != 0; ++u) { fputs(*u,stderr); putc('\n',stderr); @@ -220,7 +220,7 @@ char * copy_string(char * s, int l) char * tokenize_string(char * s) { char * result; - char * literal = s; + const char * literal = s; int l; int c;