int make( int n_targets, const char **targets, int anyhow ) { int i; COUNTS counts[1]; int status = 0; /* 1 if anything fails */ #ifdef OPT_HEADER_CACHE_EXT hcache_init(); #endif memset( (char *)counts, 0, sizeof( *counts ) ); for( i = 0; i < n_targets; i++ ) { TARGET *t = bindtarget( targets[i] ); make0( t, 0, 0, counts, anyhow ); } if( DEBUG_MAKE ) { if( counts->targets ) printf( "...found %d target(s)...\n", counts->targets ); if( counts->temp ) printf( "...using %d temp target(s)...\n", counts->temp ); if( counts->updating ) printf( "...updating %d target(s)...\n", counts->updating ); if( counts->cantfind ) printf( "...can't find %d target(s)...\n", counts->cantfind ); if( counts->cantmake ) printf( "...can't make %d target(s)...\n", counts->cantmake ); } #ifdef OPT_HEADER_CACHE_EXT hcache_done(); #endif status = counts->cantfind || counts->cantmake; for( i = 0; i < n_targets; i++ ) status |= make1( bindtarget( targets[i] ) ); return status; }
int main() { scanf("%d %d %d", &n, &A,&B); for(i=1;i<=n;i++) { scanf("%d", &p[i]); if(m==0 || p[i]< m) m=p[i]; } maxint = n; maxint*=A; make1(p[1]); make1(p[1]-1); make1(p[1]+1); make1(p[n]); make1(p[n]-1); make1(p[n]+1); printf("%lld\n", ans); return 0; }
int make( int n_targets, const char **targets, int anyhow ) { int i; COUNTS counts[1]; int status = 0; /* 1 if anything fails */ #ifdef OPT_HEADER_CACHE_EXT hcache_init(); #endif memset( (char *)counts, 0, sizeof( *counts ) ); /* First bind all targets with LOCATE_TARGET setting. This is needed to correctly handle dependencies to generated headers. */ bind_explicitly_located_targets(); { PROFILE_ENTER(MAKE_MAKE0); for( i = 0; i < n_targets; i++ ) { TARGET *t = bindtarget( targets[i] ); make0( t, 0, 0, counts, anyhow ); } PROFILE_EXIT(MAKE_MAKE0); } #ifdef OPT_GRAPH_DEBUG_EXT if( DEBUG_GRAPH ) { for( i = 0; i < n_targets; i++ ) { TARGET *t = bindtarget( targets[i] ); dependGraphOutput( t, 0 ); } } #endif if( DEBUG_MAKE ) { if( counts->targets ) printf( "...found %d target%s...\n", counts->targets, counts->targets > 1 ? "s" : "" ); if( counts->temp ) printf( "...using %d temp target%s...\n", counts->temp, counts->temp > 1 ? "s" : "" ); if( counts->updating ) printf( "...updating %d target%s...\n", counts->updating, counts->updating > 1 ? "s" : "" ); if( counts->cantfind ) printf( "...can't find %d target%s...\n", counts->cantfind, counts->cantfind > 1 ? "s" : "" ); if( counts->cantmake ) printf( "...can't make %d target%s...\n", counts->cantmake, counts->cantmake > 1 ? "s" : "" ); } #ifdef OPT_HEADER_CACHE_EXT hcache_done(); #endif status = counts->cantfind || counts->cantmake; { PROFILE_ENTER(MAKE_MAKE1); for( i = 0; i < n_targets; i++ ) status |= make1( bindtarget( targets[i] ) ); PROFILE_EXIT(MAKE_MAKE1); } return status; }
int make( LIST * targets, int anyhow ) { COUNTS counts[ 1 ]; int status = 0; /* 1 if anything fails */ #ifdef OPT_HEADER_CACHE_EXT hcache_init(); #endif memset( (char *)counts, 0, sizeof( *counts ) ); /* Make sure that the tables are set up correctly. */ exec_init(); /* First bind all targets with LOCATE_TARGET setting. This is needed to * correctly handle dependencies to generated headers. */ bind_explicitly_located_targets(); { LISTITER iter, end; PROFILE_ENTER( MAKE_MAKE0 ); for ( iter = list_begin( targets ), end = list_end( targets ); iter != end; iter = list_next( iter ) ) { TARGET * t = bindtarget( list_item( iter ) ); if ( t->fate == T_FATE_INIT ) make0( t, 0, 0, counts, anyhow, 0 ); } PROFILE_EXIT( MAKE_MAKE0 ); } #ifdef OPT_GRAPH_DEBUG_EXT if ( DEBUG_GRAPH ) { LISTITER iter, end; for ( iter = list_begin( targets ), end = list_end( targets ); iter != end; iter = list_next( iter ) ) dependGraphOutput( bindtarget( list_item( iter ) ), 0 ); } #endif if ( DEBUG_MAKE ) { if ( counts->targets ) out_printf( "...found %d target%s...\n", counts->targets, counts->targets > 1 ? "s" : "" ); if ( counts->temp ) out_printf( "...using %d temp target%s...\n", counts->temp, counts->temp > 1 ? "s" : "" ); if ( counts->updating ) out_printf( "...updating %d target%s...\n", counts->updating, counts->updating > 1 ? "s" : "" ); if ( counts->cantfind ) out_printf( "...can't find %d target%s...\n", counts->cantfind, counts->cantfind > 1 ? "s" : "" ); if ( counts->cantmake ) out_printf( "...can't make %d target%s...\n", counts->cantmake, counts->cantmake > 1 ? "s" : "" ); } status = counts->cantfind || counts->cantmake; { PROFILE_ENTER( MAKE_MAKE1 ); status |= make1( targets ); PROFILE_EXIT( MAKE_MAKE1 ); } return status; }
ClassWithDestructor make2(AddressVector<ClassWithDestructor> &v) { return make1(v); }