aboutsummaryrefslogtreecommitdiffstats
path: root/src/floatfns.c
diff options
context:
space:
mode:
authorKim F. Storm2006-07-18 13:27:54 +0000
committerKim F. Storm2006-07-18 13:27:54 +0000
commitedef16312ebfce4799a96ceece8131d7a41509e9 (patch)
tree65dafa26ba202ed34a547b2c0484c85eafe4d775 /src/floatfns.c
parent24b1ddad0b6c5a33b58057066dff750fe3567b33 (diff)
downloademacs-edef16312ebfce4799a96ceece8131d7a41509e9.tar.gz
emacs-edef16312ebfce4799a96ceece8131d7a41509e9.zip
(arith_error, range_error, domain_error): Use xsignal2.
(range_error2, domain_error2): Use xsignal3. (rounding_driver, fmod_float): Use xsignal0. (float_error): Use xsignal1. (matherr): Use xsignal.
Diffstat (limited to 'src/floatfns.c')
-rw-r--r--src/floatfns.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/floatfns.c b/src/floatfns.c
index d5ca50f9165..dd879de7eb8 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -201,17 +201,15 @@ static char *float_error_fn_name;
201 while (0) 201 while (0)
202 202
203#define arith_error(op,arg) \ 203#define arith_error(op,arg) \
204 Fsignal (Qarith_error, Fcons (build_string ((op)), Fcons ((arg), Qnil))) 204 xsignal2 (Qarith_error, build_string ((op)), (arg))
205#define range_error(op,arg) \ 205#define range_error(op,arg) \
206 Fsignal (Qrange_error, Fcons (build_string ((op)), Fcons ((arg), Qnil))) 206 xsignal2 (Qrange_error, build_string ((op)), (arg))
207#define range_error2(op,a1,a2) \ 207#define range_error2(op,a1,a2) \
208 Fsignal (Qrange_error, Fcons (build_string ((op)), \ 208 xsignal3 (Qrange_error, build_string ((op)), (a1), (a2))
209 Fcons ((a1), Fcons ((a2), Qnil))))
210#define domain_error(op,arg) \ 209#define domain_error(op,arg) \
211 Fsignal (Qdomain_error, Fcons (build_string ((op)), Fcons ((arg), Qnil))) 210 xsignal2 (Qdomain_error, build_string ((op)), (arg))
212#define domain_error2(op,a1,a2) \ 211#define domain_error2(op,a1,a2) \
213 Fsignal (Qdomain_error, Fcons (build_string ((op)), \ 212 xsignal3 (Qdomain_error, build_string ((op)), (a1), (a2))
214 Fcons ((a1), Fcons ((a2), Qnil))))
215 213
216/* Extract a Lisp number as a `double', or signal an error. */ 214/* Extract a Lisp number as a `double', or signal an error. */
217 215
@@ -756,7 +754,7 @@ rounding_driver (arg, divisor, double_round, int_round2, name)
756 f1 = FLOATP (arg) ? XFLOAT_DATA (arg) : XINT (arg); 754 f1 = FLOATP (arg) ? XFLOAT_DATA (arg) : XINT (arg);
757 f2 = (FLOATP (divisor) ? XFLOAT_DATA (divisor) : XINT (divisor)); 755 f2 = (FLOATP (divisor) ? XFLOAT_DATA (divisor) : XINT (divisor));
758 if (! IEEE_FLOATING_POINT && f2 == 0) 756 if (! IEEE_FLOATING_POINT && f2 == 0)
759 Fsignal (Qarith_error, Qnil); 757 xsignal0 (Qarith_error);
760 758
761 IN_FLOAT2 (f1 = (*double_round) (f1 / f2), name, arg, divisor); 759 IN_FLOAT2 (f1 = (*double_round) (f1 / f2), name, arg, divisor);
762 FLOAT_TO_INT2 (f1, arg, name, arg, divisor); 760 FLOAT_TO_INT2 (f1, arg, name, arg, divisor);
@@ -767,7 +765,7 @@ rounding_driver (arg, divisor, double_round, int_round2, name)
767 i2 = XINT (divisor); 765 i2 = XINT (divisor);
768 766
769 if (i2 == 0) 767 if (i2 == 0)
770 Fsignal (Qarith_error, Qnil); 768 xsignal0 (Qarith_error);
771 769
772 XSETINT (arg, (*int_round2) (i1, i2)); 770 XSETINT (arg, (*int_round2) (i1, i2));
773 return arg; 771 return arg;
@@ -907,7 +905,7 @@ fmod_float (x, y)
907 f2 = FLOATP (y) ? XFLOAT_DATA (y) : XINT (y); 905 f2 = FLOATP (y) ? XFLOAT_DATA (y) : XINT (y);
908 906
909 if (! IEEE_FLOATING_POINT && f2 == 0) 907 if (! IEEE_FLOATING_POINT && f2 == 0)
910 Fsignal (Qarith_error, Qnil); 908 xsignal0 (Qarith_error);
911 909
912 /* If the "remainder" comes out with the wrong sign, fix it. */ 910 /* If the "remainder" comes out with the wrong sign, fix it. */
913 IN_FLOAT2 ((f1 = fmod (f1, f2), 911 IN_FLOAT2 ((f1 = fmod (f1, f2),
@@ -986,7 +984,7 @@ float_error (signo)
986 SIGNAL_THREAD_CHECK (signo); 984 SIGNAL_THREAD_CHECK (signo);
987 in_float = 0; 985 in_float = 0;
988 986
989 Fsignal (Qarith_error, Fcons (float_error_arg, Qnil)); 987 xsignal1 (Qarith_error, float_error_arg);
990} 988}
991 989
992/* Another idea was to replace the library function `infnan' 990/* Another idea was to replace the library function `infnan'
@@ -1014,11 +1012,11 @@ matherr (x)
1014 : Qnil))); 1012 : Qnil)));
1015 switch (x->type) 1013 switch (x->type)
1016 { 1014 {
1017 case DOMAIN: Fsignal (Qdomain_error, args); break; 1015 case DOMAIN: xsignal (Qdomain_error, args); break;
1018 case SING: Fsignal (Qsingularity_error, args); break; 1016 case SING: xsignal (Qsingularity_error, args); break;
1019 case OVERFLOW: Fsignal (Qoverflow_error, args); break; 1017 case OVERFLOW: xsignal (Qoverflow_error, args); break;
1020 case UNDERFLOW: Fsignal (Qunderflow_error, args); break; 1018 case UNDERFLOW: xsignal (Qunderflow_error, args); break;
1021 default: Fsignal (Qarith_error, args); break; 1019 default: xsignal (Qarith_error, args); break;
1022 } 1020 }
1023 return (1); /* don't set errno or print a message */ 1021 return (1); /* don't set errno or print a message */
1024} 1022}