mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Revert "dtcalc: Change the prototype of matherr() to reflect actual usage and remove warnings."
This reverts commit a9175c896d
.
This is the wrong fix for matherr() troubles.
This commit is contained in:
parent
65d17786a1
commit
35360f9900
2 changed files with 31 additions and 4 deletions
|
@ -1201,11 +1201,38 @@ make_number(int *MPnumber, BOOLEAN mkFix)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*ARGSUSED*/
|
||||||
/* Default math library exception handling routine. */
|
/* Default math library exception handling routine. */
|
||||||
void
|
int
|
||||||
matherr(void)
|
matherr(struct exception *exc)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
char msg[100];
|
||||||
|
|
||||||
|
if (exc) {
|
||||||
|
strcpy(msg, exc->name);
|
||||||
|
strcat(msg, ": ");
|
||||||
|
if(exc->type == DOMAIN)
|
||||||
|
strcat(msg, "DOMAIN ");
|
||||||
|
else if(exc->type == SING)
|
||||||
|
strcat(msg, "SING ");
|
||||||
|
else if(exc->type == OVERFLOW)
|
||||||
|
strcat(msg, "OVERFLOW ");
|
||||||
|
else if(exc->type == UNDERFLOW)
|
||||||
|
strcat(msg, "UNDERFLOW ");
|
||||||
|
else if(exc->type == TLOSS)
|
||||||
|
strcat(msg, "TLOSS ");
|
||||||
|
else if(exc->type == PLOSS)
|
||||||
|
strcat(msg, "PLOSS ");
|
||||||
|
|
||||||
|
strcat(msg, vstrs[(int) V_ERROR]);
|
||||||
|
|
||||||
|
_DtSimpleError (v->appname, DtWarning, NULL, msg);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
doerr(vstrs[(int) V_ERROR]) ;
|
doerr(vstrs[(int) V_ERROR]) ;
|
||||||
|
return(1) ; /* Value ignored. */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert string into an MP number. */
|
/* Convert string into an MP number. */
|
||||||
|
|
|
@ -677,7 +677,7 @@ do_factorial(int *MPval, int *MPres) /* Calculate the factorial of MPval. */
|
||||||
}
|
}
|
||||||
mpcim(&i, MPa) ;
|
mpcim(&i, MPa) ;
|
||||||
mpcmi(MP1, &i) ;
|
mpcmi(MP1, &i) ;
|
||||||
if (!i) matherr() ;
|
if (!i) matherr((struct exception *) NULL) ;
|
||||||
else
|
else
|
||||||
while (i > 0)
|
while (i > 0)
|
||||||
{
|
{
|
||||||
|
@ -687,7 +687,7 @@ do_factorial(int *MPval, int *MPres) /* Calculate the factorial of MPval. */
|
||||||
i-- ;
|
i-- ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else matherr() ;
|
else matherr((struct exception *) NULL) ;
|
||||||
mpstr(MPa, MPres) ;
|
mpstr(MPa, MPres) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue