Date: Sat, 19 Jul 2003 05:05:39 +0200 From: Simon Barner <barner@in.tum.de> To: Kris Kennaway <kris@obsecurity.org> Cc: current@FreeBSD.org Subject: Re: Fixing gcc 3.3 compile failures -- fix for math/freefem Message-ID: <20030719030539.GB467@zi025.glhnet.mhn.de> In-Reply-To: <20030718025200.GA36893@rot13.obsecurity.org> References: <20030718025200.GA36893@rot13.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--eNMatiwYGLtwo1cJ Content-Type: multipart/mixed; boundary="6Vw0j8UKbyX0bfpA" Content-Disposition: inline --6Vw0j8UKbyX0bfpA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline --6Vw0j8UKbyX0bfpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-freefem::fem::femDisk.cpp" Content-Transfer-Encoding: quoted-printable --- freefem/fem/femDisk.cpp.orig Sat Jul 19 04:09:32 2003 +++ freefem/fem/femDisk.cpp Sat Jul 19 04:13:43 2003 @@ -95,7 +95,7 @@ char *result =3D 0; int dummy; =20 - ifstream fin( path ); + std::ifstream fin( path ); =20 if ( fin.fail() ) { @@ -198,7 +198,7 @@ int i; char *result =3D NULL; =20 - ofstream fout( path ); + std::ofstream fout( path ); =20 if ( fout.fail() ) { @@ -210,11 +210,11 @@ */ if ((result =3D strstr (path,".amdba")) !=3D NULL) /* amdba format */ { - fout << t->getNumberOfPoints() << " " << t->getNumberOfCells() << endl; + fout << t->getNumberOfPoints() << " " << t->getNumberOfCells() << std::en= dl; =20 for (i =3D 0; i < t->getNumberOfPoints(); i++) { - fout << i+1 << " " << t->rp[i][0] << " " << t->rp[i][1] << " " << t->= ng[i] << endl; + fout << i+1 << " " << t->rp[i][0] << " " << t->rp[i][1] << " " << t->= ng[i] << std::endl; } =20 =20 @@ -224,13 +224,13 @@ << " " << t->tr[i][0]+1 << " " << t->tr[i][1]+1 << " " << t->tr[i][2]+1 - << " " << t->ngt[i] << endl; + << " " << t->ngt[i] << std::endl; } } else if ((result =3D strstr (path,".am_fmt")) !=3D NULL)/* am_fmt form= at */ { #if 0 - fout << t->getNumberOfPoints() << " " << t->getNumberOfCells() < endl; + fout << t->getNumberOfPoints() << " " << t->getNumberOfCells() < std::end= l; =20 dummy =3D 0; for (i =3D 0; i < t->getNumberOfCells(); i++) @@ -238,39 +238,39 @@ fout << t->tr[i][0]+1 << " " << t->tr[i][1]+1 << " " << t->tr[i][2]+1 - << endl; + << std::endl; END_OF_LINE(data, dummy, 1); } if (dummy) fprintf(data,"\n"); dummy =3D 0; for (i =3D 0; i < t->getNumberOfPoints(); i++) { - fout << t->rp[i][0] << " " << t->rp[i][1] << endl; + fout << t->rp[i][0] << " " << t->rp[i][1] << std::endl; END_OF_LINE (data, dummy, 1); } if (dummy) fprintf(data,"\n"); dummy =3D 0; for (i =3D 0; i < t->getNumberOfCells(); i++) { - fout << t->ngt[i] << endl; + fout << t->ngt[i] << std::endl; END_OF_LINE (data, dummy, 9); } if (dummy) fprintf(data,"\n"); dummy =3D 0; for (i =3D 0; i < t->getNumberOfPoints(); i++) { - fout << t->ng[i] << endl; + fout << t->ng[i] << std::endl; END_OF_LINE (data, dummy, 9); } #endif } else { - fout << t->getNumberOfPoints() << " " << t->getNumberOfCells() << endl; + fout << t->getNumberOfPoints() << " " << t->getNumberOfCells() << std::en= dl; =20 for (i =3D 0; i < t->getNumberOfPoints(); i++) { - fout << t->rp[i][0] << " " << t->rp[i][1] << " " << t->ng[i] << endl; + fout << t->rp[i][0] << " " << t->rp[i][1] << " " << t->ng[i] << std::= endl; } =20 =20 @@ -279,7 +279,7 @@ fout << t->tr[i][0]+1 << " " << t->tr[i][1]+1 << " " << t->tr[i][2]+1 - << " " << t->ngt[i] << endl; + << " " << t->ngt[i] << std::endl; } } return 0; @@ -317,9 +317,9 @@ saveparam (fcts * param, femMesh * t, char *path, int N) { int k, ns =3D t->getNumberOfPoints(); - ofstream file (path); + std::ofstream file (path); file.precision (8); - file << ns << " " << N << endl; + file << ns << " " << N << std::endl; for (k =3D 0; k < ns; k++) { if (N =3D=3D 1) @@ -373,7 +373,7 @@ file << (param)->nuyy2[k] << " "; file << " "; } - file << endl; + file << std::endl; } file.close (); return 0; @@ -383,9 +383,9 @@ int=20 saveconst (creal f, char *path) { - ofstream file (path, ios::out | ios::app); - // file.seekoff(0,ios::end,0); - file << f << endl; + std::ofstream file (path, std::ios::out | std::ios::app); + // file.seekoff(0,std::ios::end,0); + file << f << std::endl; file.close (); return 0; } --6Vw0j8UKbyX0bfpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-freefem::fem::femGibbs.cpp" Content-Transfer-Encoding: quoted-printable --- freefem/fem/femGibbs.cpp.orig Sat Jul 19 04:10:36 2003 +++ freefem/fem/femGibbs.cpp Sat Jul 19 04:19:02 2003 @@ -38,6 +38,7 @@ #include <math.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> =20 // // Freefem includes @@ -1173,9 +1174,9 @@ { f =3D new femPoint[ns]; for (i =3D 0; i < ns; ++i) - f[i] =3D rp[i]; + memcpy (f[i], rp[i], sizeof (femPoint)); for (i =3D 0; i < ns; ++i) - rp[r[i] - 1] =3D f[i]; + memcpy (rp[r[i] - 1], f[i], sizeof (femPoint)); =20 for (j =3D 0; j < nt; ++j) for (i =3D 0; i < 3; i++) --6Vw0j8UKbyX0bfpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-freefem::fem::femGraphicX11.cpp" Content-Transfer-Encoding: quoted-printable --- freefem/fem/femGraphicX11.cpp.orig Sat Jul 19 04:10:02 2003 +++ freefem/fem/femGraphicX11.cpp Sat Jul 19 04:12:31 2003 @@ -118,7 +118,7 @@ void out_of_memory () { - cerr << "FreeFEM error: operator new failed; not enough memory" << endl; + std::cerr << "FreeFEM error: operator new failed; not enough memory" << = std::endl; exit (-1); } =20 --6Vw0j8UKbyX0bfpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-freefem::fem::femMisc.cpp" Content-Transfer-Encoding: quoted-printable --- freefem/fem/femMisc.cpp.orig Sat Jul 19 04:09:41 2003 +++ freefem/fem/femMisc.cpp Sat Jul 19 04:12:31 2003 @@ -70,24 +70,24 @@ return a; } =20 -ostream & operator << (ostream & os, const Complex & a) +std::ostream & operator << (std::ostream & os, const Complex & a) { os << a.re << " " << a.im << " "; return os; } -istream & operator >> (istream & os, Complex & a) +std::istream & operator >> (std::istream & os, Complex & a) { os >> a.re >> a.im; return os; } =20 -ostream & operator << (ostream & os, cvect & a) +std::ostream & operator << (std::ostream & os, cvect & a) { for (int i =3D 0; i < N; i++) os << a[i] << " "; return os; } -ostream & operator << (ostream & os, cmat & a) +std::ostream & operator << (std::ostream & os, cmat & a) { for (int i =3D 0; i < N; i++) for (int j =3D 0; j < N; j++) --6Vw0j8UKbyX0bfpA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-freefem::fem::femParser.cpp" Content-Transfer-Encoding: quoted-printable --- freefem/fem/femParser.cpp.orig Sat Jul 19 04:09:53 2003 +++ freefem/fem/femParser.cpp Sat Jul 19 04:35:15 2003 @@ -1168,9 +1168,9 @@ if (cursym =3D=3D oldvar) { thecst =3D 1.F; - ofstream file (thechaine); + std::ofstream file (thechaine); =20 - file << ' ' << endl; + file << ' ' << std::endl; file.close (); } // clean the file else @@ -2539,7 +2539,7 @@ =20 =20 #if defined(DEBUG) - cerr << "adaptation process called" << endl; + std::cerr << "adaptation process called" << std::endl; #endif =20 nsol =3D 4; @@ -2553,7 +2553,7 @@ nsol =3D 3; =20 #if defined(DEBUG) - cerr << " nsol =3D " << nsol << endl; + std::cerr << " nsol =3D " << nsol << std::endl; #endif /* DEBUG */ =20 /* @@ -2614,10 +2614,10 @@ #endif /* not NOXGFEM */ =20 #ifdef DEBUG - cout<<adapt_param<<endl; + std::cout<<adapt_param<<std::endl; #endif /* DEBUG */ #if defined(DEBUG) - cerr << "creating the solution" << endl; + std::cerr << "creating the solution" << std::endl; #endif /* DEBUG */ solution =3D new Scalar[nsol*__mesh.getNumberOfPoints()]; for (s =3D 1;s <=3D nsol;s++) @@ -2646,12 +2646,12 @@ solution[nsol*iglob+3] =3D realpart (eval(l4)); } #if defined(DEBUG) - cerr << "Done" << endl; + std::cerr << "Done" << std::endl; #endif /* DEBUG */ =20 #if defined(DEBUG) - ofstream fsol("sol.bb"); - fsol << 3 << " " << nsol << " " << __mesh.getNumberOfPoints() << " " << = 2 << endl; + std::ofstream fsol("sol.bb"); + fsol << 3 << " " << nsol << " " << __mesh.getNumberOfPoints() << " " << = 2 << std::endl; for (i =3D 0;i < __mesh.getNumberOfPoints();i++) { fsol << solution[nsol*i] << " "; @@ -2661,7 +2661,7 @@ fsol << solution[nsol*i+2] << " "; if (nsol =3D=3D 4) fsol << solution[nsol*i+3]; - fsol << endl; + fsol << std::endl; } fsol.close (); #endif /* DEBUG */ @@ -2681,9 +2681,9 @@ * ATTENTION, IMPOSING NGT[I]=3D0 */ #if defined(DEBUG) - cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D"<<endl; - cout<<" IMPOSING NGT[I]=3D0"<<endl; - cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D"<<endl; + std::cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D"<<std::endl; + std::cout<<" IMPOSING NGT[I]=3D0"<<std::endl; + std::cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D"<<std::endl; #endif /* DEBUG */ for (i=3D0;i<__mesh.getNumberOfCells(); i++) {__mesh.ngt[i]=3D0;}; =20 @@ -2708,9 +2708,9 @@ if (tiempo=3D=3DNIL) ERROR(); the_clock(tiempo); #ifdef DEBUG - cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D"<<endl; - cout<<" METRIC COMPUTATION"<<endl; - cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D"<<endl; + std::cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D"<<std::endl; + std::cout<<" METRIC COMPUTATION"<<std::endl; + std::cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D"<<std::endl; #endif=20 if (adapt_param.sol=3D=3D1) { cal_metrica(malla,solution,malla->m,adapt_param.aniso,adapt_param.err0= ,adapt_param.lmax,adapt_param.lmin,adapt_param.nsol,adapt_param.refwall,ada= pt_param.hwall,malla->factr(),adapt_param.nbt_max); @@ -2723,15 +2723,15 @@ } #ifdef DEBUG the_clock(tiempo); - cout<<"--------------------------------------------------------"<<endl; - cout<<"Metric computation time :"<<*tiempo<<endl; - cout<<"--------------------------------------------------------"<<endl; + std::cout<<"--------------------------------------------------------"<<s= td::endl; + std::cout<<"Metric computation time :"<<*tiempo<<std::endl; + std::cout<<"--------------------------------------------------------"<<s= td::endl; #endif /* DEBUG */ =20 // CAD definition from __mesh. #if defined(DEBUG) - cerr << "adapt angulo:" << adapt_param.angulo << endl - << "factor: " << malla->factr() << endl; + std::cerr << "adapt angulo:" << adapt_param.angulo << std::endl + << "factor: " << malla->factr() << std::endl; #endif /* DEBUG */ =20 //cad=3Dbuild(t_cad,adapt_param.angulo,malla->factr()); delete t_cad; @@ -2759,24 +2759,24 @@ } =20 #ifdef DEBUG - cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D"<<endl; - cout<<" MESH ADAPTATION"<<endl; - cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D"<<endl; + std::cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D"<<std::endl; + std::cout<<" MESH ADAPTATION"<<std::endl; + std::cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D"<<std::endl; #endif /* DEBUG */ t_fin=3Dregenera_malla(malla,solution,adapt_param.timesh,adapt_param.sol= ,adapt_param.nsol,adapt_param.sol_interp,adapt_param.angulo,adapt_param.nit= ,adapt_param.segur,tiempo,adapt_param.reg_ini,adapt_param.reg_fin,adapt_par= am.rel_mtr,adapt_param.fluid_NS,adapt_param.hwall,adapt_param.refwall,cad,a= dapt_param.tinterp,sol_interp, func, nfunc, &interp_func); =20 the_clock(tiempo); #ifdef DEBUG - cout<<"------------------------------------------------------------"<<en= dl; - cout<<"Global time: Metric computation+mesh adaptation:"<<*tiempo<<endl; - cout<<"------------------------------------------------------------"<<en= dl; + std::cout<<"------------------------------------------------------------= "<<std::endl; + std::cout<<"Global time: Metric computation+mesh adaptation:"<<*tiempo<<= std::endl; + std::cout<<"------------------------------------------------------------= "<<std::endl; #endif /* DEBUG */ delete tiempo; =20 #ifdef DEBUG - cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"<<endl; - cout<<" FEMMESH ACTUALIZATION"<<endl; - cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"<<endl; + std::cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"<<std::endl; + std::cout<<" FEMMESH ACTUALIZATION"<<std::endl; + std::cout<<"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"<<std::endl; #endif /* DEBUG */ =20 __mesh.set( t_fin->np, t_fin->nt ); @@ -2796,7 +2796,7 @@ __mesh.removeBdyT(); =20 #if defined(DEBUG) - cerr << "Done" << endl; + std::cerr << "Done" << std::endl; #endif /* DEBUG */ =20 /* @@ -2808,7 +2808,7 @@ * Update the table of functions */ #if defined(DEBUG) - cerr << "Updating the table of functions:" << __mesh.getNumberOfPoints()= << endl; + std::cerr << "Updating the table of functions:" << __mesh.getNumberOfPoi= nts() << std::endl; #endif /* DEBUG */ if (nfunc > 0) { @@ -2828,7 +2828,7 @@ delete [] interp_func; } #if defined(DEBUG) - cerr << "Done update function table" << endl; + std::cerr << "Done update function table" << std::endl; #endif /* DEBUG */ =20 delete t_fin; @@ -2838,7 +2838,7 @@ delete cad; =20 #if defined(DEBUG) - cerr << "Done adaptation" << endl; + std::cerr << "Done adaptation" << std::endl; #endif /* DEBUG */ =20 #endif /* ADAPT */ @@ -3412,18 +3412,18 @@ void=20 femParser::showident (ident * i) { - cerr << i->name << "\n"; + std::cerr << i->name << "\n"; } =20 void=20 femParser::showtreeaux (int level, noeudPtr t) { // blanks (level); - cerr << mesg[t->symb] << " " << (int)t->symb << "\n"; + std::cerr << mesg[t->symb] << " " << (int)t->symb << "\n"; if (realpart (t->value)) { // blanks (level + 1); - cerr << realpart (t->value) << "\n"; + std::cerr << realpart (t->value) << "\n"; } if (t->name) { --6Vw0j8UKbyX0bfpA-- --eNMatiwYGLtwo1cJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE/GLWDCkn+/eutqCoRAgptAJ99PVZW0aUnekkQOMBuADlPgzP04wCg+23F XNEtemse2HHuBKtrEJL327w= =q3Pn -----END PGP SIGNATURE----- --eNMatiwYGLtwo1cJ--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030719030539.GB467>