mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 05:47:42 +02:00
remove some unused functions from the numparam world
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2010-11-06 Robert Larice
|
||||||
|
* src/frontend/numparam/general.h ,
|
||||||
|
* src/frontend/numparam/mystring.c :
|
||||||
|
remove some unused functions from the numparam world
|
||||||
|
|
||||||
2010-11-06 Robert Larice
|
2010-11-06 Robert Larice
|
||||||
* src/frontend/postcoms.c ,
|
* src/frontend/postcoms.c ,
|
||||||
* src/frontend/plotting/agraf.c ,
|
* src/frontend/plotting/agraf.c ,
|
||||||
|
|||||||
@@ -80,8 +80,6 @@ double absf(double x); /* abs */
|
|||||||
long absi( long i);
|
long absi( long i);
|
||||||
double frac(double x);
|
double frac(double x);
|
||||||
|
|
||||||
unsigned char reset(FILE * f);
|
|
||||||
unsigned char rewrite(FILE * f);
|
|
||||||
void rawcopy(void * a, void * b, int la, int lb);
|
void rawcopy(void * a, void * b, int la, int lb);
|
||||||
void * new(long sz);
|
void * new(long sz);
|
||||||
void dispose(void * p);
|
void dispose(void * p);
|
||||||
|
|||||||
@@ -780,51 +780,6 @@ odd (long x)
|
|||||||
return (x & 1);
|
return (x & 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
vali (char *s, long *i)
|
|
||||||
/* convert s to integer i. returns error code 0 if Ok */
|
|
||||||
/* BUG: almost identical to ival() with arg/return value swapped ... */
|
|
||||||
{
|
|
||||||
int k = 0, digit = 0, ls;
|
|
||||||
long z = 0;
|
|
||||||
bool minus = 0, ok = 1;
|
|
||||||
char c;
|
|
||||||
ls = length (s);
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
c = s[k];
|
|
||||||
k++;
|
|
||||||
}
|
|
||||||
while (!((k >= ls) || !((c > 0) && (c <= ' ')))); /* skip space */
|
|
||||||
|
|
||||||
if (c == '-')
|
|
||||||
{
|
|
||||||
minus = 1;
|
|
||||||
c = s[k];
|
|
||||||
k++;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (num (c))
|
|
||||||
{
|
|
||||||
z = 10 * z + c - '0';
|
|
||||||
c = s[k];
|
|
||||||
k++;
|
|
||||||
digit++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (minus)
|
|
||||||
z = -z;
|
|
||||||
|
|
||||||
*i = z;
|
|
||||||
ok = (digit > 0) && (c == 0); /* successful end of string */
|
|
||||||
|
|
||||||
if (ok)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return k; /* one beyond error position */
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
match (char *s, char *t, int n, int tstart, bool testcase)
|
match (char *s, char *t, int n, int tstart, bool testcase)
|
||||||
{
|
{
|
||||||
@@ -917,19 +872,6 @@ spos_(char *sub, char *s)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**** float formatting with printf/scanf ******/
|
|
||||||
|
|
||||||
int
|
|
||||||
valr (char *s, double *r)
|
|
||||||
/* returns 0 if ok, else length of partial string ? */
|
|
||||||
{
|
|
||||||
int n = sscanf (s, "%lG", r);
|
|
||||||
if (n == 1)
|
|
||||||
return (0);
|
|
||||||
else
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
strf (double x, int f1, int f2, SPICE_DSTRINGPTR dstr_p)
|
strf (double x, int f1, int f2, SPICE_DSTRINGPTR dstr_p)
|
||||||
/* e-format if f2<0, else f2 digits after the point, total width=f1 */
|
/* e-format if f2<0, else f2 digits after the point, total width=f1 */
|
||||||
@@ -1073,16 +1015,6 @@ frac (double x)
|
|||||||
return x - np_trunc (x);
|
return x - np_trunc (x);
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
|
||||||
intp (double x)
|
|
||||||
{
|
|
||||||
double u = 2e9;
|
|
||||||
if ((x > u) || (x < -u))
|
|
||||||
return x;
|
|
||||||
else
|
|
||||||
return np_trunc (x);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* use floor() and ceil() */
|
#else /* use floor() and ceil() */
|
||||||
|
|
||||||
long
|
long
|
||||||
@@ -1109,13 +1041,4 @@ frac (double x)
|
|||||||
return (x - ceil (x));
|
return (x - ceil (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
|
||||||
intp (double x) /* integral part */
|
|
||||||
{
|
|
||||||
if (x >= 0.0)
|
|
||||||
return floor (x);
|
|
||||||
else
|
|
||||||
return ceil (x);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user