From 8db847de768db9e9df114ac31e4aa3b33ab4fae6 Mon Sep 17 00:00:00 2001 From: APTX Date: Wed, 1 Dec 2010 16:49:02 +0100 Subject: [PATCH] Unix fixes. --- shared/shared.h | 4 ++-- tal-algorithm/main.cpp | 3 ++- tal-algorithm/tal-algorithm.pro | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) 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 -- 2.52.0