← Back to team overview

kicad-developers team mailing list archive

[PATCH] Clean up truncation of constant

 

In the autorouter code, the value 0x80 is assigned to MATRIX_CELL, which is
an overflow for a signed 8-bit type. As this type is used as a bit mask,
there is no point in having a sign bit anyway.

---
 pcbnew/autorouter/autorout.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pcbnew/autorouter/autorout.h b/pcbnew/autorouter/autorout.h
index 348191f..b863039 100644
--- a/pcbnew/autorouter/autorout.h
+++ b/pcbnew/autorouter/autorout.h
@@ -73,7 +73,7 @@ extern int MaxNodes;    /* maximum number of nodes opened at one time */
 
 
 /* Structures useful to the generation of board as bitmap. */
-typedef char MATRIX_CELL;
+typedef unsigned char MATRIX_CELL;
 typedef int  DIST_CELL;
 typedef char DIR_CELL;
 
-- 
2.1.4



Follow ups