Commit 7ce7e9ec by Alan Mishchenko

Compiler warnings.

parent af4c76e2
...@@ -121,8 +121,8 @@ void glucose_print_stats(Solver& s, abctime clk) ...@@ -121,8 +121,8 @@ void glucose_print_stats(Solver& s, abctime clk)
{ {
double cpu_time = (double)(unsigned)clk / CLOCKS_PER_SEC; double cpu_time = (double)(unsigned)clk / CLOCKS_PER_SEC;
double mem_used = memUsed(); double mem_used = memUsed();
printf("c restarts : %d (%d conflicts on average)\n", (int)s.starts, s.starts > 0 ? s.conflicts/s.starts : 0); printf("c restarts : %d (%d conflicts on average)\n", (int)s.starts, s.starts > 0 ? (int)(s.conflicts/s.starts) : 0);
printf("c blocked restarts : %d (multiple: %d) \n", (int)s.nbstopsrestarts,s.nbstopsrestartssame); printf("c blocked restarts : %d (multiple: %d) \n", (int)s.nbstopsrestarts, (int)s.nbstopsrestartssame);
printf("c last block at restart : %d\n", (int)s.lastblockatrestart); printf("c last block at restart : %d\n", (int)s.lastblockatrestart);
printf("c nb ReduceDB : %-12d\n", (int)s.nbReduceDB); printf("c nb ReduceDB : %-12d\n", (int)s.nbReduceDB);
printf("c nb removed Clauses : %-12d\n", (int)s.nbRemovedClauses); printf("c nb removed Clauses : %-12d\n", (int)s.nbRemovedClauses);
......
...@@ -62,7 +62,7 @@ class Option ...@@ -62,7 +62,7 @@ class Option
struct OptionLt { struct OptionLt {
bool operator()(const Option* x, const Option* y) { bool operator()(const Option* x, const Option* y) {
int test1 = strcmp(x->category, y->category); int test1 = strcmp(x->category, y->category);
return test1 < 0 || test1 == 0 && strcmp(x->type_name, y->type_name) < 0; return test1 < 0 || (test1 == 0 && strcmp(x->type_name, y->type_name) < 0);
} }
}; };
...@@ -284,15 +284,15 @@ class Int64Option : public Option ...@@ -284,15 +284,15 @@ class Int64Option : public Option
if (range.begin == INT64_MIN) if (range.begin == INT64_MIN)
fprintf(stderr, "imin"); fprintf(stderr, "imin");
else else
fprintf(stderr, "%4d", range.begin); fprintf(stderr, "%4d", (int)range.begin);
fprintf(stderr, " .. "); fprintf(stderr, " .. ");
if (range.end == INT64_MAX) if (range.end == INT64_MAX)
fprintf(stderr, "imax"); fprintf(stderr, "imax");
else else
fprintf(stderr, "%4d", range.end); fprintf(stderr, "%4d", (int)range.end);
fprintf(stderr, "] (default: %d)\n", value); fprintf(stderr, "] (default: %d)\n", (int)value);
if (verbose){ if (verbose){
fprintf(stderr, "\n %s\n", description); fprintf(stderr, "\n %s\n", description);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
......
...@@ -96,7 +96,7 @@ template<class T> ...@@ -96,7 +96,7 @@ template<class T>
void vec<T>::capacity(int min_cap) { void vec<T>::capacity(int min_cap) {
if (cap >= min_cap) return; if (cap >= min_cap) return;
int add = imax((min_cap - cap + 1) & ~1, ((cap >> 1) + 2) & ~1); // NOTE: grow by approximately 3/2 int add = imax((min_cap - cap + 1) & ~1, ((cap >> 1) + 2) & ~1); // NOTE: grow by approximately 3/2
if (add > INT_MAX - cap || ((data = (T*)::realloc(data, (cap += add) * sizeof(T))) == NULL) && errno == ENOMEM) if (add > INT_MAX - cap || (((data = (T*)::realloc(data, (cap += add) * sizeof(T))) == NULL) && errno == ENOMEM))
throw OutOfMemoryException(); throw OutOfMemoryException();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment