summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjoye <joye>2014-07-03 19:33:41 (GMT)
committerjoye <joye>2014-07-03 19:33:41 (GMT)
commit81a6cf69da010916185992b0e8a1fd2b09713444 (patch)
tree27cc676a4ecf1d60447f43f5d83a3449bfd3eeea /src
parent4213407fa8d2e2e9a810d17408c15d518bde2bde (diff)
downloadblt-81a6cf69da010916185992b0e8a1fd2b09713444.zip
blt-81a6cf69da010916185992b0e8a1fd2b09713444.tar.gz
blt-81a6cf69da010916185992b0e8a1fd2b09713444.tar.bz2
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/bltGrElem.C13
-rw-r--r--src/bltGrElemLine.C2
2 files changed, 7 insertions, 8 deletions
diff --git a/src/bltGrElem.C b/src/bltGrElem.C
index 815ebdc..b6db886 100644
--- a/src/bltGrElem.C
+++ b/src/bltGrElem.C
@@ -106,23 +106,21 @@ PenStyle** Element::StyleMap()
int nWeights = MIN(ops->w ? ops->w->nValues : 0, nPoints);
double* w = ops->w ? ops->w->values : NULL;
Blt_ChainLink link = Blt_Chain_FirstLink(ops->stylePalette);
- PenStyle *stylePtr = (PenStyle*)Blt_Chain_GetValue(link);
+ PenStyle* stylePtr = (PenStyle*)Blt_Chain_GetValue(link);
// Create a style mapping array (data point index to style),
// initialized to the default style.
- PenStyle** dataToStyle = new PenStyle*[nPoints];
+ PenStyle** dataToStyle = (PenStyle**)malloc(nPoints*sizeof(PenStyle*));
for (int ii=0; ii<nPoints; ii++)
dataToStyle[ii] = stylePtr;
for (int ii=0; ii<nWeights; ii++) {
- for (link = Blt_Chain_LastLink(ops->stylePalette); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
+ for (link=Blt_Chain_LastLink(ops->stylePalette); link;
+ link=Blt_Chain_PrevLink(link)) {
stylePtr = (PenStyle*)Blt_Chain_GetValue(link);
if (stylePtr->weight.range > 0.0) {
- double norm;
-
- norm = (w[ii] - stylePtr->weight.min) / stylePtr->weight.range;
+ double norm = (w[ii] - stylePtr->weight.min) / stylePtr->weight.range;
if (((norm - 1.0) <= DBL_EPSILON) &&
(((1.0 - norm) - 1.0) <= DBL_EPSILON)) {
dataToStyle[ii] = stylePtr;
@@ -131,6 +129,7 @@ PenStyle** Element::StyleMap()
}
}
}
+
return dataToStyle;
}
diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C
index afdfba9..9e741b8 100644
--- a/src/bltGrElemLine.C
+++ b/src/bltGrElemLine.C
@@ -383,7 +383,7 @@ void LineElement::map()
}
mergePens(styleMap);
- delete styleMap;
+ free(styleMap);
}
void LineElement::extents(Region2d *extsPtr)