Mercurial > emacs
comparison src/data.c @ 25780:18cf58ed9400
(find_symbol_value): Remove unused variables.
(Faref, Fstring_to_number): Ditto.
(toplevel): Include stdio.h.
(Fnumber_to_string): Cast XINT to long for %ld.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 20 Sep 1999 23:18:38 +0000 |
parents | 8250026fe76d |
children | b7aa6ac26872 |
comparison
equal
deleted
inserted
replaced
25779:4065a85ee695 | 25780:18cf58ed9400 |
---|---|
20 | 20 |
21 | 21 |
22 #include <signal.h> | 22 #include <signal.h> |
23 | 23 |
24 #include <config.h> | 24 #include <config.h> |
25 #include <stdio.h> | |
25 #include "lisp.h" | 26 #include "lisp.h" |
26 #include "puresize.h" | 27 #include "puresize.h" |
27 #include "charset.h" | 28 #include "charset.h" |
28 | 29 |
29 #ifndef standalone | 30 #ifndef standalone |
883 | 884 |
884 Lisp_Object | 885 Lisp_Object |
885 find_symbol_value (symbol) | 886 find_symbol_value (symbol) |
886 Lisp_Object symbol; | 887 Lisp_Object symbol; |
887 { | 888 { |
888 register Lisp_Object valcontents, tem1; | 889 register Lisp_Object valcontents; |
889 register Lisp_Object val; | 890 register Lisp_Object val; |
890 CHECK_SYMBOL (symbol, 0); | 891 CHECK_SYMBOL (symbol, 0); |
891 valcontents = XSYMBOL (symbol)->value; | 892 valcontents = XSYMBOL (symbol)->value; |
892 | 893 |
893 if (BUFFER_LOCAL_VALUEP (valcontents) | 894 if (BUFFER_LOCAL_VALUEP (valcontents) |
1641 | 1642 |
1642 CHECK_NUMBER (idx, 1); | 1643 CHECK_NUMBER (idx, 1); |
1643 idxval = XINT (idx); | 1644 idxval = XINT (idx); |
1644 if (STRINGP (array)) | 1645 if (STRINGP (array)) |
1645 { | 1646 { |
1646 Lisp_Object val; | |
1647 int c, idxval_byte; | 1647 int c, idxval_byte; |
1648 | 1648 |
1649 if (idxval < 0 || idxval >= XSTRING (array)->size) | 1649 if (idxval < 0 || idxval >= XSTRING (array)->size) |
1650 args_out_of_range (array, idx); | 1650 args_out_of_range (array, idx); |
1651 if (! STRING_MULTIBYTE (array)) | 1651 if (! STRING_MULTIBYTE (array)) |
1794 val &= ~(1 << (idxval % BITS_PER_CHAR)); | 1794 val &= ~(1 << (idxval % BITS_PER_CHAR)); |
1795 XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR] = val; | 1795 XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR] = val; |
1796 } | 1796 } |
1797 else if (CHAR_TABLE_P (array)) | 1797 else if (CHAR_TABLE_P (array)) |
1798 { | 1798 { |
1799 Lisp_Object val; | |
1800 | |
1801 if (idxval < 0) | 1799 if (idxval < 0) |
1802 args_out_of_range (array, idx); | 1800 args_out_of_range (array, idx); |
1803 if (idxval < CHAR_TABLE_ORDINARY_SLOTS) | 1801 if (idxval < CHAR_TABLE_ORDINARY_SLOTS) |
1804 XCHAR_TABLE (array)->contents[idxval] = newelt; | 1802 XCHAR_TABLE (array)->contents[idxval] = newelt; |
1805 else | 1803 else |
1839 XCHAR_TABLE (array)->contents[code[i]] = newelt; | 1837 XCHAR_TABLE (array)->contents[code[i]] = newelt; |
1840 } | 1838 } |
1841 } | 1839 } |
1842 else if (STRING_MULTIBYTE (array)) | 1840 else if (STRING_MULTIBYTE (array)) |
1843 { | 1841 { |
1844 int c, idxval_byte, new_len, actual_len; | 1842 int idxval_byte, new_len, actual_len; |
1845 int prev_byte; | 1843 int prev_byte; |
1846 unsigned char *p, workbuf[4], *str; | 1844 unsigned char *p, workbuf[4], *str; |
1847 | 1845 |
1848 if (idxval < 0 || idxval >= XSTRING (array)->size) | 1846 if (idxval < 0 || idxval >= XSTRING (array)->size) |
1849 args_out_of_range (array, idx); | 1847 args_out_of_range (array, idx); |
2070 #endif /* LISP_FLOAT_TYPE */ | 2068 #endif /* LISP_FLOAT_TYPE */ |
2071 | 2069 |
2072 if (sizeof (int) == sizeof (EMACS_INT)) | 2070 if (sizeof (int) == sizeof (EMACS_INT)) |
2073 sprintf (buffer, "%d", XINT (number)); | 2071 sprintf (buffer, "%d", XINT (number)); |
2074 else if (sizeof (long) == sizeof (EMACS_INT)) | 2072 else if (sizeof (long) == sizeof (EMACS_INT)) |
2075 sprintf (buffer, "%ld", XINT (number)); | 2073 sprintf (buffer, "%ld", (long) XINT (number)); |
2076 else | 2074 else |
2077 abort (); | 2075 abort (); |
2078 return build_string (buffer); | 2076 return build_string (buffer); |
2079 } | 2077 } |
2080 | 2078 |
2109 If the base used is not 10, floating point is not recognized.") | 2107 If the base used is not 10, floating point is not recognized.") |
2110 (string, base) | 2108 (string, base) |
2111 register Lisp_Object string, base; | 2109 register Lisp_Object string, base; |
2112 { | 2110 { |
2113 register unsigned char *p; | 2111 register unsigned char *p; |
2114 register int b, digit, v = 0; | 2112 register int b, v = 0; |
2115 int negative = 1; | 2113 int negative = 1; |
2116 | 2114 |
2117 CHECK_STRING (string, 0); | 2115 CHECK_STRING (string, 0); |
2118 | 2116 |
2119 if (NILP (base)) | 2117 if (NILP (base)) |