@@ -569,7 +569,7 @@ ConfigureLine(
569569 }
570570 if ((linePtr -> lastArrowPtr != NULL ) && (linePtr -> arrow != ARROWS_LAST )
571571 && (linePtr -> arrow != ARROWS_BOTH )) {
572- int i ;
572+ Tcl_Size i ;
573573
574574 i = 2 * (linePtr -> numPoints - 1 );
575575 linePtr -> coordPtr [i ] = linePtr -> lastArrowPtr [0 ];
@@ -847,7 +847,7 @@ DisplayLine(
847847 XPoint staticPoints [MAX_STATIC_POINTS * 3 ];
848848 XPoint * pointPtr ;
849849 double linewidth ;
850- int numPoints ;
850+ Tcl_Size numPoints ;
851851 Tk_State state = itemPtr -> state ;
852852
853853 if (!linePtr -> numPoints || (linePtr -> outline .gc == NULL )) {
@@ -876,7 +876,7 @@ DisplayLine(
876876
877877 if ((linePtr -> smooth ) && (linePtr -> numPoints > 2 )) {
878878 numPoints = linePtr -> smooth -> coordProc (canvas , NULL ,
879- linePtr -> numPoints , linePtr -> splineSteps , NULL , NULL );
879+ ( int ) linePtr -> numPoints , linePtr -> splineSteps , NULL , NULL );
880880 } else {
881881 numPoints = linePtr -> numPoints ;
882882 }
@@ -889,7 +889,7 @@ DisplayLine(
889889
890890 if ((linePtr -> smooth ) && (linePtr -> numPoints > 2 )) {
891891 numPoints = linePtr -> smooth -> coordProc (canvas , linePtr -> coordPtr ,
892- linePtr -> numPoints , linePtr -> splineSteps , pointPtr , NULL );
892+ ( int ) linePtr -> numPoints , linePtr -> splineSteps , pointPtr , NULL );
893893 } else {
894894 numPoints = TkCanvTranslatePath ((TkCanvas * ) canvas , numPoints ,
895895 linePtr -> coordPtr , 0 , pointPtr );
@@ -907,7 +907,7 @@ DisplayLine(
907907 & linePtr -> outline .tsoffset );
908908 }
909909 if (numPoints > 1 ) {
910- XDrawLines (display , drawable , linePtr -> outline .gc , pointPtr , numPoints ,
910+ XDrawLines (display , drawable , linePtr -> outline .gc , pointPtr , ( int ) numPoints ,
911911 CoordModeOrigin );
912912 } else {
913913 int intwidth = (int ) (linewidth + 0.5 );
@@ -1014,7 +1014,7 @@ LineInsert(
10141014 }
10151015 }
10161016
1017- for (i = ( int ) beforeThis ; i < length ; i ++ ) {
1017+ for (i = beforeThis ; i < length ; i ++ ) {
10181018 newCoordPtr [i + objc ] = linePtr -> coordPtr [i ];
10191019 }
10201020 if (linePtr -> coordPtr ) {
@@ -1082,7 +1082,7 @@ LineInsert(
10821082
10831083 itemPtr -> redraw_flags &= ~TK_ITEM_DONT_REDRAW ;
10841084 } else {
1085- beforeThis -= ( int ) beforeThis % 6 ;
1085+ beforeThis -= beforeThis % 6 ;
10861086 objc += 4 ;
10871087 }
10881088
@@ -1096,16 +1096,16 @@ LineInsert(
10961096 }
10971097
10981098 if (itemPtr -> redraw_flags & TK_ITEM_DONT_REDRAW ) {
1099- if (( int ) beforeThis < 0 ) {
1099+ if (beforeThis < 0 ) {
11001100 beforeThis = 0 ;
11011101 }
1102- if (( int ) beforeThis + objc > length ) {
1103- objc = length - ( int ) beforeThis ;
1102+ if (beforeThis + objc > length ) {
1103+ objc = length - beforeThis ;
11041104 }
11051105
11061106 itemPtr -> x1 = itemPtr -> x2 = (int ) linePtr -> coordPtr [beforeThis ];
11071107 itemPtr -> y1 = itemPtr -> y2 = (int ) linePtr -> coordPtr [beforeThis + 1 ];
1108- if ((linePtr -> firstArrowPtr != NULL ) && (( int ) beforeThis < 2 )) {
1108+ if ((linePtr -> firstArrowPtr != NULL ) && (beforeThis < 2 )) {
11091109 /*
11101110 * Include old first arrow.
11111111 */
@@ -1115,7 +1115,7 @@ LineInsert(
11151115 TkIncludePoint (itemPtr , coordPtr );
11161116 }
11171117 }
1118- if ((linePtr -> lastArrowPtr != NULL ) && (( int ) beforeThis + objc >= length )) {
1118+ if ((linePtr -> lastArrowPtr != NULL ) && (beforeThis + objc >= length )) {
11191119 /*
11201120 * Include old last arrow.
11211121 */
@@ -1149,7 +1149,7 @@ LineInsert(
11491149 double width ;
11501150 int intWidth ;
11511151
1152- if ((linePtr -> firstArrowPtr != NULL ) && (( int ) beforeThis < 2 )) {
1152+ if ((linePtr -> firstArrowPtr != NULL ) && (beforeThis < 2 )) {
11531153 /*
11541154 * Include new first arrow.
11551155 */
@@ -1159,7 +1159,7 @@ LineInsert(
11591159 TkIncludePoint (itemPtr , coordPtr );
11601160 }
11611161 }
1162- if ((linePtr -> lastArrowPtr != NULL ) && (( int ) beforeThis + objc >= length )) {
1162+ if ((linePtr -> lastArrowPtr != NULL ) && (beforeThis + objc >= length )) {
11631163 /*
11641164 * Include new last arrow.
11651165 */
@@ -1219,10 +1219,10 @@ LineDeleteCoords(
12191219 Tcl_Size last ) /* Index of last character to delete. */
12201220{
12211221 LineItem * linePtr = (LineItem * ) itemPtr ;
1222- int count , i , first1 , last1 , nbDelPoints ;
1223- int oriNumPoints = linePtr -> numPoints ;
1224- int canOptimize = 1 ;
1225- int length = 2 * linePtr -> numPoints ;
1222+ Tcl_Size count , i , first1 , last1 , nbDelPoints ;
1223+ Tcl_Size oriNumPoints = linePtr -> numPoints ;
1224+ bool canOptimize = true ;
1225+ Tcl_Size length = 2 * linePtr -> numPoints ;
12261226 double * coordPtr ;
12271227 Tk_State state = itemPtr -> state ;
12281228
@@ -1233,13 +1233,13 @@ LineDeleteCoords(
12331233 first &= -2 ; /* If odd, make it even. */
12341234 last &= -2 ;
12351235
1236- if (( int ) first < 0 ) {
1236+ if (first < 0 ) {
12371237 first = 0 ;
12381238 }
1239- if (( int ) last >= length ) {
1239+ if (last >= length ) {
12401240 last = length - 2 ;
12411241 }
1242- if (( int ) first > ( int ) last ) {
1242+ if (first > last ) {
12431243 return ;
12441244 }
12451245
@@ -1302,7 +1302,7 @@ LineDeleteCoords(
13021302 * something else than a multiple of 3 points.
13031303 */
13041304
1305- canOptimize = 0 ;
1305+ canOptimize = false ;
13061306 }
13071307 else {
13081308 first1 -= first1 % 6 ;
@@ -1314,7 +1314,7 @@ LineDeleteCoords(
13141314 * Custom smoothing method. No optimization is possible.
13151315 */
13161316
1317- canOptimize = 0 ;
1317+ canOptimize = false ;
13181318 }
13191319 }
13201320
@@ -1463,8 +1463,8 @@ LineToPoint(
14631463 double staticSpace [2 * MAX_STATIC_POINTS ];
14641464 double poly [10 ];
14651465 double bestDist , dist , width ;
1466- int numPoints , count ;
1467- int changedMiterToBevel ; /* Non-zero means that a mitered corner had to
1466+ Tcl_Size numPoints , count ;
1467+ bool changedMiterToBevel ; /* true means that a mitered corner had to
14681468 * be treated as beveled after all because the
14691469 * angle was < 11 degrees. */
14701470
@@ -1492,14 +1492,14 @@ LineToPoint(
14921492
14931493 if ((linePtr -> smooth ) && (linePtr -> numPoints > 2 )) {
14941494 numPoints = linePtr -> smooth -> coordProc (canvas , NULL ,
1495- linePtr -> numPoints , linePtr -> splineSteps , NULL , NULL );
1495+ ( int ) linePtr -> numPoints , linePtr -> splineSteps , NULL , NULL );
14961496 if (numPoints <= MAX_STATIC_POINTS ) {
14971497 linePoints = staticSpace ;
14981498 } else {
14991499 linePoints = (double * )Tcl_Alloc (2 * numPoints * sizeof (double ));
15001500 }
15011501 numPoints = linePtr -> smooth -> coordProc (canvas , linePtr -> coordPtr ,
1502- linePtr -> numPoints , linePtr -> splineSteps , NULL , linePoints );
1502+ ( int ) linePtr -> numPoints , linePtr -> splineSteps , NULL , linePoints );
15031503 } else {
15041504 numPoints = linePtr -> numPoints ;
15051505 linePoints = linePtr -> coordPtr ;
@@ -1527,7 +1527,7 @@ LineToPoint(
15271527 * joints and caps.
15281528 */
15291529
1530- changedMiterToBevel = 0 ;
1530+ changedMiterToBevel = false ;
15311531 for (count = numPoints , coordPtr = linePoints ; count >= 2 ;
15321532 count -- , coordPtr += 2 ) {
15331533 /*
@@ -1582,7 +1582,7 @@ LineToPoint(
15821582 } else if (dist < bestDist ) {
15831583 bestDist = dist ;
15841584 }
1585- changedMiterToBevel = 0 ;
1585+ changedMiterToBevel = false ;
15861586 }
15871587 }
15881588 if (count == 2 ) {
@@ -1591,7 +1591,7 @@ LineToPoint(
15911591 } else if (linePtr -> joinStyle == JoinMiter ) {
15921592 if (!TkGetMiterPoints (coordPtr , coordPtr + 2 , coordPtr + 4 ,
15931593 width , poly + 4 , poly + 6 )) {
1594- changedMiterToBevel = 1 ;
1594+ changedMiterToBevel = true ;
15951595 TkGetButtPoints (coordPtr , coordPtr + 2 , width , 0 ,
15961596 poly + 4 , poly + 6 );
15971597 }
@@ -1687,7 +1687,8 @@ LineToArea(
16871687 LineItem * linePtr = (LineItem * ) itemPtr ;
16881688 double staticSpace [2 * MAX_STATIC_POINTS ];
16891689 double * linePoints ;
1690- int numPoints , result ;
1690+ Tcl_Size numPoints ;
1691+ int result ;
16911692 double radius , width ;
16921693 Tk_State state = itemPtr -> state ;
16931694
@@ -1726,14 +1727,14 @@ LineToArea(
17261727
17271728 if ((linePtr -> smooth ) && (linePtr -> numPoints > 2 )) {
17281729 numPoints = linePtr -> smooth -> coordProc (canvas , NULL ,
1729- linePtr -> numPoints , linePtr -> splineSteps , NULL , NULL );
1730+ ( int ) linePtr -> numPoints , linePtr -> splineSteps , NULL , NULL );
17301731 if (numPoints <= MAX_STATIC_POINTS ) {
17311732 linePoints = staticSpace ;
17321733 } else {
17331734 linePoints = (double * )Tcl_Alloc (2 * numPoints * sizeof (double ));
17341735 }
17351736 numPoints = linePtr -> smooth -> coordProc (canvas , linePtr -> coordPtr ,
1736- linePtr -> numPoints , linePtr -> splineSteps , NULL , linePoints );
1737+ ( int ) linePtr -> numPoints , linePtr -> splineSteps , NULL , linePoints );
17371738 } else {
17381739 numPoints = linePtr -> numPoints ;
17391740 linePoints = linePtr -> coordPtr ;
@@ -2518,7 +2519,7 @@ LineToPostscript(
25182519 Tk_CanvasPsPath (interp , canvas , linePtr -> coordPtr , linePtr -> numPoints );
25192520 } else if ((stipple == None ) && linePtr -> smooth -> postscriptProc ) {
25202521 linePtr -> smooth -> postscriptProc (interp , canvas , linePtr -> coordPtr ,
2521- linePtr -> numPoints , linePtr -> splineSteps );
2522+ ( int ) linePtr -> numPoints , linePtr -> splineSteps );
25222523 } else {
25232524 /*
25242525 * Special hack: Postscript printers don't appear to be able to turn a
@@ -2533,13 +2534,13 @@ LineToPostscript(
25332534 int numPoints ;
25342535
25352536 numPoints = linePtr -> smooth -> coordProc (canvas , NULL ,
2536- linePtr -> numPoints , linePtr -> splineSteps , NULL , NULL );
2537+ ( int ) linePtr -> numPoints , linePtr -> splineSteps , NULL , NULL );
25372538 pointPtr = staticPoints ;
25382539 if (numPoints > MAX_STATIC_POINTS ) {
25392540 pointPtr = (double * )Tcl_Alloc (numPoints * 2 * sizeof (double ));
25402541 }
25412542 numPoints = linePtr -> smooth -> coordProc (canvas , linePtr -> coordPtr ,
2542- linePtr -> numPoints , linePtr -> splineSteps , NULL , pointPtr );
2543+ ( int ) linePtr -> numPoints , linePtr -> splineSteps , NULL , pointPtr );
25432544 Tk_CanvasPsPath (interp , canvas , pointPtr , numPoints );
25442545 if (pointPtr != staticPoints ) {
25452546 Tcl_Free (pointPtr );
0 commit comments