@@ -1385,7 +1385,7 @@ void solve_subproblems(){
13851385static void print_final_solution (char * inst ){
13861386 printf ("--------------------------------\n" );
13871387 printf ("Solution: " );
1388- for (int i = 0 ;i < USED (VEC_SOLUTION );i ++ ){
1388+ for (size_t i = 0 ;i < USED (VEC_SOLUTION );i ++ ){
13891389 printf ("%d " ,ITEM (VEC_SOLUTION ,i ));
13901390 }
13911391 printf ("\n" );
@@ -1488,7 +1488,7 @@ void check_consistance(){
14881488 assert (!domed (CFG [i ]));
14891489 }
14901490 int level = -1 ;
1491- for (int idx = 0 ;idx < USED (BRA_STK );idx ++ ){
1491+ for (size_t idx = 0 ;idx < USED (BRA_STK );idx ++ ){
14921492 if (ITEM (BRA_STK ,idx )== NONE ){
14931493 level ++ ;
14941494 }else if (idx <=BRAIDX [level ])
@@ -1596,6 +1596,12 @@ void cleanup(){
15961596 }
15971597}
15981598
1599+
1600+ void handler (int sig ) {
1601+ cleanup ();
1602+ exit (sig );
1603+ }
1604+
15991605#ifdef _WIN32
16001606static BOOL WINAPI win32_handler (DWORD signal ) {
16011607 if (signal == CTRL_C_EVENT ) {
@@ -1614,12 +1620,8 @@ static void setup_signal_handler(void (*handler_fn)(int)) {
16141620}
16151621#endif
16161622
1617- void handler (int sig ) {
1618- cleanup ();
1619- exit (sig );
1620- }
16211623
1622- struct Result * emos_main (int * edges , int n , int nb_edge ) {
1624+ struct Result * emos_main (unsigned int * edges , int n , int nb_edge ) {
16231625
16241626 // Set the signal handler
16251627 setup_signal_handler (handler );
@@ -1644,7 +1646,7 @@ struct Result* emos_main(int* edges, int n, int nb_edge) {
16441646
16451647 // Get the results
16461648 int * dominating_set = (int * )malloc (USED (VEC_SOLUTION ) * sizeof (int ));
1647- for (int i = 0 ; i < USED (VEC_SOLUTION ); i ++ ) {
1649+ for (size_t i = 0 ; i < USED (VEC_SOLUTION ); i ++ ) {
16481650 dominating_set [i ] = ITEM (VEC_SOLUTION , i );
16491651 }
16501652
@@ -1675,22 +1677,4 @@ void free_results(struct Result* result) {
16751677 free (result );
16761678 }
16771679}
1678-
1679- /** int main(int argc, char *argv[]) {
1680-
1681- print_compile_options();
1682- parse_parmerters(argc,argv);
1683- if(read_instance(argv[1])) {
1684- initialize();
1685- #ifndef NOR
1686- reduce_graph();
1687- #endif
1688- partition_oneproblem();
1689- solve_subproblems();
1690- check_final_solution();
1691- print_final_solution(getInstanceName(argv[1]));
1692- printf("### %s pruning rate %0.2lf total %llu pruned %llu\n",getInstanceName(argv[1]), (total_branches-pruned_branches)/((double)total_branches),total_branches,total_branches-pruned_branches);
1693- }
1694- return 0;
1695- } */
16961680
0 commit comments