diff options
| author | Stefan Monnier | 2010-09-30 01:28:20 +0200 |
|---|---|---|
| committer | Stefan Monnier | 2010-09-30 01:28:20 +0200 |
| commit | a01a7932080e8a6e7bc8472c58cefabcc2c37df3 (patch) | |
| tree | 94b28b19c8f1536e76ffe7d5826811b74a79e3a5 /src/doc.c | |
| parent | cc390e46c7ba95b76ea133d98fd386214cd01709 (diff) | |
| parent | 6b0f7311f16646e0de2045b2410e20921901c616 (diff) | |
| download | emacs-a01a7932080e8a6e7bc8472c58cefabcc2c37df3.tar.gz emacs-a01a7932080e8a6e7bc8472c58cefabcc2c37df3.zip | |
Merge from trunk
Diffstat (limited to 'src/doc.c')
| -rw-r--r-- | src/doc.c | 40 |
1 files changed, 20 insertions, 20 deletions
| @@ -100,8 +100,8 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition) | |||
| 100 | register int fd; | 100 | register int fd; |
| 101 | register char *name; | 101 | register char *name; |
| 102 | register char *p, *p1; | 102 | register char *p, *p1; |
| 103 | int minsize; | 103 | EMACS_INT minsize; |
| 104 | int offset, position; | 104 | EMACS_INT offset, position; |
| 105 | Lisp_Object file, tem; | 105 | Lisp_Object file, tem; |
| 106 | 106 | ||
| 107 | if (INTEGERP (filepos)) | 107 | if (INTEGERP (filepos)) |
| @@ -180,14 +180,14 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition) | |||
| 180 | p = get_doc_string_buffer; | 180 | p = get_doc_string_buffer; |
| 181 | while (1) | 181 | while (1) |
| 182 | { | 182 | { |
| 183 | int space_left = (get_doc_string_buffer_size | 183 | EMACS_INT space_left = (get_doc_string_buffer_size |
| 184 | - (p - get_doc_string_buffer)); | 184 | - (p - get_doc_string_buffer)); |
| 185 | int nread; | 185 | int nread; |
| 186 | 186 | ||
| 187 | /* Allocate or grow the buffer if we need to. */ | 187 | /* Allocate or grow the buffer if we need to. */ |
| 188 | if (space_left == 0) | 188 | if (space_left == 0) |
| 189 | { | 189 | { |
| 190 | int in_buffer = p - get_doc_string_buffer; | 190 | EMACS_INT in_buffer = p - get_doc_string_buffer; |
| 191 | get_doc_string_buffer_size += 16 * 1024; | 191 | get_doc_string_buffer_size += 16 * 1024; |
| 192 | get_doc_string_buffer | 192 | get_doc_string_buffer |
| 193 | = (char *) xrealloc (get_doc_string_buffer, | 193 | = (char *) xrealloc (get_doc_string_buffer, |
| @@ -287,8 +287,8 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition) | |||
| 287 | else | 287 | else |
| 288 | { | 288 | { |
| 289 | /* The data determines whether the string is multibyte. */ | 289 | /* The data determines whether the string is multibyte. */ |
| 290 | int nchars = multibyte_chars_in_text (get_doc_string_buffer + offset, | 290 | EMACS_INT nchars = multibyte_chars_in_text (get_doc_string_buffer + offset, |
| 291 | to - (get_doc_string_buffer + offset)); | 291 | to - (get_doc_string_buffer + offset)); |
| 292 | return make_string_from_bytes (get_doc_string_buffer + offset, | 292 | return make_string_from_bytes (get_doc_string_buffer + offset, |
| 293 | nchars, | 293 | nchars, |
| 294 | to - (get_doc_string_buffer + offset)); | 294 | to - (get_doc_string_buffer + offset)); |
| @@ -561,8 +561,8 @@ the same file name is found in the `doc-directory'. */) | |||
| 561 | { | 561 | { |
| 562 | int fd; | 562 | int fd; |
| 563 | char buf[1024 + 1]; | 563 | char buf[1024 + 1]; |
| 564 | register int filled; | 564 | register EMACS_INT filled; |
| 565 | register int pos; | 565 | register EMACS_INT pos; |
| 566 | register char *p, *end; | 566 | register char *p, *end; |
| 567 | Lisp_Object sym; | 567 | Lisp_Object sym; |
| 568 | char *name; | 568 | char *name; |
| @@ -596,7 +596,7 @@ the same file name is found in the `doc-directory'. */) | |||
| 596 | 596 | ||
| 597 | for (beg = buildobj; *beg; beg = end) | 597 | for (beg = buildobj; *beg; beg = end) |
| 598 | { | 598 | { |
| 599 | int len; | 599 | EMACS_INT len; |
| 600 | 600 | ||
| 601 | while (*beg && isspace (*beg)) ++beg; | 601 | while (*beg && isspace (*beg)) ++beg; |
| 602 | 602 | ||
| @@ -643,7 +643,7 @@ the same file name is found in the `doc-directory'. */) | |||
| 643 | if (end - p > 4 && end[-2] == '.' | 643 | if (end - p > 4 && end[-2] == '.' |
| 644 | && (end[-1] == 'o' || end[-1] == 'c')) | 644 | && (end[-1] == 'o' || end[-1] == 'c')) |
| 645 | { | 645 | { |
| 646 | int len = end - p - 2; | 646 | EMACS_INT len = end - p - 2; |
| 647 | char *fromfile = alloca (len + 1); | 647 | char *fromfile = alloca (len + 1); |
| 648 | strncpy (fromfile, &p[2], len); | 648 | strncpy (fromfile, &p[2], len); |
| 649 | fromfile[len] = 0; | 649 | fromfile[len] = 0; |
| @@ -688,7 +688,7 @@ the same file name is found in the `doc-directory'. */) | |||
| 688 | } | 688 | } |
| 689 | pos += end - buf; | 689 | pos += end - buf; |
| 690 | filled -= end - buf; | 690 | filled -= end - buf; |
| 691 | memcpy (buf, end, filled); | 691 | memmove (buf, end, filled); |
| 692 | } | 692 | } |
| 693 | emacs_close (fd); | 693 | emacs_close (fd); |
| 694 | return Qnil; | 694 | return Qnil; |
| @@ -715,16 +715,16 @@ a new string, without any text properties, is returned. */) | |||
| 715 | int changed = 0; | 715 | int changed = 0; |
| 716 | register unsigned char *strp; | 716 | register unsigned char *strp; |
| 717 | register unsigned char *bufp; | 717 | register unsigned char *bufp; |
| 718 | int idx; | 718 | EMACS_INT idx; |
| 719 | int bsize; | 719 | EMACS_INT bsize; |
| 720 | Lisp_Object tem; | 720 | Lisp_Object tem; |
| 721 | Lisp_Object keymap; | 721 | Lisp_Object keymap; |
| 722 | unsigned char *start; | 722 | unsigned char *start; |
| 723 | int length, length_byte; | 723 | EMACS_INT length, length_byte; |
| 724 | Lisp_Object name; | 724 | Lisp_Object name; |
| 725 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 725 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 726 | int multibyte; | 726 | int multibyte; |
| 727 | int nchars; | 727 | EMACS_INT nchars; |
| 728 | 728 | ||
| 729 | if (NILP (string)) | 729 | if (NILP (string)) |
| 730 | return Qnil; | 730 | return Qnil; |
| @@ -776,7 +776,7 @@ a new string, without any text properties, is returned. */) | |||
| 776 | } | 776 | } |
| 777 | else if (strp[0] == '\\' && strp[1] == '[') | 777 | else if (strp[0] == '\\' && strp[1] == '[') |
| 778 | { | 778 | { |
| 779 | int start_idx; | 779 | EMACS_INT start_idx; |
| 780 | int follow_remap = 1; | 780 | int follow_remap = 1; |
| 781 | 781 | ||
| 782 | changed = 1; | 782 | changed = 1; |
| @@ -815,7 +815,7 @@ a new string, without any text properties, is returned. */) | |||
| 815 | 815 | ||
| 816 | if (NILP (tem)) /* but not on any keys */ | 816 | if (NILP (tem)) /* but not on any keys */ |
| 817 | { | 817 | { |
| 818 | int offset = bufp - buf; | 818 | EMACS_INT offset = bufp - buf; |
| 819 | buf = (unsigned char *) xrealloc (buf, bsize += 4); | 819 | buf = (unsigned char *) xrealloc (buf, bsize += 4); |
| 820 | bufp = buf + offset; | 820 | bufp = buf + offset; |
| 821 | memcpy (bufp, "M-x ", 4); | 821 | memcpy (bufp, "M-x ", 4); |
| @@ -838,7 +838,7 @@ a new string, without any text properties, is returned. */) | |||
| 838 | else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<')) | 838 | else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<')) |
| 839 | { | 839 | { |
| 840 | struct buffer *oldbuf; | 840 | struct buffer *oldbuf; |
| 841 | int start_idx; | 841 | EMACS_INT start_idx; |
| 842 | /* This is for computing the SHADOWS arg for describe_map_tree. */ | 842 | /* This is for computing the SHADOWS arg for describe_map_tree. */ |
| 843 | Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil); | 843 | Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil); |
| 844 | Lisp_Object earlier_maps; | 844 | Lisp_Object earlier_maps; |
| @@ -909,7 +909,7 @@ a new string, without any text properties, is returned. */) | |||
| 909 | length_byte = SBYTES (tem); | 909 | length_byte = SBYTES (tem); |
| 910 | subst: | 910 | subst: |
| 911 | { | 911 | { |
| 912 | int offset = bufp - buf; | 912 | EMACS_INT offset = bufp - buf; |
| 913 | buf = (unsigned char *) xrealloc (buf, bsize += length_byte); | 913 | buf = (unsigned char *) xrealloc (buf, bsize += length_byte); |
| 914 | bufp = buf + offset; | 914 | bufp = buf + offset; |
| 915 | memcpy (bufp, start, length_byte); | 915 | memcpy (bufp, start, length_byte); |