diff --git a/buddy/src/bddio.c b/buddy/src/bddio.c index baf51d998..c7f3ab983 100644 --- a/buddy/src/bddio.c +++ b/buddy/src/bddio.c @@ -130,7 +130,7 @@ void bdd_fprintall(FILE *ofile) { if (LOW(n) != -1) { - fprintf(ofile, "[%5d - %2d] ", n, bddnodes[n].refcou); + fprintf(ofile, "[%5d - %2u] ", n, bddnodes[n].refcou); if (filehandler) filehandler(ofile, bddlevel2var[LEVEL(n)]); else diff --git a/buddy/src/cppext.cxx b/buddy/src/cppext.cxx index 0a26d8e38..47c90c416 100644 --- a/buddy/src/cppext.cxx +++ b/buddy/src/cppext.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include "kernel.h" #include "bvecx.h" @@ -190,7 +191,7 @@ ostream &operator<<(ostream &o, const bdd &r) return o; } - int *set = new int[bddvarnum]; + int *set = new (std::nothrow) int[bddvarnum]; if (set == NULL) { bdd_error(BDD_MEMORY); @@ -252,7 +253,7 @@ ostream &operator<<(ostream &o, const bdd &r) return o; } - int *set = new int[bddvarnum]; + int *set = new (std::nothrow) int[bddvarnum]; if (set == NULL) { bdd_error(BDD_MEMORY); diff --git a/buddy/src/kernel.c b/buddy/src/kernel.c index 10f9862f2..0b709c600 100644 --- a/buddy/src/kernel.c +++ b/buddy/src/kernel.c @@ -774,19 +774,19 @@ void bdd_fprintstat(FILE *ofile) fprintf(ofile, "\nCache statistics\n"); fprintf(ofile, "----------------\n"); - fprintf(ofile, "Unique Access: %ld\n", s.uniqueAccess); - fprintf(ofile, "Unique Chain: %ld\n", s.uniqueChain); - fprintf(ofile, "Unique Hit: %ld\n", s.uniqueHit); - fprintf(ofile, "Unique Miss: %ld\n", s.uniqueMiss); + fprintf(ofile, "Unique Access: %lu\n", s.uniqueAccess); + fprintf(ofile, "Unique Chain: %lu\n", s.uniqueChain); + fprintf(ofile, "Unique Hit: %lu\n", s.uniqueHit); + fprintf(ofile, "Unique Miss: %lu\n", s.uniqueMiss); fprintf(ofile, "=> Hit rate = %.2f\n", (s.uniqueHit+s.uniqueMiss > 0) ? ((float)s.uniqueHit)/((float)s.uniqueHit+s.uniqueMiss) : 0); - fprintf(ofile, "Operator Hits: %ld\n", s.opHit); - fprintf(ofile, "Operator Miss: %ld\n", s.opMiss); + fprintf(ofile, "Operator Hits: %lu\n", s.opHit); + fprintf(ofile, "Operator Miss: %lu\n", s.opMiss); fprintf(ofile, "=> Hit rate = %.2f\n", (s.opHit+s.opMiss > 0) ? ((float)s.opHit)/((float)s.opHit+s.opMiss) : 0); - fprintf(ofile, "Swap count = %ld\n", s.swapCount); + fprintf(ofile, "Swap count = %lu\n", s.swapCount); } @@ -1164,7 +1164,7 @@ BDD bdd_addref(BDD root) BDD bdd_delref_nc(BDD root) { #ifndef NDEBUG - if (root < 2 || !bddrunning) + if (!bddrunning) return root; if (root >= bddnodesize) return bdd_error(BDD_ILLBDD);