aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2010-09-23 21:53:46 +0200
committerLars Magne Ingebrigtsen2010-09-23 21:53:46 +0200
commit84c9ce0579c1f16670d15c486dc3ceeb3c103af1 (patch)
treef6e594974b92d159036fd6cc0d12e20b5f82feb2 /src
parentfe3537c3a91491253a87f4d43540344d040c34e7 (diff)
downloademacs-84c9ce0579c1f16670d15c486dc3ceeb3c103af1.tar.gz
emacs-84c9ce0579c1f16670d15c486dc3ceeb3c103af1.zip
Clean up EMACS_INT/int usage in doc.c and doprnt.c.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/doc.c38
-rw-r--r--src/doprnt.c4
-rw-r--r--src/lisp.h2
4 files changed, 29 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c8ea550e18c..b50e07c7fe0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -8,6 +8,13 @@
8 8
92010-09-23 Lars Magne Ingebrigtsen <larsi@gnus.org> 92010-09-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
10 10
11 * lisp.h: doprnt.c EMACS_INT/int cleanup.
12
13 * doprnt.c (doprnt): EMACS_INT/int cleanup.
14
15 * doc.c (Fsnarf_documentation, get_doc_string): EMACS_INT/int
16 cleanup.
17
11 * lisp.h: Change the definition of all marker.c functions that 18 * lisp.h: Change the definition of all marker.c functions that
12 take and return buffer stuff to be EMACS_INT instead of int. 19 take and return buffer stuff to be EMACS_INT instead of int.
13 20
diff --git a/src/doc.c b/src/doc.c
index 36f7c0e882a..8d5727b95c6 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -99,8 +99,8 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
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))
@@ -179,14 +179,14 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
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,
@@ -286,8 +286,8 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
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));
@@ -551,8 +551,8 @@ the same file name is found in the `doc-directory'. */)
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;
@@ -586,7 +586,7 @@ the same file name is found in the `doc-directory'. */)
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
@@ -633,7 +633,7 @@ the same file name is found in the `doc-directory'. */)
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;
@@ -705,16 +705,16 @@ a new string, without any text properties, is returned. */)
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;
@@ -766,7 +766,7 @@ a new string, without any text properties, is returned. */)
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;
@@ -805,7 +805,7 @@ a new string, without any text properties, is returned. */)
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);
@@ -828,7 +828,7 @@ a new string, without any text properties, is returned. */)
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;
@@ -899,7 +899,7 @@ a new string, without any text properties, is returned. */)
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);
diff --git a/src/doprnt.c b/src/doprnt.c
index 053fa183e6b..02adc51f1e5 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -54,7 +54,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
54 String arguments are passed as C strings. 54 String arguments are passed as C strings.
55 Integers are passed as C integers. */ 55 Integers are passed as C integers. */
56 56
57int 57EMACS_INT
58doprnt (char *buffer, register int bufsize, const char *format, 58doprnt (char *buffer, register int bufsize, const char *format,
59 const char *format_end, va_list ap) 59 const char *format_end, va_list ap)
60{ 60{
@@ -96,7 +96,7 @@ doprnt (char *buffer, register int bufsize, const char *format,
96 if (*fmt == '%') /* Check for a '%' character */ 96 if (*fmt == '%') /* Check for a '%' character */
97 { 97 {
98 unsigned size_bound = 0; 98 unsigned size_bound = 0;
99 int width; /* Columns occupied by STRING. */ 99 EMACS_INT width; /* Columns occupied by STRING. */
100 100
101 fmt++; 101 fmt++;
102 /* Copy this one %-spec into fmtcpy. */ 102 /* Copy this one %-spec into fmtcpy. */
diff --git a/src/lisp.h b/src/lisp.h
index 5291719bea8..17dbfab748e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2816,7 +2816,7 @@ extern void float_to_string (unsigned char *, double);
2816extern void syms_of_print (void); 2816extern void syms_of_print (void);
2817 2817
2818/* Defined in doprnt.c */ 2818/* Defined in doprnt.c */
2819extern int doprnt (char *, int, const char *, const char *, va_list); 2819extern EMACS_INT doprnt (char *, int, const char *, const char *, va_list);
2820 2820
2821/* Defined in lread.c */ 2821/* Defined in lread.c */
2822extern Lisp_Object Vafter_load_alist; 2822extern Lisp_Object Vafter_load_alist;