Mercurial > emacs
comparison src/doc.c @ 110513:43adca79c8fd
Clean up EMACS_INT/int usage in doc.c and doprnt.c.
author | Lars Magne Ingebrigtsen <larsi@gnus.org> |
---|---|
date | Thu, 23 Sep 2010 21:53:46 +0200 |
parents | 3132ab826fc5 |
children | 72f46bad930c |
comparison
equal
deleted
inserted
replaced
110512:ba79df773e8d | 110513:43adca79c8fd |
---|---|
97 { | 97 { |
98 char *from, *to; | 98 char *from, *to; |
99 register int fd; | 99 register int fd; |
100 register char *name; | 100 register char *name; |
101 register char *p, *p1; | 101 register char *p, *p1; |
102 int minsize; | 102 EMACS_INT minsize; |
103 int offset, position; | 103 EMACS_INT offset, position; |
104 Lisp_Object file, tem; | 104 Lisp_Object file, tem; |
105 | 105 |
106 if (INTEGERP (filepos)) | 106 if (INTEGERP (filepos)) |
107 { | 107 { |
108 file = Vdoc_file_name; | 108 file = Vdoc_file_name; |
177 P points beyond the data just read. */ | 177 P points beyond the data just read. */ |
178 | 178 |
179 p = get_doc_string_buffer; | 179 p = get_doc_string_buffer; |
180 while (1) | 180 while (1) |
181 { | 181 { |
182 int space_left = (get_doc_string_buffer_size | 182 EMACS_INT space_left = (get_doc_string_buffer_size |
183 - (p - get_doc_string_buffer)); | 183 - (p - get_doc_string_buffer)); |
184 int nread; | 184 int nread; |
185 | 185 |
186 /* Allocate or grow the buffer if we need to. */ | 186 /* Allocate or grow the buffer if we need to. */ |
187 if (space_left == 0) | 187 if (space_left == 0) |
188 { | 188 { |
189 int in_buffer = p - get_doc_string_buffer; | 189 EMACS_INT in_buffer = p - get_doc_string_buffer; |
190 get_doc_string_buffer_size += 16 * 1024; | 190 get_doc_string_buffer_size += 16 * 1024; |
191 get_doc_string_buffer | 191 get_doc_string_buffer |
192 = (char *) xrealloc (get_doc_string_buffer, | 192 = (char *) xrealloc (get_doc_string_buffer, |
193 get_doc_string_buffer_size + 1); | 193 get_doc_string_buffer_size + 1); |
194 p = get_doc_string_buffer + in_buffer; | 194 p = get_doc_string_buffer + in_buffer; |
284 return make_unibyte_string (get_doc_string_buffer + offset, | 284 return make_unibyte_string (get_doc_string_buffer + offset, |
285 to - (get_doc_string_buffer + offset)); | 285 to - (get_doc_string_buffer + offset)); |
286 else | 286 else |
287 { | 287 { |
288 /* The data determines whether the string is multibyte. */ | 288 /* The data determines whether the string is multibyte. */ |
289 int nchars = multibyte_chars_in_text (get_doc_string_buffer + offset, | 289 EMACS_INT nchars = multibyte_chars_in_text (get_doc_string_buffer + offset, |
290 to - (get_doc_string_buffer + offset)); | 290 to - (get_doc_string_buffer + offset)); |
291 return make_string_from_bytes (get_doc_string_buffer + offset, | 291 return make_string_from_bytes (get_doc_string_buffer + offset, |
292 nchars, | 292 nchars, |
293 to - (get_doc_string_buffer + offset)); | 293 to - (get_doc_string_buffer + offset)); |
294 } | 294 } |
295 } | 295 } |
549 the same file name is found in the `doc-directory'. */) | 549 the same file name is found in the `doc-directory'. */) |
550 (Lisp_Object filename) | 550 (Lisp_Object filename) |
551 { | 551 { |
552 int fd; | 552 int fd; |
553 char buf[1024 + 1]; | 553 char buf[1024 + 1]; |
554 register int filled; | 554 register EMACS_INT filled; |
555 register int pos; | 555 register EMACS_INT pos; |
556 register char *p, *end; | 556 register char *p, *end; |
557 Lisp_Object sym; | 557 Lisp_Object sym; |
558 char *name; | 558 char *name; |
559 int skip_file = 0; | 559 int skip_file = 0; |
560 | 560 |
584 { | 584 { |
585 const char *beg, *end; | 585 const char *beg, *end; |
586 | 586 |
587 for (beg = buildobj; *beg; beg = end) | 587 for (beg = buildobj; *beg; beg = end) |
588 { | 588 { |
589 int len; | 589 EMACS_INT len; |
590 | 590 |
591 while (*beg && isspace (*beg)) ++beg; | 591 while (*beg && isspace (*beg)) ++beg; |
592 | 592 |
593 for (end = beg; *end && ! isspace (*end); ++end) | 593 for (end = beg; *end && ! isspace (*end); ++end) |
594 if (*end == '/') beg = end+1; /* skip directory part */ | 594 if (*end == '/') beg = end+1; /* skip directory part */ |
631 { | 631 { |
632 skip_file = 0; | 632 skip_file = 0; |
633 if (end - p > 4 && end[-2] == '.' | 633 if (end - p > 4 && end[-2] == '.' |
634 && (end[-1] == 'o' || end[-1] == 'c')) | 634 && (end[-1] == 'o' || end[-1] == 'c')) |
635 { | 635 { |
636 int len = end - p - 2; | 636 EMACS_INT len = end - p - 2; |
637 char *fromfile = alloca (len + 1); | 637 char *fromfile = alloca (len + 1); |
638 strncpy (fromfile, &p[2], len); | 638 strncpy (fromfile, &p[2], len); |
639 fromfile[len] = 0; | 639 fromfile[len] = 0; |
640 if (fromfile[len-1] == 'c') | 640 if (fromfile[len-1] == 'c') |
641 fromfile[len-1] = 'o'; | 641 fromfile[len-1] = 'o'; |
703 { | 703 { |
704 unsigned char *buf; | 704 unsigned char *buf; |
705 int changed = 0; | 705 int changed = 0; |
706 register unsigned char *strp; | 706 register unsigned char *strp; |
707 register unsigned char *bufp; | 707 register unsigned char *bufp; |
708 int idx; | 708 EMACS_INT idx; |
709 int bsize; | 709 EMACS_INT bsize; |
710 Lisp_Object tem; | 710 Lisp_Object tem; |
711 Lisp_Object keymap; | 711 Lisp_Object keymap; |
712 unsigned char *start; | 712 unsigned char *start; |
713 int length, length_byte; | 713 EMACS_INT length, length_byte; |
714 Lisp_Object name; | 714 Lisp_Object name; |
715 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 715 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
716 int multibyte; | 716 int multibyte; |
717 int nchars; | 717 EMACS_INT nchars; |
718 | 718 |
719 if (NILP (string)) | 719 if (NILP (string)) |
720 return Qnil; | 720 return Qnil; |
721 | 721 |
722 CHECK_STRING (string); | 722 CHECK_STRING (string); |
764 else | 764 else |
765 *bufp++ = *strp++, nchars++; | 765 *bufp++ = *strp++, nchars++; |
766 } | 766 } |
767 else if (strp[0] == '\\' && strp[1] == '[') | 767 else if (strp[0] == '\\' && strp[1] == '[') |
768 { | 768 { |
769 int start_idx; | 769 EMACS_INT start_idx; |
770 int follow_remap = 1; | 770 int follow_remap = 1; |
771 | 771 |
772 changed = 1; | 772 changed = 1; |
773 strp += 2; /* skip \[ */ | 773 strp += 2; /* skip \[ */ |
774 start = strp; | 774 start = strp; |
803 strp = SDATA (string) + idx; | 803 strp = SDATA (string) + idx; |
804 start = SDATA (string) + start_idx; | 804 start = SDATA (string) + start_idx; |
805 | 805 |
806 if (NILP (tem)) /* but not on any keys */ | 806 if (NILP (tem)) /* but not on any keys */ |
807 { | 807 { |
808 int offset = bufp - buf; | 808 EMACS_INT offset = bufp - buf; |
809 buf = (unsigned char *) xrealloc (buf, bsize += 4); | 809 buf = (unsigned char *) xrealloc (buf, bsize += 4); |
810 bufp = buf + offset; | 810 bufp = buf + offset; |
811 memcpy (bufp, "M-x ", 4); | 811 memcpy (bufp, "M-x ", 4); |
812 bufp += 4; | 812 bufp += 4; |
813 nchars += 4; | 813 nchars += 4; |
826 /* \{foo} is replaced with a summary of the keymap (symbol-value foo). | 826 /* \{foo} is replaced with a summary of the keymap (symbol-value foo). |
827 \<foo> just sets the keymap used for \[cmd]. */ | 827 \<foo> just sets the keymap used for \[cmd]. */ |
828 else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<')) | 828 else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<')) |
829 { | 829 { |
830 struct buffer *oldbuf; | 830 struct buffer *oldbuf; |
831 int start_idx; | 831 EMACS_INT start_idx; |
832 /* This is for computing the SHADOWS arg for describe_map_tree. */ | 832 /* This is for computing the SHADOWS arg for describe_map_tree. */ |
833 Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil); | 833 Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil); |
834 Lisp_Object earlier_maps; | 834 Lisp_Object earlier_maps; |
835 | 835 |
836 changed = 1; | 836 changed = 1; |
897 start = SDATA (tem); | 897 start = SDATA (tem); |
898 length = SCHARS (tem); | 898 length = SCHARS (tem); |
899 length_byte = SBYTES (tem); | 899 length_byte = SBYTES (tem); |
900 subst: | 900 subst: |
901 { | 901 { |
902 int offset = bufp - buf; | 902 EMACS_INT offset = bufp - buf; |
903 buf = (unsigned char *) xrealloc (buf, bsize += length_byte); | 903 buf = (unsigned char *) xrealloc (buf, bsize += length_byte); |
904 bufp = buf + offset; | 904 bufp = buf + offset; |
905 memcpy (bufp, start, length_byte); | 905 memcpy (bufp, start, length_byte); |
906 bufp += length_byte; | 906 bufp += length_byte; |
907 nchars += length; | 907 nchars += length; |