Fixed uninitialized-memory errors detected by Valgrind

This commit is contained in:
Daniel Richard G 2013-09-16 16:22:14 -04:00
parent 44a3981fbf
commit 93145387f4
3 changed files with 8 additions and 4 deletions

View File

@ -61,7 +61,7 @@ void Group::GenerateLoops(void) {
if(type == DRAWING_3D || type == DRAWING_WORKPLANE ||
type == ROTATE || type == TRANSLATE || type == IMPORTED)
{
bool allClosed, allCoplanar, allNonZeroLen;
bool allClosed = false, allCoplanar = false, allNonZeroLen = false;
AssembleLoops(&allClosed, &allCoplanar, &allNonZeroLen);
if(!allCoplanar) {
polyError.how = POLY_NOT_COPLANAR;

View File

@ -299,10 +299,14 @@ void SEdgeList::CullExtraneousEdges(void) {
// that would naively be O(n).
//-----------------------------------------------------------------------------
SKdNodeEdges *SKdNodeEdges::Alloc(void) {
return (SKdNodeEdges *)AllocTemporary(sizeof(SKdNodeEdges));
SKdNodeEdges *ne = (SKdNodeEdges *)AllocTemporary(sizeof(SKdNodeEdges));
ZERO(ne);
return ne;
}
SEdgeLl *SEdgeLl::Alloc(void) {
return (SEdgeLl *)AllocTemporary(sizeof(SEdgeLl));
SEdgeLl *sell = (SEdgeLl *)AllocTemporary(sizeof(SEdgeLl));
ZERO(sell);
return sell;
}
SKdNodeEdges *SKdNodeEdges::From(SEdgeList *sel) {
SEdgeLl *sell = NULL;

View File

@ -61,7 +61,7 @@ bool GraphicsWindow::ToolbarMouseMoved(int x, int y) {
x += ((int)width/2);
y += ((int)height/2);
int nh;
int nh = 0;
bool withinToolbar = ToolbarDrawOrHitTest(x, y, false, &nh);
if(!withinToolbar) nh = 0;