From: APTX Date: Wed, 1 Dec 2010 15:49:02 +0000 (+0100) Subject: Unix fixes. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=8db847de768db9e9df114ac31e4aa3b33ab4fae6;p=tal.git Unix fixes. --- diff --git a/shared/shared.h b/shared/shared.h index 08a2885..564bf0a 100644 --- a/shared/shared.h +++ b/shared/shared.h @@ -55,11 +55,11 @@ inline int max(int a, int b) # define START_CPU \ timeval starttime; \ - gettimeofday(&starttime, NULL);starttime; + gettimeofday(&starttime, NULL); # define STOP_CPU \ timeval endtime; \ - gettimeofday(&endtime, NULL);endtime; + gettimeofday(&endtime, NULL); # define CPU_ELAPSED (double(endtime.tv_sec - starttime.tv_sec) * 1000 + double(endtime.tv_usec - starttime.tv_usec) / 1000) #else diff --git a/tal-algorithm/main.cpp b/tal-algorithm/main.cpp index 4a35e61..c2790cf 100644 --- a/tal-algorithm/main.cpp +++ b/tal-algorithm/main.cpp @@ -323,7 +323,9 @@ int main(int argc, char **argv) bool run_greedy_LowestWeight = false; bool run_greedy_BestRatio = false; int runs = 1; + Problem *p = 0; + bool printSolutions = true; if (argc < 2) goto help; @@ -370,7 +372,6 @@ int main(int argc, char **argv) } cout << *p; - bool printSolutions = true; for (int i = 0; i < runs; ++i) { if (run_dp) diff --git a/tal-algorithm/tal-algorithm.pro b/tal-algorithm/tal-algorithm.pro index 7cc016c..2304572 100644 --- a/tal-algorithm/tal-algorithm.pro +++ b/tal-algorithm/tal-algorithm.pro @@ -1,5 +1,5 @@ QT -= core gui -CONFIG += console +CONFIG += console debug_and_release DESTDIR = ../build SOURCES += \ main.cpp