From c1bbf3ecb4b064d79ec434cb44e6875127dcd7d8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 4 Jul 2015 21:53:37 +0200 Subject: [PATCH] Temporary back to boost::polygon in 3d-viewer. Fix an assert warning in hashtables.h, when a wxString contains non basic ASCII chars (Bug #1470078). --- 3d-viewer/3d_draw_board_body.cpp | 2 +- include/hashtables.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/3d-viewer/3d_draw_board_body.cpp b/3d-viewer/3d_draw_board_body.cpp index 0973b1025f..3860a4cad4 100644 --- a/3d-viewer/3d_draw_board_body.cpp +++ b/3d-viewer/3d_draw_board_body.cpp @@ -354,7 +354,7 @@ void EDA_3D_CANVAS::buildBoard3DView( GLuint aBoardList, GLuint aBodyOnlyList, if( bufferPolys.GetCornersCount() == 0 ) continue; -#if 0 // Set to 1 to use boost::polygon to subtract holes to copper areas +#if 1 // Set to 1 to use boost::polygon to subtract holes to copper areas // (due to bugs in boost::polygon, this is deprecated and Clipper is used instead KI_POLYGON_SET currLayerPolyset; KI_POLYGON_SET polysetHoles; diff --git a/include/hashtables.h b/include/hashtables.h index ed319ec64c..72bc1fd5ed 100644 --- a/include/hashtables.h +++ b/include/hashtables.h @@ -107,10 +107,10 @@ struct WXSTRING_HASH : std::unary_function for( wxString::const_iterator it = aString.begin(); it != aString.end(); ++it ) { - hash ^= (unsigned char) *it; + unsigned ch = static_cast( *it ); + hash ^= ch; hash *= 16777619; } - return hash; } };