Mercurial > hg > xemacs-beta
comparison src/data.c @ 2001:cc5b615380f8
[xemacs-hg @ 2004-04-08 15:23:07 by james]
Various fixes to repair the C++ build.
author | james |
---|---|
date | Thu, 08 Apr 2004 15:23:09 +0000 |
parents | 4e6a63799f08 |
children | a9cdbfb4716e |
comparison
equal
deleted
inserted
replaced
2000:645edb8ae417 | 2001:cc5b615380f8 |
---|---|
834 | 834 |
835 | 835 |
836 /**********************************************************************/ | 836 /**********************************************************************/ |
837 /* Arithmetic functions */ | 837 /* Arithmetic functions */ |
838 /**********************************************************************/ | 838 /**********************************************************************/ |
839 #ifndef WITH_NUMBER_TYPES | |
839 typedef struct | 840 typedef struct |
840 { | 841 { |
841 int int_p; | 842 int int_p; |
842 union | 843 union |
843 { | 844 { |
874 { | 875 { |
875 obj = wrong_type_argument (Qnumber_char_or_marker_p, obj); | 876 obj = wrong_type_argument (Qnumber_char_or_marker_p, obj); |
876 goto retry; | 877 goto retry; |
877 } | 878 } |
878 } | 879 } |
880 #endif /* WITH_NUMBER_TYPES */ | |
879 | 881 |
880 static EMACS_INT | 882 static EMACS_INT |
881 integer_char_or_marker_to_int (Lisp_Object obj) | 883 integer_char_or_marker_to_int (Lisp_Object obj) |
882 { | 884 { |
883 retry: | 885 retry: |
1211 long_to_string (buffer, XINT (number)); | 1213 long_to_string (buffer, XINT (number)); |
1212 return build_string (buffer); | 1214 return build_string (buffer); |
1213 } | 1215 } |
1214 } | 1216 } |
1215 | 1217 |
1218 #ifndef HAVE_BIGNUM | |
1216 static int | 1219 static int |
1217 digit_to_number (int character, int base) | 1220 digit_to_number (int character, int base) |
1218 { | 1221 { |
1219 /* Assumes ASCII */ | 1222 /* Assumes ASCII */ |
1220 int digit = ((character >= '0' && character <= '9') ? character - '0' : | 1223 int digit = ((character >= '0' && character <= '9') ? character - '0' : |
1222 (character >= 'A' && character <= 'Z') ? character - 'A' + 10 : | 1225 (character >= 'A' && character <= 'Z') ? character - 'A' + 10 : |
1223 -1); | 1226 -1); |
1224 | 1227 |
1225 return digit >= base ? -1 : digit; | 1228 return digit >= base ? -1 : digit; |
1226 } | 1229 } |
1230 #endif | |
1227 | 1231 |
1228 DEFUN ("string-to-number", Fstring_to_number, 1, 2, 0, /* | 1232 DEFUN ("string-to-number", Fstring_to_number, 1, 2, 0, /* |
1229 Convert STRING to a number by parsing it as a number in base BASE. | 1233 Convert STRING to a number by parsing it as a number in base BASE. |
1230 This parses both integers and floating point numbers. | 1234 This parses both integers and floating point numbers. |
1231 If they are supported, it also reads ratios. | 1235 If they are supported, it also reads ratios. |