simian, meet gcc3 (fix c++ code to work with gcc3)

This commit is contained in:
dmcmahill 2005-03-21 17:35:53 +00:00
parent ea7f53815e
commit 61508b0d4b
9 changed files with 197 additions and 26 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.9 2004/12/03 15:14:52 wiz Exp $
# $NetBSD: Makefile,v 1.10 2005/03/21 17:35:53 dmcmahill Exp $
#
DISTNAME= simian_12_98
@ -16,6 +16,9 @@ NO_SRC_ON_CDROM= ${RESTRICTED}
NO_BIN_ON_CDROM= ${RESTRICTED}
NO_SRC_ON_FTP= ${RESTRICTED}
NO_BIN_ON_FTP= ${RESTRICTED}
USE_LANGUAGES= c++
USE_BUILDLINK3= yes
GCC_REQD= 3.0
WRKSRC= ${WRKDIR}/Simian/src

View file

@ -1,9 +1,13 @@
$NetBSD: distinfo,v 1.2 2005/03/21 10:32:06 dmcmahill Exp $
$NetBSD: distinfo,v 1.3 2005/03/21 17:35:53 dmcmahill Exp $
SHA1 (simian_12_98.tar.gz) = c7d57087a397970b05195f497c98a058cea1a93a
RMD160 (simian_12_98.tar.gz) = 3eecb229dd1fb3c761ee30c9d053673a45782170
Size (simian_12_98.tar.gz) = 18474 bytes
SHA1 (patch-aa) = fa43e88db6902537114d49ff0f14d420927c50e1
SHA1 (patch-ab) = e31c96d7fa79833dbd9dc7d22ea1f0a95b327d4a
SHA1 (patch-ac) = 64b974adb3111e21bd6f14838371eb5db5cbd050
SHA1 (patch-ad) = d3f6b068fe0d16a8c097b7e5a77d7f89d010e8b8
SHA1 (patch-ab) = 7efafa8a96615697361b23a449112b15bcf6a178
SHA1 (patch-ac) = bc391a8264946bb66a86801f99db597b89f07800
SHA1 (patch-ad) = cfecf1e29df43a5034e7ec8f5f6f260396327b3f
SHA1 (patch-ae) = 701700e5b254504d83989479a7948ba49b71a6c4
SHA1 (patch-af) = 69489c7a8f78f8f9649ae681dea6fd8d7722cbb1
SHA1 (patch-ag) = 6d7560439e13613f54e3a04ef7c6bd6813d5e890
SHA1 (patch-ah) = 57cd20aa8da97f305f12d717394f1cdbaccf95c0

View file

@ -1,36 +1,63 @@
$NetBSD: patch-ab,v 1.1.1.1 2001/04/28 02:36:35 dmcmahill Exp $
$NetBSD: patch-ab,v 1.2 2005/03/21 17:35:53 dmcmahill Exp $
--- main.cc.orig Thu Dec 10 05:56:19 1998
+++ main.cc Fri Apr 27 16:47:38 2001
@@ -74,5 +74,5 @@
--- main.cc.orig 1998-12-10 10:56:19.000000000 +0000
+++ main.cc
@@ -1,6 +1,7 @@
/* Main program, prints out all the results */
/* written and modified by Emre Tuncer and Sangwoo Kim */
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
@@ -42,7 +43,7 @@ main(int argc,char** argv)
printf("\n");
start=time(NULL);
if (argc!=3) {
- cerr << "Usage: " << argv[0] <<
+ std::cerr << "Usage: " << argv[0] <<
" <input file> <w/r>\n";
exit(1);
}
@@ -73,7 +74,7 @@ main(int argc,char** argv)
Nf=nf[Nc+1];
LastFil(fils); //remove last empty entry.
// Corr(fils); /* x1 < x2 */
- printf("Total %ld ribbons, %ld conductor\n",Nf,Nc);
+ printf("Total %d ribbons, %d conductor\n",Nf,Nc);
L=allocator(Nf);
@@ -85,5 +85,5 @@
if (argv[2][0]=='w') {
@@ -84,7 +85,7 @@ main(int argc,char** argv)
for (j=i;j<Nf;j++) {
L[j][i]=L[i][j]=Lp(iF,jF);
jF=jF->next;
- fprintf(fo,"%ld %ld %le\n",i,j,L[i][j]*sis->unit);
+ fprintf(fo,"%d %d %e\n",i,j,L[i][j]*sis->unit);
}
iF=iF->next;
@@ -97,5 +97,5 @@
}
@@ -96,7 +97,7 @@ main(int argc,char** argv)
fi=fopen("induc","r");
for (i=0;i<Nf;i++) {
for (j=i;j<Nf;j++) {
- fscanf(fi,"%ld %ld %le\n",&k,&k,&L[i][j]);
+ fscanf(fi,"%d %d %le\n",&k,&k,&L[i][j]);
L[i][j]/=sis->unit;
L[j][i]=L[i][j];
@@ -115,5 +115,5 @@
}
@@ -114,7 +115,7 @@ main(int argc,char** argv)
stop= time(NULL);
printf("\n");
printf("*********** \n");
- printf("Total Elapsed time=%ld Seconds\n",(stop-start));
+ printf("Total Elapsed time=%ld Seconds\n",(long int) (stop-start));
exit(1);
}
@@ -144,9 +144,9 @@
Z=matrix(Nf,Nf);
@@ -143,11 +144,11 @@ main(int argc,char** argv)
if ((sis->loop != 0) || (Nc==1)){
z=matrix(Nc,Nc);
z=inverse(ymtrx,Nc);
- fprintf(fzs,"\nImpedance %ld x %ld matrix (R,L) at f=%10.4le Hz\n",
@ -42,7 +69,9 @@ $NetBSD: patch-ab,v 1.1.1.1 2001/04/28 02:36:35 dmcmahill Exp $
+ fprintf(fzs,"(%11.4e,%11.4e) ",RE(z[i][j])*sis->unit,IM(z[i][j])
/w*sis->unit);
}
@@ -182,10 +182,10 @@
fprintf(fzs,"\n");
@@ -181,12 +182,12 @@ main(int argc,char** argv)
Din=matrix(numsgn+1,numsgn+1);
Din=Zequ(cons,numsgn,Nc);
- fprintf(fzs,"\nImpedance %ld x %ld matrix (R,L) at f=%10.4le Hz\n",
@ -55,10 +84,13 @@ $NetBSD: patch-ab,v 1.1.1.1 2001/04/28 02:36:35 dmcmahill Exp $
+ fprintf(fzs,"(%11.4e,%11.4e) ",RE(Din[i][j])*sis->unit,IM(Din[i][j])
/w*sis->unit);
}
@@ -200,5 +200,5 @@
fprintf(fzs,"\n");
@@ -199,7 +200,7 @@ main(int argc,char** argv)
stop= time(NULL);
printf("\n");
printf("*********** \n");
- printf("Total Elapsed time=%ld Seconds\n",(stop-start));
+ printf("Total Elapsed time=%ld Seconds\n",(long int) (stop-start));
exit(0);
}

