From b5f936bf08ab82b34f9529b72946c0cd66ef5a62 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 3 Oct 2009 20:32:03 +0100 Subject: [PATCH] WIP routesearch; better debugging output --- yarrg/rscommon.h | 1 + yarrg/rsmain.c | 1 + yarrg/rssearch.c | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/yarrg/rscommon.h b/yarrg/rscommon.h index 1e710dc..d815514 100644 --- a/yarrg/rscommon.h +++ b/yarrg/rscommon.h @@ -7,6 +7,7 @@ DF(sql) \ DF(sql2) \ DF(value) \ + DF(search) \ DF(lp) #define debug stdout diff --git a/yarrg/rsmain.c b/yarrg/rsmain.c index 4b7dea9..7e5e5e8 100644 --- a/yarrg/rsmain.c +++ b/yarrg/rsmain.c @@ -11,6 +11,7 @@ int main(int argc, const char **argv) { const char *arg; debug_flags= ~( dbg_sql2 ); + sysassert( !setvbuf(debug,0,_IOLBF,0) ); setup_sql(); setup_value(); diff --git a/yarrg/rssearch.c b/yarrg/rssearch.c index eb5e958..f14b0cd 100644 --- a/yarrg/rssearch.c +++ b/yarrg/rssearch.c @@ -2,6 +2,8 @@ #include "rscommon.h" +DEBUG_DEFINE_DEBUGF(search); + typedef struct Neighbour { struct Neighbour *next; int islandid; @@ -35,6 +37,13 @@ static Neighbour *get_neighbours(int isle) { static double best_absolute, best_perleague; static void process_route(int nports, int totaldist) { + int i; + + debugf("========== ROUTE"); + for (i=0; i