Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-libs/mathgl/files: mathgl-1.11.2-cast.patch
Date: Thu, 01 Mar 2012 07:41:28
Message-Id: 20120301074106.7AD482004B@flycatcher.gentoo.org
1 jlec 12/03/01 07:41:06
2
3 Added: mathgl-1.11.2-cast.patch
4 Log:
5 Add patch to compile with latest gcc, #406277, provided by Helmut Jarausch; moved to eapi=4 and autotools-utils.eclass
6
7 (Portage version: 2.2.0_alpha89/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sci-libs/mathgl/files/mathgl-1.11.2-cast.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/mathgl/files/mathgl-1.11.2-cast.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/mathgl/files/mathgl-1.11.2-cast.patch?rev=1.1&content-type=text/plain
14
15 Index: mathgl-1.11.2-cast.patch
16 ===================================================================
17 --- mgl/mgl_eps.cpp.ORIG 2011-05-30 13:12:29.000000000 +0200
18 +++ mgl/mgl_eps.cpp 2012-02-29 11:26:55.651230100 +0100
19 @@ -19,7 +19,7 @@
20 ***************************************************************************/
21 #include <stdlib.h>
22 #include <time.h>
23 -#include <zlib.h>
24 +#include <zlib.h>
25 #include "mgl/mgl_eps.h"
26 #include "mgl/mgl_c.h"
27 #include "mgl/mgl_f.h"
28 @@ -85,7 +85,7 @@
29 a.x[0]=p1[0]; a.y[0]=p1[1]; a.x[1]=p2[0]; a.y[1]=p2[1];
30 a.zz[0]=p1[2]; a.zz[1]=p2[2];
31 a.c[0]=(c1[0]+c2[0])/2; a.c[1]=(c1[1]+c2[1])/2; a.c[2]=(c1[2]+c2[2])/2;
32 -// a.c[0]=c1[0]; a.c[1]=c1[1]; a.c[2]=c1[2];
33 +// a.c[0]=c1[0]; a.c[1]=c1[1]; a.c[2]=c1[2];
34 a.style=all? 0xffff:PDef; a.s = pPos;
35 add_prim(a);
36 pPos = fmod(pPos+hypot(p2[0]-p1[0], p2[1]-p1[1])/pw/1.5, 16);
37 @@ -197,7 +197,7 @@
38 {
39 mglPrim a(4);
40 a.s = fscl/PlotFactor; a.w = ftet;
41 - a.x[0] = (xPos - zoomx1*Width) /zoomx2;
42 + a.x[0] = (xPos - zoomx1*Width) /zoomx2;
43 a.y[0] = (yPos - zoomy1*Height)/zoomy2;
44 a.x[1] = x; a.y[1] = y;
45 a.zz[1] = f/fnt->GetFact(s&3);
46 @@ -260,10 +260,10 @@
47 }
48 //-----------------------------------------------------------------------------
49 void mglGraphPS::add_light(mreal *b, mreal n0,mreal n1, mreal n2)
50 -{
51 - mreal n[3]={n0,n1,n2};
52 - unsigned char r[4];
53 - col2int(b,n,r);
54 +{
55 + mreal n[3]={n0,n1,n2};
56 + unsigned char r[4];
57 + col2int(b,n,r);
58 b[0]=r[0]/255.; b[1]=r[1]/255.; b[2]=r[2]/255.; b[3]=r[3]/255.;
59 }
60 //-----------------------------------------------------------------------------
61 @@ -303,9 +303,9 @@
62 if(!Finished) Finish();
63 time_t now;
64 time(&now);
65 -
66 - bool gz = fname[strlen(fname)-1]=='z';
67 - void *fp = gz ? gzopen(fname,"wt") : fopen(fname,"wt");
68 +
69 + bool gz = fname[strlen(fname)-1]=='z';
70 + void *fp = gz ? (void*)gzopen(fname,"wt") : (void*)fopen(fname,"wt");
71 if(!fp) { SetWarn(mglWarnOpen,fname); return; }
72 mgl_printf(fp, gz, "%%!PS-Adobe-3.0 EPSF-3.0\n%%%%BoundingBox: 0 0 %d %d\n",Width,Height);
73 mgl_printf(fp, gz, "%%%%Creator: MathGL library\n%%%%Title: %s\n",descr ? descr : fname);
74 @@ -320,9 +320,9 @@
75 mgl_printf(fp, gz, "/m_c {ss 0.3 mul 0 360 arc} def\n");
76 mgl_printf(fp, gz, "/d0 {[] 0 setdash} def\n/sd {setdash} def\n");
77
78 - bool m_p=false,m_x=false,m_d=false,m_v=false,m_t=false,
79 - m_s=false,m_a=false,m_o=false,m_T=false,
80 - m_V=false,m_S=false,m_D=false,m_Y=false,m_l=false,
81 + bool m_p=false,m_x=false,m_d=false,m_v=false,m_t=false,
82 + m_s=false,m_a=false,m_o=false,m_T=false,
83 + m_V=false,m_S=false,m_D=false,m_Y=false,m_l=false,
84 m_L=false,m_r=false,m_R=false,m_X=false,m_P=false;
85 register long i;
86 // add mark definition if present
87 @@ -336,11 +336,11 @@
88 if(P[i].m=='S') m_S = true; if(P[i].m=='D') m_D = true;
89 if(P[i].m=='V') m_V = true; if(P[i].m=='T') m_T = true;
90 if(P[i].m=='<') m_l = true; if(P[i].m=='L') m_L = true;
91 - if(P[i].m=='>') m_r = true; if(P[i].m=='R') m_R = true;
92 - if(P[i].m=='Y') m_Y = true;
93 + if(P[i].m=='>') m_r = true; if(P[i].m=='R') m_R = true;
94 + if(P[i].m=='Y') m_Y = true;
95 if(P[i].m=='P') m_P = true; if(P[i].m=='X') m_X = true;
96 - }
97 - if(m_P) { m_p=true; m_s=true; }
98 + }
99 + if(m_P) { m_p=true; m_s=true; }
100 if(m_X) { m_x=true; m_s=true; }
101 if(m_p) mgl_printf(fp, gz, "/m_p {sm 0 rm s2 0 rl sm sm rm 0 s2 rl d0} def\n");
102 if(m_x) mgl_printf(fp, gz, "/m_x {sm sm rm s2 s2 rl 0 sm 2 mul rm sm 2 mul s2 rl d0} def\n");
103 @@ -453,7 +453,7 @@
104 }
105 for(i=0;i<pNum;i++) if(P[i].type==-1) P[i].type = 1;
106 mgl_printf(fp, gz, "\nshowpage\n%%%%EOF\n");
107 - if(gz) gzclose(fp); else fclose((FILE *)fp);
108 + if(gz) gzclose((gzFile_s*)fp); else fclose((FILE *)fp);
109 }
110 //-----------------------------------------------------------------------------
111 void mglGraphPS::WriteSVG(const char *fname,const char *descr)
112 @@ -463,8 +463,8 @@
113 time_t now;
114 time(&now);
115
116 - bool gz = fname[strlen(fname)-1]=='z';
117 - void *fp = gz ? gzopen(fname,"wt") : fopen(fname,"wt");
118 + bool gz = fname[strlen(fname)-1]=='z';
119 + void *fp = gz ? (void*)gzopen(fname,"wt") : (void*)fopen(fname,"wt");
120 if(!fp) { SetWarn(mglWarnOpen,fname); return; }
121 mgl_printf(fp, gz, "<?xml version=\"1.0\" standalone=\"no\"?>\n");
122 mgl_printf(fp, gz, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20000303 Stylable//EN\" \"http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd\">\n");
123 @@ -576,10 +576,10 @@
124 // const char *dash[]={"", "8 8","4 4","1 3","7 4 1 4","3 2 1 2"};
125 mgl_printf(fp, gz, "<g stroke=\"#%02x%02x%02x\"",
126 int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2]));
127 - if(P[i].style)
128 - {
129 - mgl_printf(fp, gz, " stroke-dasharray=\"%s\"", mgl_get_dash(P[i].style,P[i].w));
130 - mgl_printf(fp, gz, " stroke-dashoffset=\"%g\"", P[i].s*P[i].w);
131 + if(P[i].style)
132 + {
133 + mgl_printf(fp, gz, " stroke-dasharray=\"%s\"", mgl_get_dash(P[i].style,P[i].w));
134 + mgl_printf(fp, gz, " stroke-dashoffset=\"%g\"", P[i].s*P[i].w);
135 }
136 if(P[i].w>1) mgl_printf(fp, gz, " stroke-width=\"%g\"", P[i].w);
137 memcpy(cp,P[i].c,3*sizeof(mreal));
138 @@ -620,7 +620,7 @@
139
140 for(i=0;i<pNum;i++) if(P[i].type==-1) P[i].type = 1;
141 mgl_printf(fp, gz, "</g></svg>");
142 - if(gz) gzclose(fp); else fclose((FILE *)fp);
143 + if(gz) gzclose((gzFile_s*)fp); else fclose((FILE *)fp);
144 }
145 //-----------------------------------------------------------------------------
146 void mglGraphPS::Finish()
147 @@ -643,31 +643,31 @@
148 #define imax(a,b) (a)>(b) ? (a) : (b)
149 #define imin(a,b) (a)<(b) ? (a) : (b)
150 void mglPrim::Draw(mglGraphPS *gr)
151 -{
152 - mreal pp[12]={x[0],y[0],z, x[1],y[1],z, x[2],y[2],z, x[3],y[3],z};
153 - gr->draw_prim(this, pp, c);
154 -}
155 +{
156 + mreal pp[12]={x[0],y[0],z, x[1],y[1],z, x[2],y[2],z, x[3],y[3],z};
157 + gr->draw_prim(this, pp, c);
158 +}
159 //-----------------------------------------------------------------------------
160 -void mglGraphPS::draw_prim(mglPrim *pr, mreal *pp, mreal *c)
161 -{
162 +void mglGraphPS::draw_prim(mglPrim *pr, mreal *pp, mreal *c)
163 +{
164 ObjId = pr->id; memcpy(CDef,c,4*sizeof(mreal));
165 - bool ul=UseLight; UseLight=false;
166 - int m = pr->m, s = pr->style;
167 - switch(pr->type)
168 - {
169 - case 0: mglGraphAB::mark_plot(pp,pr->m); break;
170 - case 1: PDef = pr->style; pPos = pr->s;
171 + bool ul=UseLight; UseLight=false;
172 + int m = pr->m, s = pr->style;
173 + switch(pr->type)
174 + {
175 + case 0: mglGraphAB::mark_plot(pp,pr->m); break;
176 + case 1: PDef = pr->style; pPos = pr->s;
177 mglGraphAB::line_plot(pp,pp+3,c,c); break;
178 case 2: mglGraphAB::trig_plot(pp,pp+3,pp+6,c,c,c); break;
179 case 3: mglGraphAB::quad_plot(pp,pp+3,pp+6,pp+9,c,c,c,c); break;
180 case 4:
181 mreal pf=PlotFactor; Push();
182 - SetPosScale(pp[0],pp[1],pp[2],pr->s*PlotFactor); RotateN(pr->w,0,0,1);
183 + SetPosScale(pp[0],pp[1],pp[2],pr->s*PlotFactor); RotateN(pr->w,0,0,1);
184 mglGraphAB::Glyph(pr->x[1],pr->y[1],pr->zz[1]*fnt->GetFact(s&3),s,m,0);
185 - Pop(); PlotFactor=pf;
186 + Pop(); PlotFactor=pf;
187 break;
188 }
189 - UseLight=ul;
190 + UseLight=ul;
191 }
192 //-----------------------------------------------------------------------------
193 void mglGraphPS::pnt_plot(long x,long y, mreal, unsigned char c[4])
194 --- mgl/mgl_export.cpp.ORIG 2011-05-30 13:12:29.000000000 +0200
195 +++ mgl/mgl_export.cpp 2012-02-29 11:52:31.496163039 +0100
196 @@ -232,7 +232,7 @@
197 va_start(lst,str);
198 vsprintf(buf,str,lst);
199 va_end(lst);
200 - if(gz) gzprintf(fp, "%s", buf);
201 + if(gz) gzprintf((gzFile_s*)fp, "%s", buf);
202 else fprintf((FILE *)fp, "%s", buf);
203 }
204 //---------------------------------------------------------------------------
205 @@ -243,7 +243,7 @@
206 register long i,j;
207 bool gz = fname[strlen(fname)-1]=='z';
208
209 - void *fp = gz ? gzopen(fname,"wt") : fopen(fname,"wt");
210 + void *fp = gz ? (void*)gzopen(fname,"wt") : (void*)fopen(fname,"wt");
211 mgl_printf(fp, gz, "%%!PS-Adobe-3.0 EPSF-3.0\n%%%%BoundingBox: 0 0 %d %d\n",w,h);
212 mgl_printf(fp, gz, "%%%%Creator: MathGL library\n%%%%Title: %s\n", fname);
213 mgl_printf(fp, gz, "%%%%CreationDate: %s\n",ctime(&now));
214 @@ -255,7 +255,7 @@
215 mgl_printf(fp, gz, "%02x%02x%02x",p[j][3*i],p[j][3*i+1],p[j][3*i+2]);
216 }
217 mgl_printf(fp, gz, "\n\nshowpage\n%%%%EOF\n");
218 - if(gz) gzclose(fp); else fclose((FILE *)fp);
219 + if(gz) gzclose((gzFile_s*)fp); else fclose((FILE *)fp);
220 return 0;
221 }
222 //-----------------------------------------------------------------------------