View file

@ -1,8 +1,17 @@
$NetBSD: patch-ac,v 1.1.1.1 2001/04/28 02:36:35 dmcmahill Exp $
$NetBSD: patch-ac,v 1.2 2005/03/21 17:35:53 dmcmahill Exp $
--- plane.cc.orig Mon Dec 7 03:28:51 1998
+++ plane.cc Fri Apr 27 16:48:43 2001
@@ -335,9 +335,9 @@
--- plane.cc.orig 1998-12-07 08:28:51.000000000 +0000
+++ plane.cc
@@ -1,6 +1,7 @@
/* Ribbon segmentation on ground plane */
#include <math.h>
#include <stdio.h>
+#include <stdlib.h>
#include "weeks.h"
#include "plane.h"
#include "../include/linear.h"
@@ -334,11 +335,11 @@ void filplane(Conductor *c)
for (i=1;i<=sis->pc;i++) {
for (j=1;j<=l[i];j++) {
if (l[i]!=2)
- if (LX[i][j]!=LX[i][j+1]) fprintf(fo,"below %ld %le\n",i,LX[i][j]);
@ -14,3 +23,4 @@ $NetBSD: patch-ac,v 1.1.1.1 2001/04/28 02:36:35 dmcmahill Exp $
+ if (UX[i][j]!=UX[i][j+1]) fprintf(fo,"above %d %e\n",i,UX[i][j]);
}
}

View file

