Index: dump-svg.c =================================================================== --- dump-svg.c (revision 8039) +++ dump-svg.c (working copy) @@ -250,7 +250,6 @@ static void printSVGClose(float xMin, float yMin, float xMax, float yMax) { float scale; - int i;
scale = max((xMax-xMin)/CANVASWIDTH,(yMax-yMin)/CANVASHEIGHT); /* enclose whole canvas in its bounding box */ @@ -752,12 +751,12 @@ static void calculateIntersectionPoints(GraphEdge *tEdge) { float alpha, beta; - const float PI = acos(-1); + const float PI = (float)acos(-1);
/* calculate intersection of edge and startNode */ - alpha = atan2(tEdge->startNode->dia.y-tEdge->endNode->dia.y, + alpha = (float)atan2(tEdge->startNode->dia.y-tEdge->endNode->dia.y, tEdge->startNode->dia.x-tEdge->endNode->dia.x); - beta = atan2(tEdge->startNode->dia.h, tEdge->startNode->dia.w); + beta = (float)atan2(tEdge->startNode->dia.h, tEdge->startNode->dia.w); if (alpha < 0) alpha += PI; if (alpha < beta @@ -772,11 +771,11 @@
tEdge->startNode->dia.w/2; } if (tEdge->startNode->dia.y < tEdge->endNode->dia.y) { - tEdge->dia.startY = tEdge->startNode->dia.y + - fabsf(tEdge->startNode->dia.w*tan(alpha)/2); + tEdge->dia.startY = (float)(tEdge->startNode->dia.y + + fabsf(tEdge->startNode->dia.w*tan(alpha)/2)); } else { - tEdge->dia.startY = tEdge->startNode->dia.y - - fabsf(tEdge->startNode->dia.w*tan(alpha)/2); + tEdge->dia.startY = (float)(tEdge->startNode->dia.y - + fabsf(tEdge->startNode->dia.w*tan(alpha)/2)); } } else { /* intersection at top or bottom border */ @@ -788,18 +787,18 @@
tEdge->startNode->dia.h/2; } if (tEdge->startNode->dia.x < tEdge->endNode->dia.x) { - tEdge->dia.startX = tEdge->startNode->dia.x + - fabsf(tEdge->startNode->dia.h/(2*tan(alpha))); + tEdge->dia.startX = (float)(tEdge->startNode->dia.x + + fabsf(tEdge->startNode->dia.h/(2*tan(alpha)))); } else { - tEdge->dia.startX = tEdge->startNode->dia.x - - fabsf(tEdge->startNode->dia.h/(2*tan(alpha))); + tEdge->dia.startX = (float)(tEdge->startNode->dia.x - + fabsf(tEdge->startNode->dia.h/(2*tan(alpha)))); } }
/* calculate intersection of edge and endNode */ - alpha = atan2(tEdge->startNode->dia.y-tEdge->endNode->dia.y, + alpha = (float)atan2(tEdge->startNode->dia.y-tEdge->endNode->dia.y, tEdge->startNode->dia.x-tEdge->endNode->dia.x); - beta = atan2(tEdge->endNode->dia.h, tEdge->endNode->dia.w); + beta = (float)atan2(tEdge->endNode->dia.h, tEdge->endNode->dia.w); if (alpha < 0) alpha += PI; if (alpha < beta @@ -812,11 +811,11 @@ tEdge->dia.endX = tEdge->endNode->dia.x - tEdge->endNode->dia.w/2; } if (tEdge->startNode->dia.y > tEdge->endNode->dia.y) { - tEdge->dia.endY = tEdge->endNode->dia.y + - fabsf(tEdge->endNode->dia.w*tan(alpha)/2); + tEdge->dia.endY = (float)(tEdge->endNode->dia.y + + fabsf(tEdge->endNode->dia.w*tan(alpha)/2)); } else { - tEdge->dia.endY = tEdge->endNode->dia.y - - fabsf(tEdge->endNode->dia.w*tan(alpha)/2); + tEdge->dia.endY = (float)(tEdge->endNode->dia.y - + fabsf(tEdge->endNode->dia.w*tan(alpha)/2)); } } else { /* intersection at top or bottom border */ @@ -826,11 +825,11 @@ tEdge->dia.endY = tEdge->endNode->dia.y - tEdge->endNode->dia.h/2; } if (tEdge->startNode->dia.x > tEdge->endNode->dia.x) { - tEdge->dia.endX = tEdge->endNode->dia.x + - fabsf(tEdge->endNode->dia.h/(2*tan(alpha))); + tEdge->dia.endX = (float)(tEdge->endNode->dia.x + + fabsf(tEdge->endNode->dia.h/(2*tan(alpha)))); } else { - tEdge->dia.endX = tEdge->endNode->dia.x - - fabsf(tEdge->endNode->dia.h/(2*tan(alpha))); + tEdge->dia.endX = (float)(tEdge->endNode->dia.x - + fabsf(tEdge->endNode->dia.h/(2*tan(alpha)))); } } } @@ -1676,7 +1675,7 @@ int j, k; char *tooltip; SmiElement *smiElement; - StringListElem *tElem, *lastElem; + StringListElem *tElem;
printf(" <g id="MI%i" transform="translate", *miNr); printf("(%.2f,%.2f)">\n", *x, *y); @@ -1824,7 +1823,7 @@ /* SmiRevision *smiRevision; */ SmiOption *smiOption; SmiRefinement *smiRefinement; - StringListElem *tElem, *lastElem; + StringListElem *tElem;
printf(" <g id="MI%i" transform="translate", *miNr); printf("(%.2f,%.2f)">\n", *x, *y); @@ -2699,7 +2698,7 @@ i--;
/* test if we must shrink moduleInformation to fit it into canvas */ - miHeight = ((miCount + i - (2 * j)) * 15 + 10); + miHeight = (float)(((miCount + i - (2 * j)) * 15 + 10)); if (miHeight > maxHeight) scale *= maxHeight/miHeight;
@@ -2856,11 +2855,11 @@ if ((dist = intersect(vNode, eEdge))) { if (eEdge->startNode->dia.x == eEdge->endNode->dia.x) { eEdge->startNode->dia.xDisp -= - 8*(dist/fabsf(dist))*fr(1/dist, k); + (float)(8*(dist/fabsf(dist))*fr(1/dist, k)); eEdge->endNode->dia.xDisp -= - 8*(dist/fabsf(dist))*fr(1/dist, k); + (float)(8*(dist/fabsf(dist))*fr(1/dist, k)); vNode->dia.xDisp += - 8*(dist/fabsf(dist))*fr(1/dist, k); + (float)(8*(dist/fabsf(dist))*fr(1/dist, k)); } else { xDelta = -1*(eEdge->endNode->dia.y -eEdge->startNode->dia.y) @@ -2903,7 +2902,7 @@ vNode->dia.y += (vNode->dia.yDisp/absDisp)*min(absDisp, t); } /* reduce the temperature as the layout approaches a better configuration */ - t *= 0.9; + t *= (float)0.9; } }
@@ -2978,7 +2977,7 @@
tComponent->xOffset = *x - tComponent->xMin; *x += 10 + tComponent->xMax - tComponent->xMin; - tComponent->yOffset = -0.5*(tComponent->yMin+tComponent->yMax); + tComponent->yOffset = (float)(-0.5*(tComponent->yMin+tComponent->yMax)); if (tComponent->yMin + tComponent->yOffset < *yMin) *yMin = tComponent->yMin + tComponent->yOffset; if (tComponent->yMax + tComponent->yOffset > *yMax) @@ -3138,10 +3137,8 @@ */ static void generateSVG(int modc, SmiModule **modv) { - GraphNode *tNode, *lastNode = NULL; - GraphEdge *tEdge; - GraphComponent *tComponent; - int group, nodecount=0, singleNodes=1, miCount=0; + GraphNode *lastNode = NULL; + int nodecount=0, singleNodes=1, miCount=0; int i, idCount=0, TCcount=0, miPrint=0; float x=10, xMin=0, yMin=0, xMax=0, yMax=0, maxHeight=0;