diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-07-02 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-07-02 08:01:00 -0700 |
commit | 303baf27cf34c2a57db97c4c567fd744241fa14b (patch) | |
tree | d6235cca48e7bdfe5884e517058c7791e66bb806 /src/misc/espresso | |
parent | fa67e3c19e27c011517b91182eb3929412aaf402 (diff) | |
download | abc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.gz abc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.bz2 abc-303baf27cf34c2a57db97c4c567fd744241fa14b.zip |
Version abc80702
Diffstat (limited to 'src/misc/espresso')
-rw-r--r-- | src/misc/espresso/cofactor.c | 6 | ||||
-rw-r--r-- | src/misc/espresso/contain.c | 8 | ||||
-rw-r--r-- | src/misc/espresso/cvrin.c | 3 | ||||
-rw-r--r-- | src/misc/espresso/cvrm.c | 2 | ||||
-rw-r--r-- | src/misc/espresso/cvrout.c | 8 | ||||
-rw-r--r-- | src/misc/espresso/equiv.c | 2 | ||||
-rw-r--r-- | src/misc/espresso/espresso.h | 48 | ||||
-rw-r--r-- | src/misc/espresso/expand.c | 12 | ||||
-rw-r--r-- | src/misc/espresso/gimpel.c | 5 | ||||
-rw-r--r-- | src/misc/espresso/globals.c | 42 | ||||
-rw-r--r-- | src/misc/espresso/hack.c | 14 | ||||
-rw-r--r-- | src/misc/espresso/irred.c | 4 | ||||
-rw-r--r-- | src/misc/espresso/map.c | 42 | ||||
-rw-r--r-- | src/misc/espresso/opo.c | 2 | ||||
-rw-r--r-- | src/misc/espresso/pair.c | 25 | ||||
-rw-r--r-- | src/misc/espresso/set.c | 2 | ||||
-rw-r--r-- | src/misc/espresso/setc.c | 22 | ||||
-rw-r--r-- | src/misc/espresso/verify.c | 2 |
18 files changed, 131 insertions, 118 deletions
diff --git a/src/misc/espresso/cofactor.c b/src/misc/espresso/cofactor.c index b851a639..1a2c6e8a 100644 --- a/src/misc/espresso/cofactor.c +++ b/src/misc/espresso/cofactor.c @@ -143,7 +143,7 @@ IN pcube *T; register pcube p, cof = T[0], full = cube.fullset; for(T1 = T+2; (p = *T1++) != NULL; ) for(i = LOOP(p); i > 0; i--) - if (val = full[i] & ~ (p[i] | cof[i])) { + if ((val = full[i] & ~ (p[i] | cof[i]))) { cnt = count + ((i-1) << LOGBPI); #if BPI == 32 if (val & 0xFF000000) { @@ -230,6 +230,7 @@ IN pcube *T; best = var, mostactive = active, mostzero = cdata.var_zeros[best], mostbalanced = maxactive; else if (active == mostactive) + { /* secondary condition is to maximize the number zeros */ /* for binary variables, this is the same as minimum # of 2's */ if (cdata.var_zeros[var] > mostzero) @@ -240,6 +241,7 @@ IN pcube *T; /* for binary vars, this means roughly equal # 0's and 1's */ if (maxactive < mostbalanced) best = var, mostbalanced = maxactive; + } cdata.parts_active[var] = active; cdata.is_unate[var] = (active == 1); @@ -358,7 +360,7 @@ pcube *A1; return A; } -simplify_cubelist(T) +void simplify_cubelist(T) pcube *T; { register pcube *Tdest; diff --git a/src/misc/espresso/contain.c b/src/misc/espresso/contain.c index 180dceb6..710c4894 100644 --- a/src/misc/espresso/contain.c +++ b/src/misc/espresso/contain.c @@ -211,7 +211,9 @@ IN int (*compare)(); int rm_contain(A1) INOUT pset *A1; /* updated in place */ { - register pset *pa, *pb, *pcheck, a, b; + register pset *pa, *pb; + register pset *pcheck = NULL; // Suppress "might be used uninitialized" + register pset a, b; pset *pdest = A1; int last_size = -1; @@ -239,7 +241,9 @@ INOUT pset *A1; /* updated in place */ int rm_rev_contain(A1) INOUT pset *A1; /* updated in place */ { - register pset *pa, *pb, *pcheck, a, b; + register pset *pa, *pb; + register pset *pcheck = NULL; // Suppress "might be used uninitialized" + register pset a, b; pset *pdest = A1; int last_size = -1; diff --git a/src/misc/espresso/cvrin.c b/src/misc/espresso/cvrin.c index 7790b38b..d33db46a 100644 --- a/src/misc/espresso/cvrin.c +++ b/src/misc/espresso/cvrin.c @@ -12,6 +12,7 @@ purpose: cube and cover input routines */ +#include <ctype.h> #include "espresso.h" static bool line_length_error; @@ -658,7 +659,7 @@ pPLA new_PLA() } -PLA_labels(PLA) +void PLA_labels(PLA) pPLA PLA; { int i; diff --git a/src/misc/espresso/cvrm.c b/src/misc/espresso/cvrm.c index 7d42d6e3..f55178e8 100644 --- a/src/misc/espresso/cvrm.c +++ b/src/misc/espresso/cvrm.c @@ -357,7 +357,7 @@ int i; * * Each function returns TRUE if process is to continue */ -foreach_output_function(PLA, func, func1) +void foreach_output_function(PLA, func, func1) pPLA PLA; int (*func)(); int (*func1)(); diff --git a/src/misc/espresso/cvrout.c b/src/misc/espresso/cvrout.c index 4bd1c53b..60b9d9e8 100644 --- a/src/misc/espresso/cvrout.c +++ b/src/misc/espresso/cvrout.c @@ -428,7 +428,7 @@ pcover T; } -int makeup_labels(PLA) +void makeup_labels(PLA) pPLA PLA; { int var, i, ind; @@ -453,7 +453,7 @@ pPLA PLA; } -kiss_output(fp, PLA) +void kiss_output(fp, PLA) FILE *fp; pPLA PLA; { @@ -468,7 +468,7 @@ pPLA PLA; } -kiss_print_cube(fp, PLA, p, out_string) +void kiss_print_cube(fp, PLA, p, out_string) FILE *fp; pPLA PLA; pcube p; @@ -515,7 +515,7 @@ char *out_string; putc('\n', fp); } -output_symbolic_constraints(fp, PLA, output_symbolic) +void output_symbolic_constraints(fp, PLA, output_symbolic) FILE *fp; pPLA PLA; int output_symbolic; diff --git a/src/misc/espresso/equiv.c b/src/misc/espresso/equiv.c index ba898a70..f6495f1f 100644 --- a/src/misc/espresso/equiv.c +++ b/src/misc/espresso/equiv.c @@ -10,7 +10,7 @@ #include "espresso.h" -find_equiv_outputs(PLA) +void find_equiv_outputs(PLA) pPLA PLA; { int i, j, ipart, jpart, some_equiv; diff --git a/src/misc/espresso/espresso.h b/src/misc/espresso/espresso.h index 1c7a8646..3ca331ac 100644 --- a/src/misc/espresso/espresso.h +++ b/src/misc/espresso/espresso.h @@ -546,7 +546,7 @@ extern struct cdata_struct cdata, temp_cdata_save; /* cubestr.c */ extern void restore_cube_struct(); /* cubestr.c */ extern void save_cube_struct(); /* cubestr.c */ extern void setdown_cube(); -/* cvrin.c */ extern PLA_labels(); +/* cvrin.c */ extern void PLA_labels(); /* cvrin.c */ extern char *get_word(); /* cvrin.c */ extern int label_index(); /* cvrin.c */ extern int read_pla(); @@ -557,7 +557,7 @@ extern struct cdata_struct cdata, temp_cdata_save; /* cvrin.c */ extern void parse_pla(); /* cvrin.c */ extern void read_cube(); /* cvrin.c */ extern void skip_line(); -/* cvrm.c */ extern foreach_output_function(); +/* cvrm.c */ extern void foreach_output_function(); /* cvrm.c */ extern int cubelist_partition(); /* cvrm.c */ extern int so_both_do_espresso(); /* cvrm.c */ extern int so_both_do_exact(); @@ -590,10 +590,10 @@ extern struct cdata_struct cdata, temp_cdata_save; /* cvrout.c */ extern char *pc1(); /* cvrout.c */ extern char *pc2(); /* cvrout.c */ extern char *pc3(); -/* cvrout.c */ extern int makeup_labels(); -/* cvrout.c */ extern kiss_output(); -/* cvrout.c */ extern kiss_print_cube(); -/* cvrout.c */ extern output_symbolic_constraints(); +/* cvrout.c */ extern void makeup_labels(); +/* cvrout.c */ extern void kiss_output(); +/* cvrout.c */ extern void kiss_print_cube(); +/* cvrout.c */ extern void output_symbolic_constraints(); /* cvrout.c */ extern void cprint(); /* cvrout.c */ extern void debug1_print(); /* cvrout.c */ extern void debug_print(); @@ -606,7 +606,7 @@ extern struct cdata_struct cdata, temp_cdata_save; /* cvrout.c */ extern void print_cube(); /* cvrout.c */ extern void print_expanded_cube(); /* cvrout.c */ extern void sf_debug_print(); -/* equiv.c */ extern find_equiv_outputs(); +/* equiv.c */ extern void find_equiv_outputs(); /* equiv.c */ extern int check_equiv(); /* espresso.c */ extern pcover espresso(); /* essen.c */ extern bool essen_cube(); @@ -633,14 +633,14 @@ extern struct cdata_struct cdata, temp_cdata_save; /* gasp.c */ extern pcover super_gasp(); /* gasp.c */ extern void expand1_gasp(); /* getopt.c */ extern int util_getopt(); -/* hack.c */ extern find_dc_inputs(); -/* hack.c */ extern find_inputs(); -/* hack.c */ extern form_bitvector(); -/* hack.c */ extern map_dcset(); -/* hack.c */ extern map_output_symbolic(); -/* hack.c */ extern map_symbolic(); +/* hack.c */ extern void find_dc_inputs(); +/* hack.c */ extern void find_inputs(); +/* hack.c */ extern void form_bitvector(); +/* hack.c */ extern void map_dcset(); +/* hack.c */ extern void map_output_symbolic(); +/* hack.c */ extern void map_symbolic(); /* hack.c */ extern pcover map_symbolic_cover(); -/* hack.c */ extern symbolic_hack_labels(); +/* hack.c */ extern void symbolic_hack_labels(); /* irred.c */ extern bool cube_is_covered(); /* irred.c */ extern bool taut_special_cases(); /* irred.c */ extern bool tautology(); @@ -651,7 +651,7 @@ extern struct cdata_struct cdata, temp_cdata_save; /* map.c */ extern pset minterms(); /* map.c */ extern void explode(); /* map.c */ extern void map(); -/* opo.c */ extern output_phase_setup(); +/* opo.c */ extern void output_phase_setup(); /* opo.c */ extern pPLA set_phase(); /* opo.c */ extern pcover opo(); /* opo.c */ extern pcube find_phase(); @@ -662,19 +662,19 @@ extern struct cdata_struct cdata, temp_cdata_save; /* opo.c */ extern void opoall(); /* opo.c */ extern void phase_assignment(); /* opo.c */ extern void repeated_phase_assignment(); -/* pair.c */ extern generate_all_pairs(); +/* pair.c */ extern void generate_all_pairs(); /* pair.c */ extern int **find_pairing_cost(); -/* pair.c */ extern int find_best_cost(); +/* pair.c */ extern void find_best_cost(); /* pair.c */ extern int greedy_best_cost(); -/* pair.c */ extern int minimize_pair(); -/* pair.c */ extern int pair_free(); -/* pair.c */ extern pair_all(); +/* pair.c */ extern void minimize_pair(); +/* pair.c */ extern void pair_free(); +/* pair.c */ extern void pair_all(); /* pair.c */ extern pcover delvar(); /* pair.c */ extern pcover pairvar(); /* pair.c */ extern ppair pair_best_cost(); /* pair.c */ extern ppair pair_new(); /* pair.c */ extern ppair pair_save(); -/* pair.c */ extern print_pair(); +/* pair.c */ extern void print_pair(); /* pair.c */ extern void find_optimal_pairing(); /* pair.c */ extern void set_pair(); /* pair.c */ extern void set_pair1(); @@ -764,10 +764,6 @@ extern struct cdata_struct cdata, temp_cdata_save; /* sminterf.c */pset do_sm_minimum_cover(); /* sparse.c */ extern pcover make_sparse(); /* sparse.c */ extern pcover mv_reduce(); -#if !defined(__osf__) && !defined(__STDC__) && !defined(__hpux) -/* ucbqsort.c */ extern qsort(); -#endif -/* ucbqsort.c */ extern qst(); /* unate.c */ extern pcover find_all_minimal_covers_petrick(); /* unate.c */ extern pcover map_cover_to_unate(); /* unate.c */ extern pcover map_unate_to_cover(); @@ -776,7 +772,7 @@ extern struct cdata_struct cdata, temp_cdata_save; /* unate.c */ extern pset_family unate_compl(); /* unate.c */ extern pset_family unate_complement(); /* unate.c */ extern pset_family unate_intersect(); -/* verify.c */ extern PLA_permute(); +/* verify.c */ extern void PLA_permute(); /* verify.c */ extern bool PLA_verify(); /* verify.c */ extern bool check_consistency(); /* verify.c */ extern bool verify(); diff --git a/src/misc/espresso/expand.c b/src/misc/espresso/expand.c index 2765d71c..6b41a786 100644 --- a/src/misc/espresso/expand.c +++ b/src/misc/espresso/expand.c @@ -219,8 +219,8 @@ pcube RAISE, FREESET; if ((dist = cdist01(p, r)) > 1) goto exit_if; #else {register int w,last;register unsigned int x;dist=0;if((last=cube.inword)!=-1) -{x=p[last]&r[last];if(x=~(x|x>>1)&cube.inmask)if((dist=count_ones(x))>1)goto -exit_if;for(w=1;w<last;w++){x=p[w]&r[w];if(x=~(x|x>>1)&DISJOINT)if(dist==1||( +{x=p[last]&r[last];if((x=~(x|x>>1)&cube.inmask))if((dist=count_ones(x))>1)goto +exit_if;for(w=1;w<last;w++){x=p[w]&r[w];if((x=~(x|x>>1)&DISJOINT))if(dist==1||( dist+=count_ones(x))>1)goto exit_if;}}}{register int w,var,last;register pcube mask;for(var=cube.num_binary_vars;var<cube.num_vars;var++){mask=cube.var_mask[ var];last=cube.last_word[var];for(w=cube.first_word[var];w<=last;w++)if(p[w]&r[ @@ -403,7 +403,9 @@ pcover BB, CC; pcube RAISE, FREESET, SUPER_CUBE; int *num_covered; { - register pcube p, last, bestfeas, *feas; + register pcube p, last; + register pcube bestfeas = NULL; // Suppress "might be used uninitialized" + register pcube *feas; register int i, j; pcube *feas_new_lower; int bestcount, bestsize, count, size, numfeas, lastfeas; @@ -527,8 +529,8 @@ pcube c, RAISE, new_lower; if ((dist = cdist01(p, r)) > 1) goto exit_if; #else {register int w,last;register unsigned int x;dist=0;if((last=cube.inword)!=-1) -{x=p[last]&r[last];if(x=~(x|x>>1)&cube.inmask)if((dist=count_ones(x))>1)goto -exit_if;for(w=1;w<last;w++){x=p[w]&r[w];if(x=~(x|x>>1)&DISJOINT)if(dist==1||( +{x=p[last]&r[last];if((x=~(x|x>>1)&cube.inmask))if((dist=count_ones(x))>1)goto +exit_if;for(w=1;w<last;w++){x=p[w]&r[w];if((x=~(x|x>>1)&DISJOINT))if(dist==1||( dist+=count_ones(x))>1)goto exit_if;}}}{register int w,var,last;register pcube mask;for(var=cube.num_binary_vars;var<cube.num_vars;var++){mask=cube.var_mask[ var];last=cube.last_word[var];for(w=cube.first_word[var];w<=last;w++)if(p[w]&r[ diff --git a/src/misc/espresso/gimpel.c b/src/misc/espresso/gimpel.c index 648bb64a..4b75ae59 100644 --- a/src/misc/espresso/gimpel.c +++ b/src/misc/espresso/gimpel.c @@ -35,9 +35,10 @@ stats_t *stats; solution_t **best; { register sm_row *prow, *save_sec; - register sm_col *c1, *c2; + register sm_col *c1 = NULL, *c2 = NULL; // Suppress "might be used uninitialized" register sm_element *p, *p1; - int c1_col_num, c2_col_num, primary_row_num, secondary_row_num; + int c1_col_num, c2_col_num; + int primary_row_num = -1, secondary_row_num = -1; // Suppress "might be used uninitialized" int reduce_it; reduce_it = 0; diff --git a/src/misc/espresso/globals.c b/src/misc/espresso/globals.c index d04771e9..2ec1d1db 100644 --- a/src/misc/espresso/globals.c +++ b/src/misc/espresso/globals.c @@ -37,27 +37,27 @@ bool use_super_gasp; /* -strong command line option */ char *filename; /* filename PLA was read from */ struct pla_types_struct pla_types[] = { - "-f", F_type, - "-r", R_type, - "-d", D_type, - "-fd", FD_type, - "-fr", FR_type, - "-dr", DR_type, - "-fdr", FDR_type, - "-fc", F_type | CONSTRAINTS_type, - "-rc", R_type | CONSTRAINTS_type, - "-dc", D_type | CONSTRAINTS_type, - "-fdc", FD_type | CONSTRAINTS_type, - "-frc", FR_type | CONSTRAINTS_type, - "-drc", DR_type | CONSTRAINTS_type, - "-fdrc", FDR_type | CONSTRAINTS_type, - "-pleasure", PLEASURE_type, - "-eqn", EQNTOTT_type, - "-eqntott", EQNTOTT_type, - "-kiss", KISS_type, - "-cons", CONSTRAINTS_type, - "-scons", SYMBOLIC_CONSTRAINTS_type, - 0, 0 + {"-f", F_type}, + {"-r", R_type}, + {"-d", D_type}, + {"-fd", FD_type}, + {"-fr", FR_type}, + {"-dr", DR_type}, + {"-fdr", FDR_type}, + {"-fc", F_type | CONSTRAINTS_type}, + {"-rc", R_type | CONSTRAINTS_type}, + {"-dc", D_type | CONSTRAINTS_type}, + {"-fdc", FD_type | CONSTRAINTS_type}, + {"-frc", FR_type | CONSTRAINTS_type}, + {"-drc", DR_type | CONSTRAINTS_type}, + {"-fdrc", FDR_type | CONSTRAINTS_type}, + {"-pleasure", PLEASURE_type}, + {"-eqn", EQNTOTT_type}, + {"-eqntott", EQNTOTT_type}, + {"-kiss", KISS_type}, + {"-cons", CONSTRAINTS_type}, + {"-scons", SYMBOLIC_CONSTRAINTS_type}, + {0, 0} }; diff --git a/src/misc/espresso/hack.c b/src/misc/espresso/hack.c index 927f5341..13cdf895 100644 --- a/src/misc/espresso/hack.c +++ b/src/misc/espresso/hack.c @@ -9,7 +9,7 @@ */ #include "espresso.h" -map_dcset(PLA) +void map_dcset(PLA) pPLA PLA; { int var, i; @@ -83,7 +83,7 @@ pPLA PLA; PLA->D = sf_delc(PLA->D, 2*var, 2*var+1); } -map_output_symbolic(PLA) +void map_output_symbolic(PLA) pPLA PLA; { pset_family newF, newD; @@ -187,7 +187,7 @@ pPLA PLA; } -find_inputs(A, PLA, list, base, value, newF, newD) +void find_inputs(A, PLA, list, base, value, newF, newD) pcover A; pPLA PLA; symbolic_list_t *list; @@ -282,7 +282,7 @@ pcover *newF, *newD; } #endif -map_symbolic(PLA) +void map_symbolic(PLA) pPLA PLA; { symbolic_t *p1; @@ -377,7 +377,7 @@ int base; } -form_bitvector(p, base, value, list) +void form_bitvector(p, base, value, list) pset p; /* old cube, looking at binary variables */ int base; /* where in mv cube the new variable starts */ int value; /* current value for this recursion */ @@ -404,7 +404,7 @@ symbolic_list_t *list; /* current place in the symbolic list */ } -symbolic_hack_labels(PLA, list, compress, new_size, old_size, size_added) +void symbolic_hack_labels(PLA, list, compress, new_size, old_size, size_added) pPLA PLA; symbolic_t *list; pset compress; @@ -476,7 +476,7 @@ pcover F; } -disassemble_fsm(PLA, verbose_mode) +void disassemble_fsm(PLA, verbose_mode) pPLA PLA; int verbose_mode; { diff --git a/src/misc/espresso/irred.c b/src/misc/espresso/irred.c index 384e698f..2e9f4e26 100644 --- a/src/misc/espresso/irred.c +++ b/src/misc/espresso/irred.c @@ -304,7 +304,7 @@ start: if (debug & TAUT) { printf("UNATE_REDUCTION: %d unate variables, reduced to %d\n", - cdata.vars_unate, CUBELISTSIZE(T)); + (int)cdata.vars_unate, (int)CUBELISTSIZE(T)); } goto start; @@ -430,7 +430,7 @@ start: if (debug & TAUT) { printf("UNATE_REDUCTION: %d unate variables, reduced to %d\n", - cdata.vars_unate, CUBELISTSIZE(T)); + (int)cdata.vars_unate, (int)CUBELISTSIZE(T)); } goto start; } diff --git a/src/misc/espresso/map.c b/src/misc/espresso/map.c index 5ccf264c..68168745 100644 --- a/src/misc/espresso/map.c +++ b/src/misc/espresso/map.c @@ -36,34 +36,36 @@ int var, z; int i, last = cube.last_part[var]; for(i=cube.first_part[var], z *= cube.part_size[var]; i<=last; i++, z++) if (is_in_set(Gcube, i)) + { if (var == 0) set_insert(Gminterm, z); else explode(var-1, z); + } } static int mapindex[16][16] = { - 0, 1, 3, 2, 16, 17, 19, 18, 80, 81, 83, 82, 64, 65, 67, 66, - 4, 5, 7, 6, 20, 21, 23, 22, 84, 85, 87, 86, 68, 69, 71, 70, - 12, 13, 15, 14, 28, 29, 31, 30, 92, 93, 95, 94, 76, 77, 79, 78, - 8, 9, 11, 10, 24, 25, 27, 26, 88, 89, 91, 90, 72, 73, 75, 74, - - 32, 33, 35, 34, 48, 49, 51, 50, 112,113,115,114, 96, 97, 99, 98, - 36, 37, 39, 38, 52, 53, 55, 54, 116,117,119,118, 100,101,103,102, - 44, 45, 47, 46, 60, 61, 63, 62, 124,125,127,126, 108,109,111,110, - 40, 41, 43, 42, 56, 57, 59, 58, 120,121,123,122, 104,105,107,106, - - - 160,161,163,162, 176,177,179,178, 240,241,243,242, 224,225,227,226, - 164,165,167,166, 180,181,183,182, 244,245,247,246, 228,229,231,230, - 172,173,175,174, 188,189,191,190, 252,253,255,254, 236,237,239,238, - 168,169,171,170, 184,185,187,186, 248,249,251,250, 232,233,235,234, - - 128,129,131,130, 144,145,147,146, 208,209,211,210, 192,193,195,194, - 132,133,135,134, 148,149,151,150, 212,213,215,214, 196,197,199,198, - 140,141,143,142, 156,157,159,158, 220,221,223,222, 204,205,207,206, - 136,137,139,138, 152,153,155,154, 216,217,219,218, 200,201,203,202 + { 0, 1, 3, 2, 16, 17, 19, 18, 80, 81, 83, 82, 64, 65, 67, 66}, + { 4, 5, 7, 6, 20, 21, 23, 22, 84, 85, 87, 86, 68, 69, 71, 70}, + { 12, 13, 15, 14, 28, 29, 31, 30, 92, 93, 95, 94, 76, 77, 79, 78}, + { 8, 9, 11, 10, 24, 25, 27, 26, 88, 89, 91, 90, 72, 73, 75, 74}, + + { 32, 33, 35, 34, 48, 49, 51, 50, 112,113,115,114, 96, 97, 99, 98}, + { 36, 37, 39, 38, 52, 53, 55, 54, 116,117,119,118, 100,101,103,102}, + { 44, 45, 47, 46, 60, 61, 63, 62, 124,125,127,126, 108,109,111,110}, + { 40, 41, 43, 42, 56, 57, 59, 58, 120,121,123,122, 104,105,107,106}, + + + {160,161,163,162, 176,177,179,178, 240,241,243,242, 224,225,227,226}, + {164,165,167,166, 180,181,183,182, 244,245,247,246, 228,229,231,230}, + {172,173,175,174, 188,189,191,190, 252,253,255,254, 236,237,239,238}, + {168,169,171,170, 184,185,187,186, 248,249,251,250, 232,233,235,234}, + + {128,129,131,130, 144,145,147,146, 208,209,211,210, 192,193,195,194}, + {132,133,135,134, 148,149,151,150, 212,213,215,214, 196,197,199,198}, + {140,141,143,142, 156,157,159,158, 220,221,223,222, 204,205,207,206}, + {136,137,139,138, 152,153,155,154, 216,217,219,218, 200,201,203,202} }; #define POWER2(n) (1 << n) diff --git a/src/misc/espresso/opo.c b/src/misc/espresso/opo.c index 8daa0771..19522f89 100644 --- a/src/misc/espresso/opo.c +++ b/src/misc/espresso/opo.c @@ -411,7 +411,7 @@ int n; * duplicated in the output part */ -output_phase_setup(PLA, first_output) +void output_phase_setup(PLA, first_output) INOUT pPLA PLA; int first_output; { diff --git a/src/misc/espresso/pair.c b/src/misc/espresso/pair.c index a8077176..a5345178 100644 --- a/src/misc/espresso/pair.c +++ b/src/misc/espresso/pair.c @@ -163,7 +163,8 @@ pcover A; bool paired[]; { bool run; - int first_run, run_length, var, offset = 0; + int first_run = 0; // Suppress "might be used uninitialized" + int run_length, var, offset = 0; run = FALSE; run_length = 0; for(var = 0; var < cube.num_binary_vars; var++) @@ -261,8 +262,10 @@ pPLA PLA; int strategy; { int var1, var2, **cost_array; - int i, j, xnum_binary_vars, xnum_vars, *xpart_size, cost; - pcover T, Fsave, Dsave, Rsave; + int i, j; + int xnum_binary_vars = 0, xnum_vars = 0, *xpart_size = NULL, cost = 0; // Suppress "might be used uninitialized" + pcover T; + pcover Fsave = NULL, Dsave = NULL, Rsave = NULL; // Suppress "might be used uninitialized" pset mask; /* char *s;*/ @@ -366,7 +369,7 @@ static pcover best_F, best_D, best_R; static int pair_minim_strategy; -print_pair(pair) +void print_pair(pair) ppair pair; { int i; @@ -382,7 +385,9 @@ int greedy_best_cost(cost_array_local, pair_p) int **cost_array_local; ppair *pair_p; { - int i, j, besti, bestj, maxcost, total_cost; + int i, j; + int besti = 0, bestj = 0; + int maxcost, total_cost; pset cand; ppair pair; @@ -437,7 +442,7 @@ int **cost_array_local; } -int find_best_cost(pair) +void find_best_cost(pair) register ppair pair; { register int i, cost; @@ -464,7 +469,7 @@ register ppair pair; 4) for phase assignment */ -pair_all(PLA, pair_strategy) +void pair_all(PLA, pair_strategy) pPLA PLA; int pair_strategy; { @@ -507,7 +512,7 @@ int pair_strategy; /* * minimize_pair -- called as each pair is generated */ -int minimize_pair(pair) +void minimize_pair(pair) ppair pair; { pcover Fsave, Dsave, Rsave; @@ -582,7 +587,7 @@ ppair pair; global_PLA->phase = NULL; } -generate_all_pairs(pair, n, candidate, action) +void generate_all_pairs(pair, n, candidate, action) ppair pair; int n; pset candidate; @@ -666,7 +671,7 @@ register int n; } -int pair_free(pair) +void pair_free(pair) register ppair pair; { FREE(pair->var1); diff --git a/src/misc/espresso/set.c b/src/misc/espresso/set.c index fce88288..e3629343 100644 --- a/src/misc/espresso/set.c +++ b/src/misc/espresso/set.c @@ -16,7 +16,7 @@ #include "espresso.h" static pset_family set_family_garbage = NULL; -static int intcpy(d, s, n) +static void intcpy(d, s, n) register unsigned int *d, *s; register long n; { diff --git a/src/misc/espresso/setc.c b/src/misc/espresso/setc.c index a6112ebc..64130ec5 100644 --- a/src/misc/espresso/setc.c +++ b/src/misc/espresso/setc.c @@ -114,14 +114,14 @@ register pset a, b; /* Check the partial word of binary variables */ x = a[last] & b[last]; - if (x = ~ (x | x >> 1) & cube.inmask) + if ((x = ~ (x | x >> 1) & cube.inmask)) if ((dist = count_ones(x)) > 1) return 2; /* Check the full words of binary variables */ for(w = 1; w < last; w++) { x = a[w] & b[w]; - if (x = ~ (x | x >> 1) & DISJOINT) + if ((x = ~ (x | x >> 1) & DISJOINT)) if (dist == 1 || (dist += count_ones(x)) > 1) return 2; } @@ -159,13 +159,13 @@ register pset a, b; /* Check the partial word of binary variables */ x = a[last] & b[last]; - if (x = ~ (x | x >> 1) & cube.inmask) + if ((x = ~ (x | x >> 1) & cube.inmask)) dist = count_ones(x); /* Check the full words of binary variables */ for(w = 1; w < last; w++) { x = a[w] & b[w]; - if (x = ~ (x | x >> 1) & DISJOINT) + if ((x = ~ (x | x >> 1) & DISJOINT)) dist += count_ones(x); } } @@ -200,13 +200,13 @@ IN register pset a, b; /* Check the partial word of binary variables */ x = a[last] & b[last]; - if (x = ~(x | x >> 1) & cube.inmask) + if ((x = ~(x | x >> 1) & cube.inmask)) xlower[last] |= (x | (x << 1)) & a[last]; /* Check the full words of binary variables */ for(w = 1; w < last; w++) { x = a[w] & b[w]; - if (x = ~(x | x >> 1) & DISJOINT) + if ((x = ~(x | x >> 1) & DISJOINT)) xlower[w] |= (x | (x << 1)) & a[w]; } } @@ -252,13 +252,13 @@ IN register pcube a, b; /* Check the partial word of binary variables */ r[last] = x = a[last] & b[last]; - if (x = ~(x | x >> 1) & cube.inmask) + if ((x = ~(x | x >> 1) & cube.inmask)) r[last] |= (x | (x << 1)) & (a[last] | b[last]); /* Check the full words of binary variables */ for(w = 1; w < last; w++) { r[w] = x = a[w] & b[w]; - if (x = ~(x | x >> 1) & DISJOINT) + if ((x = ~(x | x >> 1) & DISJOINT)) r[w] |= (x | (x << 1)) & (a[w] | b[w]); } } @@ -273,7 +273,7 @@ IN register pcube a, b; last = cube.last_word[var]; empty = TRUE; for(w = cube.first_word[var]; w <= last; w++) - if (x = a[w] & b[w] & mask[w]) + if ((x = a[w] & b[w] & mask[w])) empty = FALSE, r[w] |= x; if (empty) for(w = cube.first_word[var]; w <= last; w++) @@ -299,7 +299,7 @@ register pcube a; /* Check the partial word of binary variables */ x = a[last]; - if (x = ~ (x & x >> 1) & cube.inmask) { + if ((x = ~ (x & x >> 1) & cube.inmask)) { if ((dist = count_ones(x)) > 1) return -1; /* more than 2 active variables */ active = (last-1)*(BPI/2) + bit_index(x) / 2; @@ -308,7 +308,7 @@ register pcube a; /* Check the full words of binary variables */ for(w = 1; w < last; w++) { x = a[w]; - if (x = ~ (x & x >> 1) & DISJOINT) { + if ((x = ~ (x & x >> 1) & DISJOINT)) { if ((dist += count_ones(x)) > 1) return -1; /* more than 2 active variables */ active = (w-1)*(BPI/2) + bit_index(x) / 2; diff --git a/src/misc/espresso/verify.c b/src/misc/espresso/verify.c index 64342787..e5340724 100644 --- a/src/misc/espresso/verify.c +++ b/src/misc/espresso/verify.c @@ -83,7 +83,7 @@ pPLA PLA1, PLA2; * Discard any columns of PLA1 which are not in PLA2 * Association is strictly by the names of the columns of the cover. */ -PLA_permute(PLA1, PLA2) +void PLA_permute(PLA1, PLA2) pPLA PLA1, PLA2; { register int i, j, *permute, npermute; |