comparison src/number.c @ 2286:04bc9d2f42c7

[xemacs-hg @ 2004-09-20 19:18:55 by james] Mark all unused parameters as unused. Also eliminate some unneeded local variables.
author james
date Mon, 20 Sep 2004 19:20:08 +0000
parents f557693c61de
children 3d8143fc88e1
comparison
equal deleted inserted replaced
2285:914c5afaac33 2286:04bc9d2f42c7
42 #endif 42 #endif
43 43
44 /********************************* Bignums **********************************/ 44 /********************************* Bignums **********************************/
45 #ifdef HAVE_BIGNUM 45 #ifdef HAVE_BIGNUM
46 static void 46 static void
47 bignum_print (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 47 bignum_print (Lisp_Object obj, Lisp_Object printcharfun,
48 int UNUSED (escapeflag))
48 { 49 {
49 CIbyte *bstr = bignum_to_string (XBIGNUM_DATA (obj), 10); 50 CIbyte *bstr = bignum_to_string (XBIGNUM_DATA (obj), 10);
50 write_c_string (printcharfun, bstr); 51 write_c_string (printcharfun, bstr);
51 xfree (bstr, CIbyte *); 52 xfree (bstr, CIbyte *);
52 } 53 }
53 54
54 static int 55 static int
55 bignum_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) 56 bignum_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
56 { 57 {
57 return bignum_eql (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2)); 58 return bignum_eql (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2));
58 } 59 }
59 60
60 static Hashcode 61 static Hashcode
61 bignum_hash (Lisp_Object obj, int depth) 62 bignum_hash (Lisp_Object obj, int UNUSED (depth))
62 { 63 {
63 return bignum_hashcode (XBIGNUM_DATA (obj)); 64 return bignum_hashcode (XBIGNUM_DATA (obj));
64 } 65 }
65 66
66 static const struct memory_description bignum_description[] = { 67 static const struct memory_description bignum_description[] = {
118 119
119 120
120 /********************************** Ratios **********************************/ 121 /********************************** Ratios **********************************/
121 #ifdef HAVE_RATIO 122 #ifdef HAVE_RATIO
122 static void 123 static void
123 ratio_print (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 124 ratio_print (Lisp_Object obj, Lisp_Object printcharfun,
125 int UNUSED (escapeflag))
124 { 126 {
125 CIbyte *rstr = ratio_to_string (XRATIO_DATA (obj), 10); 127 CIbyte *rstr = ratio_to_string (XRATIO_DATA (obj), 10);
126 write_c_string (printcharfun, rstr); 128 write_c_string (printcharfun, rstr);
127 xfree (rstr, CIbyte *); 129 xfree (rstr, CIbyte *);
128 } 130 }
129 131
130 static int 132 static int
131 ratio_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) 133 ratio_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
132 { 134 {
133 return ratio_eql (XRATIO_DATA (obj1), XRATIO_DATA (obj2)); 135 return ratio_eql (XRATIO_DATA (obj1), XRATIO_DATA (obj2));
134 } 136 }
135 137
136 static Hashcode 138 static Hashcode
137 ratio_hash (Lisp_Object obj, int depth) 139 ratio_hash (Lisp_Object obj, int UNUSED (depth))
138 { 140 {
139 return ratio_hashcode (XRATIO_DATA (obj)); 141 return ratio_hashcode (XRATIO_DATA (obj));
140 } 142 }
141 143
142 static const struct memory_description ratio_description[] = { 144 static const struct memory_description ratio_description[] = {
204 206
205 207
206 /******************************** Bigfloats *********************************/ 208 /******************************** Bigfloats *********************************/
207 #ifdef HAVE_BIGFLOAT 209 #ifdef HAVE_BIGFLOAT
208 static void 210 static void
209 bigfloat_print (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 211 bigfloat_print (Lisp_Object obj, Lisp_Object printcharfun,
212 int UNUSED (escapeflag))
210 { 213 {
211 CIbyte *fstr = bigfloat_to_string (XBIGFLOAT_DATA (obj), 10); 214 CIbyte *fstr = bigfloat_to_string (XBIGFLOAT_DATA (obj), 10);
212 write_c_string (printcharfun, fstr); 215 write_c_string (printcharfun, fstr);
213 xfree (fstr, CIbyte *); 216 xfree (fstr, CIbyte *);
214 } 217 }
215 218
216 static int 219 static int
217 bigfloat_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) 220 bigfloat_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
218 { 221 {
219 return bigfloat_eql (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2)); 222 return bigfloat_eql (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2));
220 } 223 }
221 224
222 static Hashcode 225 static Hashcode
223 bigfloat_hash (Lisp_Object obj, int depth) 226 bigfloat_hash (Lisp_Object obj, int UNUSED (depth))
224 { 227 {
225 return bigfloat_hashcode (XBIGFLOAT_DATA (obj)); 228 return bigfloat_hashcode (XBIGFLOAT_DATA (obj));
226 } 229 }
227 230
228 static const struct memory_description bigfloat_description[] = { 231 static const struct memory_description bigfloat_description[] = {
293 XBIGFLOAT_SET_PREC (f, prec); 296 XBIGFLOAT_SET_PREC (f, prec);
294 return Fbigfloat_get_precision (f); 297 return Fbigfloat_get_precision (f);
295 } 298 }
296 299
297 static int 300 static int
298 default_float_precision_changed (Lisp_Object sym, Lisp_Object *val, 301 default_float_precision_changed (Lisp_Object UNUSED (sym), Lisp_Object *val,
299 Lisp_Object in_object, int flags) 302 Lisp_Object UNUSED (in_object),
303 int UNUSED (flags))
300 { 304 {
301 unsigned long prec; 305 unsigned long prec;
302 306
303 CONCHECK_INTEGER (*val); 307 CONCHECK_INTEGER (*val);
304 #ifdef HAVE_BIGFLOAT 308 #ifdef HAVE_BIGFLOAT
404 408
405 /* Convert NUMBER to type TYPE. If TYPE is BIGFLOAT_T then use the indicated 409 /* Convert NUMBER to type TYPE. If TYPE is BIGFLOAT_T then use the indicated
406 PRECISION; otherwise, PRECISION is ignored. */ 410 PRECISION; otherwise, PRECISION is ignored. */
407 static Lisp_Object 411 static Lisp_Object
408 internal_coerce_number (Lisp_Object number, enum number_type type, 412 internal_coerce_number (Lisp_Object number, enum number_type type,
409 unsigned long precision) 413 #ifdef HAVE_BIGFLOAT
414 unsigned long precision
415 #else
416 unsigned long UNUSED (precision)
417 #endif
418 )
410 { 419 {
411 enum number_type current_type; 420 enum number_type current_type;
412 421
413 if (CHARP (number)) 422 if (CHARP (number))
414 number = make_int (XCHAR (number)); 423 number = make_int (XCHAR (number));
636 bigfloat; it is ignored otherwise. If nil, the default precision is used. 645 bigfloat; it is ignored otherwise. If nil, the default precision is used.
637 646
638 Note that some conversions lose information. No error is signaled in such 647 Note that some conversions lose information. No error is signaled in such
639 cases; the information is silently lost. 648 cases; the information is silently lost.
640 */ 649 */
641 (number, type, precision)) 650 (number, type,
651 #ifdef HAVE_BIGFLOAT
652 precision
653 #else
654 UNUSED (precision)
655 #endif
656 ))
642 { 657 {
643 CHECK_SYMBOL (type); 658 CHECK_SYMBOL (type);
644 if (EQ (type, Qfixnum)) 659 if (EQ (type, Qfixnum))
645 return internal_coerce_number (number, FIXNUM_T, 0UL); 660 return internal_coerce_number (number, FIXNUM_T, 0UL);
646 else if (EQ (type, Qinteger)) 661 else if (EQ (type, Qinteger))