Clean up EMACS_INT/int usage in doc.c and doprnt.c.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 23 Sep 2010 19:53:46 +0000 (21:53 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 23 Sep 2010 19:53:46 +0000 (21:53 +0200)
src/ChangeLog
src/doc.c
src/doprnt.c
src/lisp.h

index c8ea550..b50e07c 100644 (file)
@@ -8,6 +8,13 @@
 
 2010-09-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * lisp.h: doprnt.c EMACS_INT/int cleanup.
+
+       * doprnt.c (doprnt): EMACS_INT/int cleanup.
+
+       * doc.c (Fsnarf_documentation, get_doc_string): EMACS_INT/int
+       cleanup.
+
        * lisp.h: Change the definition of all marker.c functions that
        take and return buffer stuff to be EMACS_INT instead of int.
 
index 36f7c0e..8d5727b 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -99,8 +99,8 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
   register int fd;
   register char *name;
   register char *p, *p1;
-  int minsize;
-  int offset, position;
+  EMACS_INT minsize;
+  EMACS_INT offset, position;
   Lisp_Object file, tem;
 
   if (INTEGERP (filepos))
@@ -179,14 +179,14 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
   p = get_doc_string_buffer;
   while (1)
     {
-      int space_left = (get_doc_string_buffer_size
-                       - (p - get_doc_string_buffer));
+      EMACS_INT space_left = (get_doc_string_buffer_size
+                             - (p - get_doc_string_buffer));
       int nread;
 
       /* Allocate or grow the buffer if we need to.  */
       if (space_left == 0)
        {
-         int in_buffer = p - get_doc_string_buffer;
+         EMACS_INT in_buffer = p - get_doc_string_buffer;
          get_doc_string_buffer_size += 16 * 1024;
          get_doc_string_buffer
            = (char *) xrealloc (get_doc_string_buffer,
@@ -286,8 +286,8 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
   else
     {
       /* The data determines whether the string is multibyte.  */
-      int nchars = multibyte_chars_in_text (get_doc_string_buffer + offset,
-                                           to - (get_doc_string_buffer + offset));
+      EMACS_INT nchars = multibyte_chars_in_text (get_doc_string_buffer + offset,
+                                                 to - (get_doc_string_buffer + offset));
       return make_string_from_bytes (get_doc_string_buffer + offset,
                                     nchars,
                                     to - (get_doc_string_buffer + offset));
@@ -551,8 +551,8 @@ the same file name is found in the `doc-directory'.  */)
 {
   int fd;
   char buf[1024 + 1];
-  register int filled;
-  register int pos;
+  register EMACS_INT filled;
+  register EMACS_INT pos;
   register char *p, *end;
   Lisp_Object sym;
   char *name;
@@ -586,7 +586,7 @@ the same file name is found in the `doc-directory'.  */)
 
     for (beg = buildobj; *beg; beg = end)
       {
-        int len;
+        EMACS_INT len;
 
         while (*beg && isspace (*beg)) ++beg;
 
@@ -633,7 +633,7 @@ the same file name is found in the `doc-directory'.  */)
               if (end - p > 4 && end[-2] == '.'
                   && (end[-1] == 'o' || end[-1] == 'c'))
                 {
-                  int len = end - p - 2;
+                  EMACS_INT len = end - p - 2;
                   char *fromfile = alloca (len + 1);
                   strncpy (fromfile, &p[2], len);
                   fromfile[len] = 0;
@@ -705,16 +705,16 @@ a new string, without any text properties, is returned.  */)
   int changed = 0;
   register unsigned char *strp;
   register unsigned char *bufp;
-  int idx;
-  int bsize;
+  EMACS_INT idx;
+  EMACS_INT bsize;
   Lisp_Object tem;
   Lisp_Object keymap;
   unsigned char *start;
-  int length, length_byte;
+  EMACS_INT length, length_byte;
   Lisp_Object name;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
   int multibyte;
-  int nchars;
+  EMACS_INT nchars;
 
   if (NILP (string))
     return Qnil;
@@ -766,7 +766,7 @@ a new string, without any text properties, is returned.  */)
        }
       else if (strp[0] == '\\' && strp[1] == '[')
        {
-         int start_idx;
+         EMACS_INT start_idx;
          int follow_remap = 1;
 
          changed = 1;
@@ -805,7 +805,7 @@ a new string, without any text properties, is returned.  */)
 
          if (NILP (tem))       /* but not on any keys */
            {
-             int offset = bufp - buf;
+             EMACS_INT offset = bufp - buf;
              buf = (unsigned char *) xrealloc (buf, bsize += 4);
              bufp = buf + offset;
              memcpy (bufp, "M-x ", 4);
@@ -828,7 +828,7 @@ a new string, without any text properties, is returned.  */)
       else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<'))
        {
          struct buffer *oldbuf;
-         int start_idx;
+         EMACS_INT start_idx;
          /* This is for computing the SHADOWS arg for describe_map_tree.  */
          Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil);
          Lisp_Object earlier_maps;
@@ -899,7 +899,7 @@ a new string, without any text properties, is returned.  */)
          length_byte = SBYTES (tem);
        subst:
          {
-           int offset = bufp - buf;
+           EMACS_INT offset = bufp - buf;
            buf = (unsigned char *) xrealloc (buf, bsize += length_byte);
            bufp = buf + offset;
            memcpy (bufp, start, length_byte);
index 053fa18..02adc51 100644 (file)
@@ -54,7 +54,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    String arguments are passed as C strings.
    Integers are passed as C integers.  */
 
-int
+EMACS_INT
 doprnt (char *buffer, register int bufsize, const char *format,
        const char *format_end, va_list ap)
 {
@@ -96,7 +96,7 @@ doprnt (char *buffer, register int bufsize, const char *format,
       if (*fmt == '%') /* Check for a '%' character */
        {
          unsigned size_bound = 0;
-         int width;            /* Columns occupied by STRING.  */
+         EMACS_INT width;  /* Columns occupied by STRING.  */
 
          fmt++;
          /* Copy this one %-spec into fmtcpy.  */
index 5291719..17dbfab 100644 (file)
@@ -2816,7 +2816,7 @@ extern void float_to_string (unsigned char *, double);
 extern void syms_of_print (void);
 
 /* Defined in doprnt.c */
-extern int doprnt (char *, int, const char *, const char *, va_list);
+extern EMACS_INT doprnt (char *, int, const char *, const char *, va_list);
 
 /* Defined in lread.c */
 extern Lisp_Object Vafter_load_alist;