Mercurial > hg > xemacs-beta
comparison src/print.c @ 1104:8b464283e891
[xemacs-hg @ 2002-11-12 18:58:13 by james]
Unconditionally compile the LISP_FLOAT_TYPE code. Remove all
!LISP_FLOAT_TYPE code and the LISP_FLOAT_TYPE identifier itself.
author | james |
---|---|
date | Tue, 12 Nov 2002 18:58:41 +0000 |
parents | 79c6ff3eef26 |
children | e22b0213b713 |
comparison
equal
deleted
inserted
replaced
1103:80d9ab2e9855 | 1104:8b464283e891 |
---|---|
969 print_error_message (error_object, canonicalize_printcharfun (stream)); | 969 print_error_message (error_object, canonicalize_printcharfun (stream)); |
970 return Qnil; | 970 return Qnil; |
971 } | 971 } |
972 | 972 |
973 | 973 |
974 #ifdef LISP_FLOAT_TYPE | |
975 | |
976 Lisp_Object Vfloat_output_format; | 974 Lisp_Object Vfloat_output_format; |
977 | 975 |
978 /* | 976 /* |
979 * This buffer should be at least as large as the max string size of the | 977 * This buffer should be at least as large as the max string size of the |
980 * largest float, printed in the biggest notation. This is undoubtedly | 978 * largest float, printed in the biggest notation. This is undoubtedly |
1058 for (i = strlen (buf) + 1; i >= 0; i--) | 1056 for (i = strlen (buf) + 1; i >= 0; i--) |
1059 buf [i+1] = buf [i]; | 1057 buf [i+1] = buf [i]; |
1060 buf [(buf [0] == '-' ? 1 : 0)] = '0'; | 1058 buf [(buf [0] == '-' ? 1 : 0)] = '0'; |
1061 } | 1059 } |
1062 } | 1060 } |
1063 #endif /* LISP_FLOAT_TYPE */ | |
1064 | 1061 |
1065 #define ONE_DIGIT(figure) *p++ = n / (figure) + '0' | 1062 #define ONE_DIGIT(figure) *p++ = n / (figure) + '0' |
1066 #define ONE_DIGIT_ADVANCE(figure) (ONE_DIGIT (figure), n %= (figure)) | 1063 #define ONE_DIGIT_ADVANCE(figure) (ONE_DIGIT (figure), n %= (figure)) |
1067 | 1064 |
1068 #define DIGITS_1(figure) ONE_DIGIT (figure) | 1065 #define DIGITS_1(figure) ONE_DIGIT (figure) |
1606 } | 1603 } |
1607 | 1604 |
1608 unbind_to (specdepth); | 1605 unbind_to (specdepth); |
1609 } | 1606 } |
1610 | 1607 |
1611 | |
1612 #ifdef LISP_FLOAT_TYPE | |
1613 void | 1608 void |
1614 print_float (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 1609 print_float (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
1615 { | 1610 { |
1616 char pigbuf[350]; /* see comments in float_to_string */ | 1611 char pigbuf[350]; /* see comments in float_to_string */ |
1617 | 1612 |
1618 float_to_string (pigbuf, XFLOAT_DATA (obj)); | 1613 float_to_string (pigbuf, XFLOAT_DATA (obj)); |
1619 write_c_string (printcharfun, pigbuf); | 1614 write_c_string (printcharfun, pigbuf); |
1620 } | 1615 } |
1621 #endif /* LISP_FLOAT_TYPE */ | |
1622 | 1616 |
1623 void | 1617 void |
1624 print_symbol (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 1618 print_symbol (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
1625 { | 1619 { |
1626 /* This function can GC */ | 1620 /* This function can GC */ |
1705 break; | 1699 break; |
1706 } | 1700 } |
1707 } | 1701 } |
1708 not_yet_confused: | 1702 not_yet_confused: |
1709 | 1703 |
1710 #ifdef LISP_FLOAT_TYPE | |
1711 if (!confusing) | 1704 if (!confusing) |
1712 /* #### Ugh, this is needlessly complex and slow for what we | 1705 /* #### Ugh, this is needlessly complex and slow for what we |
1713 need here. It might be a good idea to copy equivalent code | 1706 need here. It might be a good idea to copy equivalent code |
1714 from FSF. --hniksic */ | 1707 from FSF. --hniksic */ |
1715 confusing = isfloat_string ((char *) data); | 1708 confusing = isfloat_string ((char *) data); |
1716 #endif | |
1717 if (confusing) | 1709 if (confusing) |
1718 write_c_string (printcharfun, "\\"); | 1710 write_c_string (printcharfun, "\\"); |
1719 } | 1711 } |
1720 | 1712 |
1721 { | 1713 { |
2038 or a marker (output is inserted and the marker is advanced) | 2030 or a marker (output is inserted and the marker is advanced) |
2039 or the symbol t (output appears in the minibuffer line). | 2031 or the symbol t (output appears in the minibuffer line). |
2040 */ ); | 2032 */ ); |
2041 Vstandard_output = Qt; | 2033 Vstandard_output = Qt; |
2042 | 2034 |
2043 #ifdef LISP_FLOAT_TYPE | |
2044 DEFVAR_LISP ("float-output-format", &Vfloat_output_format /* | 2035 DEFVAR_LISP ("float-output-format", &Vfloat_output_format /* |
2045 The format descriptor string that lisp uses to print floats. | 2036 The format descriptor string that lisp uses to print floats. |
2046 This is a %-spec like those accepted by `printf' in C, | 2037 This is a %-spec like those accepted by `printf' in C, |
2047 but with some restrictions. It must start with the two characters `%.'. | 2038 but with some restrictions. It must start with the two characters `%.'. |
2048 After that comes an integer precision specification, | 2039 After that comes an integer precision specification, |
2062 that is, a floating-point number will always be printed with a decimal | 2053 that is, a floating-point number will always be printed with a decimal |
2063 point and/or an exponent, even if the digits following the decimal point | 2054 point and/or an exponent, even if the digits following the decimal point |
2064 are all zero. This is to preserve read-equivalence. | 2055 are all zero. This is to preserve read-equivalence. |
2065 */ ); | 2056 */ ); |
2066 Vfloat_output_format = Qnil; | 2057 Vfloat_output_format = Qnil; |
2067 #endif /* LISP_FLOAT_TYPE */ | |
2068 | 2058 |
2069 DEFVAR_LISP ("print-length", &Vprint_length /* | 2059 DEFVAR_LISP ("print-length", &Vprint_length /* |
2070 Maximum length of list or vector to print before abbreviating. | 2060 Maximum length of list or vector to print before abbreviating. |
2071 A value of nil means no limit. | 2061 A value of nil means no limit. |
2072 */ ); | 2062 */ ); |