* buffer.c (struct sortstr.size, record_overlay_string): Don't truncate size to int.
[bpt/emacs.git] / src / print.c
index 2c9aa9d..d07f897 100644 (file)
@@ -381,7 +381,7 @@ print_string (Lisp_Object string, Lisp_Object printcharfun)
          EMACS_INT bytes;
 
          chars = SBYTES (string);
-         bytes = parse_str_to_multibyte (SDATA (string), chars);
+         bytes = count_size_as_multibyte (SDATA (string), chars);
          if (chars < bytes)
            {
              newstr = make_uninit_multibyte_string (chars, bytes);
@@ -1082,7 +1082,7 @@ print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag)
             Maybe a better way to do that is to copy elements to
             a new hash table.  */
          struct Lisp_Hash_Table *h = XHASH_TABLE (Vprint_number_table);
-         int i;
+         EMACS_INT i;
 
          for (i = 0; i < HASH_TABLE_SIZE (h); ++i)
            if (!NILP (HASH_HASH (h, i))
@@ -1198,7 +1198,7 @@ print_preprocess (Lisp_Object obj)
          goto loop;
 
        case Lisp_Vectorlike:
-         size = XVECTOR (obj)->size;
+         size = ASIZE (obj);
          if (size & PSEUDOVECTOR_FLAG)
            size &= PSEUDOVECTOR_SIZE_MASK;
          for (i = 0; i < size; i++)
@@ -1786,7 +1786,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
              strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun);
              PRINTCHAR (' ');
              sprintf (buf, "%ld/%ld", (long) h->count,
-                      (long) XVECTOR (h->next)->size);
+                      (long) ASIZE (h->next));
              strout (buf, -1, -1, printcharfun);
            }
          sprintf (buf, " 0x%lx", (unsigned long) h);
@@ -1797,7 +1797,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
            #s(hash-table size 2 test equal data (k1 v1 k2 v2)) */
          /* Always print the size. */
          sprintf (buf, "#s(hash-table size %ld",
-                  (long) XVECTOR (h->next)->size);
+                  (long) ASIZE (h->next));
          strout (buf, -1, -1, printcharfun);
 
          if (!NILP (h->test))
@@ -1909,7 +1909,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
        }
       else
        {
-         EMACS_INT size = XVECTOR (obj)->size;
+         EMACS_INT size = ASIZE (obj);
          if (COMPILEDP (obj))
            {
              PRINTCHAR ('#');
@@ -2004,7 +2004,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
 
        case Lisp_Misc_Save_Value:
          strout ("#<save_value ", -1, -1, printcharfun);
-         sprintf(buf, "ptr=%p int=%d",
+         sprintf(buf, "ptr=%p int=%"pD"d",
                  XSAVE_VALUE (obj)->pointer,
                  XSAVE_VALUE (obj)->integer);
          strout (buf, -1, -1, printcharfun);
@@ -2025,7 +2025,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
        if (MISCP (obj))
          sprintf (buf, "(MISC 0x%04x)", (int) XMISCTYPE (obj));
        else if (VECTORLIKEP (obj))
-         sprintf (buf, "(PVEC 0x%08lx)", (unsigned long) XVECTOR (obj)->size);
+         sprintf (buf, "(PVEC 0x%08lx)", (unsigned long) ASIZE (obj));
        else
          sprintf (buf, "(0x%02x)", (int) XTYPE (obj));
        strout (buf, -1, -1, printcharfun);