From 5f2f80f480f31983e7e499223a1978eb9f947c64 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 14 Nov 2013 19:00:57 +0100 Subject: [PATCH] rtree.h: suppress compil warnings about not initialized vars. Pcbnew: add WIN32_LEAN_AND_MEAN define in github_plugin.cpp. Note: this define is already in use in avhttp build (Windows specific) --- include/rtree.h | 6 +++--- pcbnew/github/github_plugin.cpp | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/rtree.h b/include/rtree.h index ec2d30a806..cfb6c86d3c 100644 --- a/include/rtree.h +++ b/include/rtree.h @@ -1181,7 +1181,7 @@ int RTREE_QUAL::PickBranch( Rect* a_rect, Node* a_node ) ELEMTYPEREAL bestIncr = (ELEMTYPEREAL) -1; ELEMTYPEREAL area; ELEMTYPEREAL bestArea; - int best; + int best = 0; // avoid compil complaint about uninitialized Rect tempRect; for( int index = 0; index < a_node->m_count; ++index ) @@ -1374,7 +1374,7 @@ void RTREE_QUAL::ChoosePartition( PartitionVars* a_parVars, int a_minFill ) ASSERT( a_parVars ); ELEMTYPEREAL biggestDiff; - int group, chosen, betterGroup; + int group, chosen=0, betterGroup=0; InitParVars( a_parVars, a_parVars->m_branchCount, a_minFill ); PickSeeds( a_parVars ); @@ -1497,7 +1497,7 @@ void RTREE_QUAL::InitParVars( PartitionVars* a_parVars, int a_maxRects, int a_mi RTREE_TEMPLATE void RTREE_QUAL::PickSeeds( PartitionVars* a_parVars ) { - int seed0, seed1; + int seed0 = 0, seed1 = 0; // avoid compil complaint about uninitialized ELEMTYPEREAL worst, waste; ELEMTYPEREAL area[MAXNODES + 1]; diff --git a/pcbnew/github/github_plugin.cpp b/pcbnew/github/github_plugin.cpp index 9650361ccd..dd521f5de1 100644 --- a/pcbnew/github/github_plugin.cpp +++ b/pcbnew/github/github_plugin.cpp @@ -42,6 +42,13 @@ Possibly cache the zip file locally. Use HTTP's "have changed" or whatever it is called. */ + +#ifndef WIN32_LEAN_AND_MEAN +// when WIN32_LEAN_AND_MEAN is defined, some useless includes in +// are skipped, and this avoid some compil issues +#define WIN32_LEAN_AND_MEAN +#endif + #ifdef WIN32 // defines needed by avhttp // Minimal Windows version is XP: Google for _WIN32_WINNT