From: Ian Jackson Date: Sat, 3 Oct 2009 19:32:03 +0000 (+0100) Subject: WIP routesearch; better debugging output X-Git-Tag: 5.0^2~82 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=commitdiff_plain;h=b5f936bf08ab82b34f9529b72946c0cd66ef5a62;hp=5500706eb06699d2ffe27cd1ca257748949f597a WIP routesearch; better debugging output --- 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