diff options
| author | Paul Eggert | 2011-02-05 17:56:00 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-02-05 17:56:00 -0800 |
| commit | 9eee99eb8abb35eba265327328d55d2990d5d974 (patch) | |
| tree | b4a24c2888f5eddcf77d8883ae4595a4ce852f3c /src/doc.c | |
| parent | 32299e33800dc6a78754b5ac2dc0e15caea93e48 (diff) | |
| download | emacs-9eee99eb8abb35eba265327328d55d2990d5d974.tar.gz emacs-9eee99eb8abb35eba265327328d55d2990d5d974.zip | |
* doc.c: conform to C89 pointer rules
(get_doc_string, Fsnarf_documentation, Fsubstitute_command_keys):
Change types between char * and unsigned char *, to satisfy C89
rules about pointer type compatibility.
Diffstat (limited to 'src/doc.c')
| -rw-r--r-- | src/doc.c | 25 |
1 files changed, 14 insertions, 11 deletions
| @@ -260,7 +260,7 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition) | |||
| 260 | the same way we would read bytes from a file. */ | 260 | the same way we would read bytes from a file. */ |
| 261 | if (definition) | 261 | if (definition) |
| 262 | { | 262 | { |
| 263 | read_bytecode_pointer = get_doc_string_buffer + offset; | 263 | read_bytecode_pointer = (unsigned char *) get_doc_string_buffer + offset; |
| 264 | return Fread (Qlambda); | 264 | return Fread (Qlambda); |
| 265 | } | 265 | } |
| 266 | 266 | ||
| @@ -270,8 +270,10 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition) | |||
| 270 | else | 270 | else |
| 271 | { | 271 | { |
| 272 | /* The data determines whether the string is multibyte. */ | 272 | /* The data determines whether the string is multibyte. */ |
| 273 | EMACS_INT nchars = multibyte_chars_in_text (get_doc_string_buffer + offset, | 273 | EMACS_INT nchars = |
| 274 | to - (get_doc_string_buffer + offset)); | 274 | multibyte_chars_in_text (((unsigned char *) get_doc_string_buffer |
| 275 | + offset), | ||
| 276 | to - (get_doc_string_buffer + offset)); | ||
| 275 | return make_string_from_bytes (get_doc_string_buffer + offset, | 277 | return make_string_from_bytes (get_doc_string_buffer + offset, |
| 276 | nchars, | 278 | nchars, |
| 277 | to - (get_doc_string_buffer + offset)); | 279 | to - (get_doc_string_buffer + offset)); |
| @@ -630,7 +632,8 @@ the same file name is found in the `doc-directory'. */) | |||
| 630 | } | 632 | } |
| 631 | 633 | ||
| 632 | sym = oblookup (Vobarray, p + 2, | 634 | sym = oblookup (Vobarray, p + 2, |
| 633 | multibyte_chars_in_text (p + 2, end - p - 2), | 635 | multibyte_chars_in_text ((unsigned char *) p + 2, |
| 636 | end - p - 2), | ||
| 634 | end - p - 2); | 637 | end - p - 2); |
| 635 | /* Check skip_file so that when a function is defined several | 638 | /* Check skip_file so that when a function is defined several |
| 636 | times in different files (typically, once in xterm, once in | 639 | times in different files (typically, once in xterm, once in |
| @@ -685,10 +688,10 @@ Returns original STRING if no substitutions were made. Otherwise, | |||
| 685 | a new string, without any text properties, is returned. */) | 688 | a new string, without any text properties, is returned. */) |
| 686 | (Lisp_Object string) | 689 | (Lisp_Object string) |
| 687 | { | 690 | { |
| 688 | unsigned char *buf; | 691 | char *buf; |
| 689 | int changed = 0; | 692 | int changed = 0; |
| 690 | register unsigned char *strp; | 693 | register unsigned char *strp; |
| 691 | register unsigned char *bufp; | 694 | register char *bufp; |
| 692 | EMACS_INT idx; | 695 | EMACS_INT idx; |
| 693 | EMACS_INT bsize; | 696 | EMACS_INT bsize; |
| 694 | Lisp_Object tem; | 697 | Lisp_Object tem; |
| @@ -721,7 +724,7 @@ a new string, without any text properties, is returned. */) | |||
| 721 | keymap = Voverriding_local_map; | 724 | keymap = Voverriding_local_map; |
| 722 | 725 | ||
| 723 | bsize = SBYTES (string); | 726 | bsize = SBYTES (string); |
| 724 | bufp = buf = (unsigned char *) xmalloc (bsize); | 727 | bufp = buf = (char *) xmalloc (bsize); |
| 725 | 728 | ||
| 726 | strp = SDATA (string); | 729 | strp = SDATA (string); |
| 727 | while (strp < SDATA (string) + SBYTES (string)) | 730 | while (strp < SDATA (string) + SBYTES (string)) |
| @@ -768,7 +771,7 @@ a new string, without any text properties, is returned. */) | |||
| 768 | 771 | ||
| 769 | /* Save STRP in IDX. */ | 772 | /* Save STRP in IDX. */ |
| 770 | idx = strp - SDATA (string); | 773 | idx = strp - SDATA (string); |
| 771 | name = Fintern (make_string (start, length_byte), Qnil); | 774 | name = Fintern (make_string ((char *) start, length_byte), Qnil); |
| 772 | 775 | ||
| 773 | do_remap: | 776 | do_remap: |
| 774 | tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil); | 777 | tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil); |
| @@ -790,7 +793,7 @@ a new string, without any text properties, is returned. */) | |||
| 790 | if (NILP (tem)) /* but not on any keys */ | 793 | if (NILP (tem)) /* but not on any keys */ |
| 791 | { | 794 | { |
| 792 | EMACS_INT offset = bufp - buf; | 795 | EMACS_INT offset = bufp - buf; |
| 793 | buf = (unsigned char *) xrealloc (buf, bsize += 4); | 796 | buf = (char *) xrealloc (buf, bsize += 4); |
| 794 | bufp = buf + offset; | 797 | bufp = buf + offset; |
| 795 | memcpy (bufp, "M-x ", 4); | 798 | memcpy (bufp, "M-x ", 4); |
| 796 | bufp += 4; | 799 | bufp += 4; |
| @@ -835,7 +838,7 @@ a new string, without any text properties, is returned. */) | |||
| 835 | /* Get the value of the keymap in TEM, or nil if undefined. | 838 | /* Get the value of the keymap in TEM, or nil if undefined. |
| 836 | Do this while still in the user's current buffer | 839 | Do this while still in the user's current buffer |
| 837 | in case it is a local variable. */ | 840 | in case it is a local variable. */ |
| 838 | name = Fintern (make_string (start, length_byte), Qnil); | 841 | name = Fintern (make_string ((char *) start, length_byte), Qnil); |
| 839 | tem = Fboundp (name); | 842 | tem = Fboundp (name); |
| 840 | if (! NILP (tem)) | 843 | if (! NILP (tem)) |
| 841 | { | 844 | { |
| @@ -884,7 +887,7 @@ a new string, without any text properties, is returned. */) | |||
| 884 | subst: | 887 | subst: |
| 885 | { | 888 | { |
| 886 | EMACS_INT offset = bufp - buf; | 889 | EMACS_INT offset = bufp - buf; |
| 887 | buf = (unsigned char *) xrealloc (buf, bsize += length_byte); | 890 | buf = (char *) xrealloc (buf, bsize += length_byte); |
| 888 | bufp = buf + offset; | 891 | bufp = buf + offset; |
| 889 | memcpy (bufp, start, length_byte); | 892 | memcpy (bufp, start, length_byte); |
| 890 | bufp += length_byte; | 893 | bufp += length_byte; |