@ -1,29 +1,53 @@
$NetBSD: patch-ad,v 1.1.1.1 2001/04/28 02:36:35 dmcmahill Exp $
$NetBSD: patch-ad,v 1.2 2005/03/21 17:35:53 dmcmahill Exp $
--- reader.cc.orig Thu Dec 10 04:02:44 1998
+++ reader.cc Fri Apr 27 17:00:23 2001
@@ -213,5 +213,5 @@
--- reader.cc.orig 1998-12-10 09:02:44.000000000 +0000
+++ reader.cc
@@ -1,6 +1,9 @@
/* Reading Input Geometry */
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <ios>
+#include <streambuf>
+#include <sstream>
+#include <fstream>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -29,7 +32,7 @@ void Default(Conductor* c)
c->xc=0; c->yc=0;
}
-void ReadRest(Sys *sis,Conductor* conduc,fstream& fl,int& line)
+void ReadRest(Sys *sis,Conductor* conduc,std::fstream& fl,int& line)
{
char* s1;
char *proj;
@@ -212,19 +215,19 @@ void ReadRest(Sys *sis,Conductor* conduc
else if (strcmp(s1,"nx")==0) {
fl >> s1;
if (strcmp(s1,"=")==0) fl >> conduc->dx;
- else sscanf(s1,"%c%ld",&dum,&conduc->dx);
+ else sscanf(s1,"%c%d",&dum,&conduc->dx);
}
else if (strcmp(s1,"ny=")==0) fl >> conduc->dy;
@@ -219,5 +219,5 @@
else if (strcmp(s1,"ny")==0) {
fl >> s1;
if (strcmp(s1,"=")==0) fl >> conduc->dy;
- else sscanf(s1,"%c%ld",&dum,&conduc->dy);
+ else sscanf(s1,"%c%d",&dum,&conduc->dy);
}
else if (strcmp(s1,"nr=")==0) fl >> conduc->nr;
@@ -225,5 +225,5 @@
else if (strcmp(s1,"nr")==0) {
fl >> s1;
if (strcmp(s1,"=")==0) fl >> conduc->nr;
- else sscanf(s1,"%c%ld",&dum,&conduc->nr);
+ else sscanf(s1,"%c%d",&dum,&conduc->nr);
}
else if ((strncmp(s1,"*",1)==0)||(strncmp(s1,".",1)==0)) {
@@ -266,9 +266,9 @@
fl.getline(proj,80,'\n');
@@ -265,11 +268,11 @@ void ReadRest(Sys *sis,Conductor* conduc
else if (strncmp(s1,"v=",2)==0)
sscanf(s1,"%c%c%le",&dum,&dum,&conduc->v);
else if (strncmp(s1,"nx=",3)==0)
- sscanf(s1,"%c%c%c%ld",&dum,&dum,&dum,&conduc->dx);
@ -36,3 +60,22 @@ $NetBSD: patch-ad,v 1.1.1.1 2001/04/28 02:36:35 dmcmahill Exp $
+ sscanf(s1,"%c%c%c%d",&dum,&dum,&dum,&conduc->nr);
else if (strncmp(s1,"rx=",3)==0)
sscanf(s1,"%c%c%c%le",&dum,&dum,&dum,&conduc->rx);
else if (strncmp(s1,"ry=",3)==0)
@@ -297,7 +300,7 @@ void reader(Conductor* conduc,Sys* sis,c
ss=new char[80];
s1=new char[80];
- fstream fll(fn,ios::in);
+ std::fstream fll(fn,std::ios::in);
if (!fll) {
exit(1);
}
@@ -337,7 +340,7 @@ void reader(Conductor* conduc,Sys* sis,c
ss=new char[100];
int p_c,l_c;
p_c=0; l_c=0;
- fstream fl(fn,ios::in);
+ std::fstream fl(fn,std::ios::in);
line=0;
do {
fl >> ss;

View file

@ -0,0 +1,12 @@
$NetBSD: patch-ae,v 1.1 2005/03/21 17:35:53 dmcmahill Exp $
--- Zs.cc.orig 1998-12-07 08:28:51.000000000 +0000
+++ Zs.cc
@@ -1,6 +1,6 @@
/* EII for Plane wave model */
-#include <stream.h>
+#include <sstream>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

View file

@ -0,0 +1,24 @@
$NetBSD: patch-af,v 1.1 2005/03/21 17:35:53 dmcmahill Exp $
--- surfer1.cc.orig 1998-12-10 10:10:46.000000000 +0000
+++ surfer1.cc
@@ -2,8 +2,8 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
#include "weeks.h"
#include "linklist.h"
#include "nonuni.h"
@@ -19,7 +19,7 @@ Filament* surfer(Conductor* cc,Filament*
double dum;
l=0; u=0;
if ((cc->lp==0)&&(sis->pc!=0)) {
- fstream plate("plate",ios::in);
+ std::fstream plate("plate",std::ios::in);
char *ss;
ss=new char[100];
do {

View file

@ -0,0 +1,29 @@
$NetBSD: patch-ag,v 1.1 2005/03/21 17:35:53 dmcmahill Exp $
--- linklist.cc.orig 1998-12-07 08:28:51.000000000 +0000
+++ linklist.cc
@@ -1,12 +1,13 @@
+#include <iostream>
+#include <sstream>
#include <stdlib.h>
#include <stdio.h>
-#include <stream.h>
#include "weeks.h"
void newCon(Conductor* conduc)
{
if ((conduc->next=new Conductor)==NULL) {
- cerr << "Can't allocate!\n";
+ std::cerr << "Can't allocate!\n";
exit(1);
}
}
@@ -15,7 +16,7 @@ void newCon(Conductor* conduc)
void newFil(Filament* filam)
{
if ((filam->next=new Filament)==(Filament*)NULL) {
- cerr << "Can't allocate!\n";
+ std::cerr << "Can't allocate!\n";
exit(1);
}
filam->next->next = (Filament*) NULL;

View file

@ -0,0 +1,14 @@
$NetBSD: patch-ah,v 1.1 2005/03/21 17:35:53 dmcmahill Exp $
--- ../include/linear.cc.orig 1998-12-07 08:28:52.000000000 +0000
+++ ../include/linear.cc
@@ -10,7 +10,8 @@
** Modification includes new memory allocation scheme and **
** LU decomposition **
***************************************************************/
-#include <stream.h>
+#include <iostream>
+#include <sstream>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>