Index: toporouter/patches/0001-CONVERT-PCB-S-BASE-UNITS-TO-NANOMETERS.patch =================================================================== --- toporouter/patches/0001-CONVERT-PCB-S-BASE-UNITS-TO-NANOMETERS.patch (nonexistent) +++ toporouter/patches/0001-CONVERT-PCB-S-BASE-UNITS-TO-NANOMETERS.patch (revision 6822) @@ -0,0 +1,79 @@ +From 97b3260ecf977dcaa959e51fbd39c6b0d7b414b7 Mon Sep 17 00:00:00 2001 +From: Andrew Poelstra +Date: Fri, 5 Aug 2011 23:39:37 -0700 +Subject: [PATCH] *** CONVERT PCB'S BASE UNITS TO NANOMETERS *** + +Convert base units to nm, change Coord from int to long, +change LARGE_VALUE from a magic number to (LONG_MAX / 2 - 1). + +Fixes-bug: lp-772027 +--- + globalconst.h | 2 +- + src/const.h | 8 ++++---- + src/global.h | 2 +- + src/main.c | 4 ++-- + 4 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/globalconst.h b/globalconst.h +index 605d909..6599823 100755 +--- a/globalconst.h ++++ b/globalconst.h +@@ -60,7 +60,7 @@ + /* --------------------------------------------------------------------------- + * some limit specifications + */ +-#define LARGE_VALUE 10000000 /* maximum extent of board and elements */ ++#define LARGE_VALUE (LONG_MAX / 2 - 1) /* maximum extent of board and elements */ + + #define MAX_LAYER 16 /* max number of layer, check source */ + /* code for more changes, a *lot* more changes */ +diff --git a/src/const.h b/src/const.h +index 4f4534c..0885871 100644 +--- a/src/const.h ++++ b/src/const.h +@@ -68,10 +68,10 @@ + #define LN_2_OVER_2 0.346573590 + + /* PCB/physical unit conversions */ +-#define COORD_TO_MIL(n) ((n) / 100.0) +-#define MIL_TO_COORD(n) ((n) * 100.0) +-#define COORD_TO_MM(n) ((n) * 0.000254) +-#define MM_TO_COORD(n) ((n) / 0.000254) ++#define COORD_TO_MIL(n) ((n) / 25400.0) ++#define MIL_TO_COORD(n) ((n) * 25400.0) ++#define COORD_TO_MM(n) ((n) / 1000000.0) ++#define MM_TO_COORD(n) ((n) * 1000000.0) + #define COORD_TO_INCH(n) (COORD_TO_MIL(n) / 1000.0) + #define INCH_TO_COORD(n) (MIL_TO_COORD(n) * 1000.0) + +diff --git a/src/global.h b/src/global.h +index 731742d..a3a4ac1 100644 +--- a/src/global.h ++++ b/src/global.h +@@ -64,7 +64,7 @@ typedef struct AttributeListType AttributeListType, *AttributeListTypePtr; + typedef struct unit Unit; + typedef struct increments Increments; + +-typedef int Coord; /* pcb base unit */ ++typedef long Coord; /* pcb base unit */ + typedef double Angle; /* degrees */ + + #include "hid.h" +diff --git a/src/main.c b/src/main.c +index cd6ccfa..5dc761d 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -637,8 +637,8 @@ REGISTER_ATTRIBUTES (main_attribute_list) + Settings.ViaDrillingHole = + DEFAULT_DRILLINGHOLE * Settings.ViaThickness / 100; + +- Settings.MaxWidth = MIN (MAX_COORD, MAX (Settings.MaxWidth, MIN_SIZE)); +- Settings.MaxHeight = MIN (MAX_COORD, MAX (Settings.MaxHeight, MIN_SIZE)); ++ Settings.MaxWidth = CLAMP (Settings.MaxWidth, MIN_SIZE, MAX_COORD); ++ Settings.MaxHeight = CLAMP (Settings.MaxHeight, MIN_SIZE, MAX_COORD); + + ParseRouteString (Settings.Routes, &Settings.RouteStyle[0], "cmil"); + +-- +2.9.3 + Index: toporouter/patches/LP.txt =================================================================== --- toporouter/patches/LP.txt (nonexistent) +++ toporouter/patches/LP.txt (revision 6822) @@ -0,0 +1,65 @@ +Bug #846789 reported by KaiMartin on 2011-09-11 + +Bug Description + +In current git-head the toporouter struggles indefinitely even for very simple +boards. +To reproduce: + +1) prepare a simple schematic: Two connected resistors are enough + +2) save as foo.sch + +3) pcb foo.pcb + +4) import schematic --> The resistors appear in the middle of the canvas + +5) execute the command "toporouter()" +pcb claims a whole core indefinitely with no results whatsoever. + +---<)kaimartin(>--- + +Tags: toporouter Edit Tag help +Bert Timmerman (bert-timmerman) on 2011-09-11 + +Changed in pcb: +status: New ? Confirmed + +Andrew Poelstra (asp11) wrote on 2011-09-11: #1 + +Hitting Ctrl+C in gdb after the lockup, and doing a backtrace, gives nested +calls to swap_if_in_circle() roughly 10 000 deep. The offending line is gts/ +cdt.c:506. + +Andrew Poelstra (asp11) wrote on 2011-09-11: #2 + +git bisect says I did it. Offending commit: + +commit 97b3260ecf977dcaa959e51fbd39c6b0d7b414b7 +Author: Andrew Poelstra