pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/Ngraph Rename round() to ngraph_round(), to a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/69aa1582d1a2
branches:  trunk
changeset: 484995:69aa1582d1a2
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Thu Dec 02 14:08:16 2004 +0000

description:
Rename round() to ngraph_round(), to avoid conflict with function
defined in math.h. [bulk build fix]

diffstat:

 graphics/Ngraph/distinfo         |    3 +-
 graphics/Ngraph/patches/patch-ab |  148 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 150 insertions(+), 1 deletions(-)

diffs (166 lines):

diff -r 015c35307f6e -r 69aa1582d1a2 graphics/Ngraph/distinfo
--- a/graphics/Ngraph/distinfo  Thu Dec 02 13:34:29 2004 +0000
+++ b/graphics/Ngraph/distinfo  Thu Dec 02 14:08:16 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2004/11/29 20:31:16 wiz Exp $
+$NetBSD: distinfo,v 1.7 2004/12/02 14:08:16 wiz Exp $
 
 SHA1 (Ngraph-6.3.30-src.tar.gz) = 81574241f35258bb14139c6ae57b28789f0d297c
 Size (Ngraph-6.3.30-src.tar.gz) = 418984 bytes
@@ -7,3 +7,4 @@
 SHA1 (ileaf-widgets.tar.Z) = db0f6425f77bc3013b7aae163be558683661560e
 Size (ileaf-widgets.tar.Z) = 70223 bytes
 SHA1 (patch-aa) = 5b1f01b6a5e75489a8782d89ddfeeb60bc1c29fa
