81 lines
2.6 KiB
Text
81 lines
2.6 KiB
Text
$NetBSD: patch-ad,v 1.3 2005/11/03 19:56:36 rillig Exp $
|
|
|
|
--- src/reader.cc.orig 1998-12-10 09:02:44.000000000 +0000
|
|
+++ src/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;
|
|
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;
|
|
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)) {
|
|
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);
|
|
+ sscanf(s1,"%c%c%c%d",&dum,&dum,&dum,&conduc->dx);
|
|
else if (strncmp(s1,"ny=",3)==0)
|
|
- sscanf(s1,"%c%c%c%ld",&dum,&dum,&dum,&conduc->dy);
|
|
+ sscanf(s1,"%c%c%c%d",&dum,&dum,&dum,&conduc->dy);
|
|
else if (strncmp(s1,"nr=",3)==0)
|
|
- sscanf(s1,"%c%c%c%ld",&dum,&dum,&dum,&conduc->nr);
|
|
+ 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;
|