home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / gcc / bug / 3071 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.7 KB  |  54 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!mtholyoke.EDU!jbotz
  3. From: jbotz@mtholyoke.EDU (Jurgen Botz)
  4. Subject: Bug in gcc-2.3.3 found while compiling Tk-3.0
  5. Message-ID: <BzzHI7.HIr@mtholyoke.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Mount Holyoke College
  8. Distribution: gnu
  9. Date: Mon, 28 Dec 1992 19:15:41 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 41
  12.  
  13. I was just compiling the latest release of John Ousterhout's Tcl/Tk
  14. with gcc-2.3.3 when I got the following error in tkTrig.c:
  15.  
  16.   tkTrig.c: In function 'TkBezierScreenPoint':
  17.   tkTric.c:798: fp_offset (16) or end_offset (-4) is less than zero.
  18.  
  19. gcc-2.3.2 compiles the same file without complaining.  I don't have
  20. the know-how or time to try to track this down right now, but I thought
  21. I'd report it at least.  In case it might be helpful, here's the 
  22. function...
  23.  
  24.  
  25. void
  26. TkBezierScreenPoints(canvasPtr, control, numSteps, xPointPtr)
  27.     Tk_Canvas *canvasPtr;        /* Canvas in which curve is to be
  28.                      * drawn. */
  29.     double control[];            /* Array of coordinates for four
  30.                      * control points:  x0, y0, x1, y1,
  31.                      * ... x3 y3. */
  32.     int numSteps;            /* Number of curve points to
  33.                      * generate.  */
  34.     register XPoint *xPointPtr;        /* Where to put new points. */
  35. {
  36.     int i;
  37.     double u, u2, u3, t, t2, t3;
  38.  
  39.     for (i = 1; i <= numSteps; i++, xPointPtr++) {
  40.     t = ((double) i)/((double) numSteps);
  41.     t2 = t*t;
  42.     t3 = t2*t;
  43.     u = 1.0 - t;
  44.     u2 = u*u;
  45.     u3 = u2*u;
  46.     xPointPtr->x = SCREEN_X(canvasPtr, (control[0]*u3
  47.         + 3.0 * (control[2]*t*u2 + control[4]*t2*u) + control[6]*t3));
  48.     xPointPtr->y = SCREEN_Y(canvasPtr, (control[1]*u3
  49.         + 3.0 * (control[3]*t*u2 + control[5]*t2*u) + control[7]*t3));
  50.     }
  51. }
  52.  
  53.  
  54.