+SHA1 (patch-ab) = f2e9df51aeed77ebd6670abf0e34650f006b8c28
diff -r 015c35307f6e -r 69aa1582d1a2 graphics/Ngraph/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/Ngraph/patches/patch-ab  Thu Dec 02 14:08:16 2004 +0000
@@ -0,0 +1,148 @@
+$NetBSD: patch-ab,v 1.3 2004/12/02 14:08:16 wiz Exp $
+
+--- x11drive/gra2wmf.c.orig    2004-08-07 21:57:39.000000000 +0200
++++ x11drive/gra2wmf.c
+@@ -334,7 +334,7 @@ errexit:
+   return FALSE;
+ }
+ 
+-int round(double x)
++int ngraph_round(double x)
+ {
+   int ix;
+   double dx;
+@@ -831,8 +831,8 @@ void lineto(HDC DC,int x,int y)
+     len2=len=sqrt(dx*dx+dy*dy);
+     while (len2>((dashlist)[dashi]-dashlen)) {
+       dd=(len-len2+(dashlist)[dashi]-dashlen)/len;
+-      gx=gx1+round(dx*dd);
+-      gy=gy1+round(dy*dd);
++      gx=gx1+ngraph_round(dx*dd);
++      gy=gy1+ngraph_round(dy*dd);
+       if (dotf) LineTo(DC,gx,gy);
+       else MoveTo(DC,gx,gy);
+       dotf=dotf ? FALSE : TRUE;
+@@ -853,22 +853,22 @@ void lineto(HDC DC,int x,int y)
+ 
+ int dot2pixel(int r)
+ {
+-  return round(r*pixel_dot);
++  return ngraph_round(r*pixel_dot);
+ }
+ 
+ int dot2pixelx(int x)
+ {
+-  return round(x*pixel_dot+offsetx-scrollx);
++  return ngraph_round(x*pixel_dot+offsetx-scrollx);
+ }
+ 
+ int dot2pixely(int y)
+ {
+-  return round(y*pixel_dot+offsety-scrolly);
++  return ngraph_round(y*pixel_dot+offsety-scrolly);
+ }
+ 
+ int pixel2dot(int r)
+ {
+-  return round(r/pixel_dot);
++  return ngraph_round(r/pixel_dot);
+ }
+ 
+ void draw(char code,int *cpar,char *cstr)
+@@ -1018,10 +1018,10 @@ void draw(char code,int *cpar,char *cstr
+                dot2pixely(cpar[2]-cpar[4]),
+                dot2pixelx(cpar[1]+cpar[3]),
+                dot2pixely(cpar[2]+cpar[4]),
+-               dot2pixelx(cpar[1]+round(cpar[3]*cos(Theta1)))-1,
+-               dot2pixely(cpar[2]-round(cpar[4]*sin(Theta1)))-1,
+-               dot2pixelx(cpar[1]+round(cpar[3]*cos(Theta2)))-1,
+-               dot2pixely(cpar[2]-round(cpar[4]*sin(Theta2)))-1);
++               dot2pixelx(cpar[1]+ngraph_round(cpar[3]*cos(Theta1)))-1,
++               dot2pixely(cpar[2]-ngraph_round(cpar[4]*sin(Theta1)))-1,
++               dot2pixelx(cpar[1]+ngraph_round(cpar[3]*cos(Theta2)))-1,
++               dot2pixely(cpar[2]-ngraph_round(cpar[4]*sin(Theta2)))-1);
+       } else {
+         TmpPen=OrgPen;
+         SelectObject(DC,TmpPen);
+@@ -1033,19 +1033,19 @@ void draw(char code,int *cpar,char *cstr
+                  dot2pixely(cpar[2]-cpar[4]),
+                  dot2pixelx(cpar[1]+cpar[3]),
+                  dot2pixely(cpar[2]+cpar[4]),
+-                 dot2pixelx(cpar[1]+round(cpar[3]*cos(Theta1)))-1,
+-                 dot2pixely(cpar[2]-round(cpar[4]*sin(Theta1)))-1,
+-                 dot2pixelx(cpar[1]+round(cpar[3]*cos(Theta2)))-1,
+-                 dot2pixely(cpar[2]-round(cpar[4]*sin(Theta2)))-1);
++                 dot2pixelx(cpar[1]+ngraph_round(cpar[3]*cos(Theta1)))-1,
++                 dot2pixely(cpar[2]-ngraph_round(cpar[4]*sin(Theta1)))-1,
++                 dot2pixelx(cpar[1]+ngraph_round(cpar[3]*cos(Theta2)))-1,
++                 dot2pixely(cpar[2]-ngraph_round(cpar[4]*sin(Theta2)))-1);
+         } else {
+           Chord(DC,dot2pixelx(cpar[1]-cpar[3]),
+                    dot2pixely(cpar[2]-cpar[4]),
+                    dot2pixelx(cpar[1]+cpar[3]),
+                    dot2pixely(cpar[2]+cpar[4]),
+-                   dot2pixelx(cpar[1]+round(cpar[3]*cos(Theta1)))-1,
+-                   dot2pixely(cpar[2]-round(cpar[4]*sin(Theta1)))-1,
+-                   dot2pixelx(cpar[1]+round(cpar[3]*cos(Theta2)))-1,
+-                   dot2pixely(cpar[2]-round(cpar[4]*sin(Theta2)))-1);
++                   dot2pixelx(cpar[1]+ngraph_round(cpar[3]*cos(Theta1)))-1,
++                   dot2pixely(cpar[2]-ngraph_round(cpar[4]*sin(Theta1)))-1,
++                   dot2pixelx(cpar[1]+ngraph_round(cpar[3]*cos(Theta2)))-1,
++                   dot2pixely(cpar[2]-ngraph_round(cpar[4]*sin(Theta2)))-1);
+         }
+         SelectObject(DC,ThePen);
+       }
+@@ -1129,9 +1129,9 @@ void draw(char code,int *cpar,char *cstr
+       loadfontf=FALSE;
+       break;
+     }
+-    IDFont.lfHeight=-round(pixel_dot*fontsize);
++    IDFont.lfHeight=-ngraph_round(pixel_dot*fontsize);
+     IDFont.lfWidth=0;
+-    IDFont.lfEscapement=IDFont.lfOrientation=round(fontdir*10);
++    IDFont.lfEscapement=IDFont.lfOrientation=ngraph_round(fontdir*10);
+     IDFont.lfUnderline=0;
+     IDFont.lfStrikeOut=0;
+     IDFont.lfPitchAndFamily=0;
+@@ -1199,8 +1199,8 @@ void draw(char code,int *cpar,char *cstr
+     if (s==NULL) break;
+     x0=cpx;
+     y0=cpy;
+-    TextOut(DC,dot2pixelx(round(x0)),
+-               dot2pixely(round(y0)),s,strlen(s));
++    TextOut(DC,dot2pixelx(ngraph_round(x0)),
++               dot2pixely(ngraph_round(y0)),s,strlen(s));
+     fontwidth=0;
+     for (i=0;i<strlen(s);i++) {
+       fontwidth+=charwidth((unsigned char)s[i],fontalias,fontsize/25.4*72);
+@@ -1209,15 +1209,15 @@ void draw(char code,int *cpar,char *cstr
+     free(s);
+     x0+=fontwidth*fontcos;
+     y0-=fontwidth*fontsin;
+-    cpx=round(x0);
+-    cpy=round(y0);
++    cpx=ngraph_round(x0);
++    cpy=ngraph_round(y0);
+     break;
+   case 'K':
+     if (!loadfontf) break;
+     x0=cpx;
+     y0=cpy;
+-    TextOut(DC,dot2pixelx(round(x0)),
+-               dot2pixely(round(y0)),cstr,strlen(cstr));
++    TextOut(DC,dot2pixelx(ngraph_round(x0)),
++               dot2pixely(ngraph_round(y0)),cstr,strlen(cstr));
+     fontwidth=0;
+     for (i=0;i<strlen(s);i+=2) {
+       fontwidth+=charwidth((((unsigned char)cstr[i+1])<<8)+(unsigned char)cstr[i],
+@@ -1226,8 +1226,8 @@ void draw(char code,int *cpar,char *cstr
+     }
+     x0+=fontwidth*fontcos;
+     y0-=fontwidth*fontsin;
+-    cpx=round(x0);
+-    cpy=round(y0);
++    cpx=ngraph_round(x0);
++    cpy=ngraph_round(y0);
+     break;
+   default: break;
+   }



Home | Main Index | Thread Index | Old Index