|
From: <ho...@us...> - 2003-12-14 08:44:54
|
Update of /cvsroot/ganc/ganc/src
In directory sc8-pr-cvs1:/tmp/cvs-serv14428/src
Modified Files:
evaluate.c parser_stuff.c reader_stuff.c
Log Message:
Fixed some obsolete parse error names
Index: evaluate.c
===================================================================
RCS file: /cvsroot/ganc/ganc/src/evaluate.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** evaluate.c 12 Dec 2003 05:46:59 -0000 1.7
--- evaluate.c 13 Dec 2003 23:55:56 -0000 1.8
***************
*** 93,102 ****
if (id==FUN_ASIN) {
if (arg<(VALUE_TYPE) -1. || arg>(VALUE_TYPE) 1.)
! NotifyError (PERROR_MATH_INVALID_ARG_ASIN, NULL);
else result= rad_to_any*asinl (arg);
}
if (id==FUN_ACOS) {
if (arg<(VALUE_TYPE) -1. || arg>(VALUE_TYPE) 1.)
! NotifyError (PERROR_MATH_INVALID_ARG_ACOS, NULL);
result= rad_to_any*acosl (arg);
}
--- 93,102 ----
if (id==FUN_ASIN) {
if (arg<(VALUE_TYPE) -1. || arg>(VALUE_TYPE) 1.)
! NotifyError (PERROR_INVALID_ARG_ASIN, NULL);
else result= rad_to_any*asinl (arg);
}
if (id==FUN_ACOS) {
if (arg<(VALUE_TYPE) -1. || arg>(VALUE_TYPE) 1.)
! NotifyError (PERROR_INVALID_ARG_ACOS, NULL);
result= rad_to_any*acosl (arg);
}
***************
*** 110,123 ****
if (id==FUN_EXP) result= expl (arg);
if (id==FUN_LN) {
! if (arg<=0.0) NotifyError (PERROR_MATH_INVALID_ARG_LN, NULL);
else result= logl (arg);
}
if (id==FUN_EXP10) result= powl (10, arg);
if (id==FUN_LOG) {
! if (arg<=0.0) NotifyError (PERROR_MATH_INVALID_ARG_LOG, NULL);
else result= log10l (arg);
}
if (id==FUN_SQRT) {
! if (arg<=0.) NotifyError (PERROR_MATH_INVALID_ARG_SQRT, NULL);
else result= sqrtl (arg);
}
--- 110,123 ----
if (id==FUN_EXP) result= expl (arg);
if (id==FUN_LN) {
! if (arg<=0.0) NotifyError (PERROR_INVALID_ARG_LN, NULL);
else result= logl (arg);
}
if (id==FUN_EXP10) result= powl (10, arg);
if (id==FUN_LOG) {
! if (arg<=0.0) NotifyError (PERROR_INVALID_ARG_LOG, NULL);
else result= log10l (arg);
}
if (id==FUN_SQRT) {
! if (arg<=0.) NotifyError (PERROR_INVALID_ARG_SQRT, NULL);
else result= sqrtl (arg);
}
***************
*** 141,145 ****
if (i<=99) { // otherwise is too big
while (i>1) v= v*i--;
! } else NotifyError (PERROR_MATH_INVALID_ARG_FACT, NULL);
return v;
}
--- 141,145 ----
if (i<=99) { // otherwise is too big
while (i>1) v= v*i--;
! } else NotifyError (PERROR_INVALID_ARG_FACT, NULL);
return v;
}
***************
*** 194,198 ****
value= arg1/arg2;
// check if division by zero occured
! if (isinf (value)) NotifyError (PERROR_MATH_DIVISION_ZERO, NULL);
return value;
}
--- 194,198 ----
value= arg1/arg2;
// check if division by zero occured
! if (isinf (value)) NotifyError (PERROR_DIVISION_ZERO, NULL);
return value;
}
***************
*** 245,254 ****
if (base<2 || base>36) { // base is not within the valid range
! NotifyError (PERROR_MATH_BASE_RANGE, NULL);
return (VALUE_TYPE) 0.;
}
value= (VALUE_TYPE) strtoul (based_number, &tail, base);
if (*tail!='\0') { // there has been an error converting the number
! NotifyError (PERROR_MATH_BASE_ERROR, NULL);
}
--- 245,254 ----
if (base<2 || base>36) { // base is not within the valid range
! NotifyError (PERROR_BASE_RANGE, NULL);
return (VALUE_TYPE) 0.;
}
value= (VALUE_TYPE) strtoul (based_number, &tail, base);
if (*tail!='\0') { // there has been an error converting the number
! NotifyError (PERROR_BASE_ERROR, NULL);
}
***************
*** 262,267 ****
void CheckNumber (VALUE_TYPE value)
{
! if (isinf (value)) NotifyError (PERROR_MATH_OVERFLOW, NULL);
! if (isnan (value)) NotifyError (PERROR_MATH_NAN, NULL);
}
--- 262,267 ----
void CheckNumber (VALUE_TYPE value)
{
! if (isinf (value)) NotifyError (PERROR_OVERFLOW, NULL);
! if (isnan (value)) NotifyError (PERROR_NAN, NULL);
}
***************
*** 308,312 ****
value= (VALUE_TYPE) strtoul (strnumber, &tail, base);
if (*tail!='\0') { // error converting the number
! NotifyError (PERROR_MATH_BASE_ERROR, NULL);
}
}
--- 308,312 ----
value= (VALUE_TYPE) strtoul (strnumber, &tail, base);
if (*tail!='\0') { // error converting the number
! NotifyError (PERROR_BASE_ERROR, NULL);
}
}
Index: parser_stuff.c
===================================================================
RCS file: /cvsroot/ganc/ganc/src/parser_stuff.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** parser_stuff.c 13 Dec 2003 03:08:27 -0000 1.9
--- parser_stuff.c 13 Dec 2003 23:55:56 -0000 1.10
***************
*** 647,651 ****
int SetInputBase (int base)
{
! if (base<2 || base>36) NotifyError (PERROR_MATH_BASE_RANGE, NULL);
ibase= base;
--- 647,651 ----
int SetInputBase (int base)
{
! if (base<2 || base>36) NotifyError (PERROR_BASE_RANGE, NULL);
ibase= base;
***************
*** 660,664 ****
int SetOutputBase (int base)
{
! if (base<2 || base>36) NotifyError (PERROR_MATH_BASE_RANGE, NULL);
obase= base;
--- 660,664 ----
int SetOutputBase (int base)
{
! if (base<2 || base>36) NotifyError (PERROR_BASE_RANGE, NULL);
obase= base;
***************
*** 703,707 ****
output_format.base= (int) value;
if (output_format.base<2 || output_format.base>36)
! NotifyError (PERROR_MATH_BASE_RANGE, NULL);
break;
}
--- 703,707 ----
output_format.base= (int) value;
if (output_format.base<2 || output_format.base>36)
! NotifyError (PERROR_BASE_RANGE, NULL);
break;
}
Index: reader_stuff.c
===================================================================
RCS file: /cvsroot/ganc/ganc/src/reader_stuff.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** reader_stuff.c 13 Dec 2003 02:56:52 -0000 1.13
--- reader_stuff.c 13 Dec 2003 23:55:56 -0000 1.14
***************
*** 38,42 ****
"parse error",
"isolated decimal dot",
! "floating point exception", // 5
"base out of range",
"base conversion error",
--- 38,42 ----
"parse error",
"isolated decimal dot",
! "", // 5
"base out of range",
"base conversion error",
***************
*** 167,171 ****
{
int salir=0;
!
// set local variables to contain pipes
from_main= pipe_from_main;
--- 167,171 ----
{
int salir=0;
!
// set local variables to contain pipes
from_main= pipe_from_main;
***************
*** 181,185 ****
// **FIXME** this may not be very portable
rl_bind_key (DEL_KEY, rl_named_function ("delete-char"));
!
// loop ends when kill_yourself signal comes from pipe
while (!salir) { // loop never ends. It's killed from main process
--- 181,185 ----
// **FIXME** this may not be very portable
rl_bind_key (DEL_KEY, rl_named_function ("delete-char"));
!
// loop ends when kill_yourself signal comes from pipe
while (!salir) { // loop never ends. It's killed from main process
|