comparison src/number.c @ 1995:4e6a63799f08

[xemacs-hg @ 2004-04-07 03:48:58 by james] Fix various ICC warnings and compilation errors.
author james
date Wed, 07 Apr 2004 03:49:00 +0000
parents 9c872f33ecbe
children ea0e08ca2c78
comparison
equal deleted inserted replaced
1994:cb7f3be19e9f 1995:4e6a63799f08
83 83
84 Lisp_Object 84 Lisp_Object
85 string_to_bignum(const Ibyte *str, Bytecount len, int base) 85 string_to_bignum(const Ibyte *str, Bytecount len, int base)
86 { 86 {
87 Lisp_Object b = make_bignum (0L); 87 Lisp_Object b = make_bignum (0L);
88 return (bignum_set_string (XBIGNUM_DATA (b), str, base) < 0) 88 return (bignum_set_string (XBIGNUM_DATA (b), (const char *) str, base) < 0)
89 ? Fsignal (Qinvalid_read_syntax, 89 ? Fsignal (Qinvalid_read_syntax,
90 list3 (build_msg_string 90 list3 (build_msg_string
91 ("Invalid integer constant in reader"), 91 ("Invalid integer constant in reader"),
92 make_string (str, len), 92 make_string (str, len),
93 make_int (10))) 93 make_int (10)))
396 if (BIGFLOATP (arg)) 396 if (BIGFLOATP (arg))
397 return BIGFLOAT_T; 397 return BIGFLOAT_T;
398 #endif 398 #endif
399 /* Catch unintentional bad uses of this function */ 399 /* Catch unintentional bad uses of this function */
400 abort (); 400 abort ();
401 /* NOTREACHED */
402 return FIXNUM_T;
401 } 403 }
402 404
403 /* Convert NUMBER to type TYPE. If TYPE is BIGFLOAT_T then use the indicated 405 /* Convert NUMBER to type TYPE. If TYPE is BIGFLOAT_T then use the indicated
404 PRECISION; otherwise, PRECISION is ignored. */ 406 PRECISION; otherwise, PRECISION is ignored. */
405 static Lisp_Object 407 static Lisp_Object
511 #endif /* HAVE_RATIO */ 513 #endif /* HAVE_RATIO */
512 case FLOAT_T: 514 case FLOAT_T:
513 switch (type) 515 switch (type)
514 { 516 {
515 case FIXNUM_T: 517 case FIXNUM_T:
516 return Fround (number); 518 return Ftruncate (number);
517 case BIGNUM_T: 519 case BIGNUM_T:
518 #ifdef HAVE_BIGNUM 520 #ifdef HAVE_BIGNUM
519 bignum_set_double (scratch_bignum, XFLOAT_DATA (number)); 521 bignum_set_double (scratch_bignum, XFLOAT_DATA (number));
520 return make_bignum_bg (scratch_bignum); 522 return make_bignum_bg (scratch_bignum);
521 #else 523 #else
568 #else 570 #else
569 abort (); 571 abort ();
570 #endif /* HAVE_BIGFLOAT */ 572 #endif /* HAVE_BIGFLOAT */
571 } 573 }
572 abort (); 574 abort ();
575 /* NOTREACHED */
576 return Qzero;
573 } 577 }
574 578
575 /* This function promotes its arguments as necessary to make them both the 579 /* This function promotes its arguments as necessary to make them both the
576 same type. It destructively modifies its arguments to do so. Characters 580 same type. It destructively modifies its arguments to do so. Characters
577 and markers are ALWAYS converted to integers. */ 581 and markers are ALWAYS converted to integers. */