emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/alloc.c


From: Ken Raeburn
Subject: [Emacs-diffs] Changes to emacs/src/alloc.c
Date: Sun, 14 Jul 2002 20:00:41 -0400

Index: emacs/src/alloc.c
diff -c emacs/src/alloc.c:1.275 emacs/src/alloc.c:1.276
*** emacs/src/alloc.c:1.275     Thu Jul 11 13:44:22 2002
--- emacs/src/alloc.c   Sun Jul 14 20:00:35 2002
***************
*** 1684,1691 ****
      {
        nbytes = XINT (length);
        val = make_uninit_string (nbytes);
!       p = XSTRING (val)->data;
!       end = p + XSTRING (val)->size;
        while (p != end)
        *p++ = c;
      }
--- 1684,1691 ----
      {
        nbytes = XINT (length);
        val = make_uninit_string (nbytes);
!       p = SDATA (val);
!       end = p + SCHARS (val);
        while (p != end)
        *p++ = c;
      }
***************
*** 1696,1702 ****
  
        nbytes = len * XINT (length);
        val = make_uninit_multibyte_string (XINT (length), nbytes);
!       p = XSTRING (val)->data;
        end = p + nbytes;
        while (p != end)
        {
--- 1696,1702 ----
  
        nbytes = len * XINT (length);
        val = make_uninit_multibyte_string (XINT (length), nbytes);
!       p = SDATA (val);
        end = p + nbytes;
        while (p != end)
        {
***************
*** 1783,1790 ****
  {
    register Lisp_Object val;
    val = make_uninit_string (length);
!   bcopy (contents, XSTRING (val)->data, length);
!   SET_STRING_BYTES (XSTRING (val), -1);
    return val;
  }
  
--- 1783,1790 ----
  {
    register Lisp_Object val;
    val = make_uninit_string (length);
!   bcopy (contents, SDATA (val), length);
!   STRING_SET_UNIBYTE (val);
    return val;
  }
  
***************
*** 1799,1805 ****
  {
    register Lisp_Object val;
    val = make_uninit_multibyte_string (nchars, nbytes);
!   bcopy (contents, XSTRING (val)->data, nbytes);
    return val;
  }
  
--- 1799,1805 ----
  {
    register Lisp_Object val;
    val = make_uninit_multibyte_string (nchars, nbytes);
!   bcopy (contents, SDATA (val), nbytes);
    return val;
  }
  
***************
*** 1814,1822 ****
  {
    register Lisp_Object val;
    val = make_uninit_multibyte_string (nchars, nbytes);
!   bcopy (contents, XSTRING (val)->data, nbytes);
!   if (STRING_BYTES (XSTRING (val)) == XSTRING (val)->size)
!     SET_STRING_BYTES (XSTRING (val), -1);
    return val;
  }
  
--- 1814,1822 ----
  {
    register Lisp_Object val;
    val = make_uninit_multibyte_string (nchars, nbytes);
!   bcopy (contents, SDATA (val), nbytes);
!   if (SBYTES (val) == SCHARS (val))
!     STRING_SET_UNIBYTE (val);
    return val;
  }
  
***************
*** 1833,1841 ****
  {
    register Lisp_Object val;
    val = make_uninit_multibyte_string (nchars, nbytes);
!   bcopy (contents, XSTRING (val)->data, nbytes);
    if (!multibyte)
!     SET_STRING_BYTES (XSTRING (val), -1);
    return val;
  }
  
--- 1833,1841 ----
  {
    register Lisp_Object val;
    val = make_uninit_multibyte_string (nchars, nbytes);
!   bcopy (contents, SDATA (val), nbytes);
    if (!multibyte)
!     STRING_SET_UNIBYTE (val);
    return val;
  }
  
***************
*** 1860,1866 ****
  {
    Lisp_Object val;
    val = make_uninit_multibyte_string (length, length);
!   SET_STRING_BYTES (XSTRING (val), -1);
    return val;
  }
  
--- 1860,1866 ----
  {
    Lisp_Object val;
    val = make_uninit_multibyte_string (length, length);
!   STRING_SET_UNIBYTE (val);
    return val;
  }
  
***************
*** 2701,2710 ****
      result = Fmake_string (make_number (nargs), make_number (0));
      for (i = 0; i < nargs; i++)
        {
!       XSTRING (result)->data[i] = XINT (args[i]);
        /* Move the meta bit to the right place for a string char.  */
        if (XINT (args[i]) & CHAR_META)
!         XSTRING (result)->data[i] |= 0x80;
        }
      
      return result;
--- 2701,2710 ----
      result = Fmake_string (make_number (nargs), make_number (0));
      for (i = 0; i < nargs; i++)
        {
!       SREF (result, i) = XINT (args[i]);
        /* Move the meta bit to the right place for a string char.  */
        if (XINT (args[i]) & CHAR_META)
!         SREF (result, i) |= 0x80;
        }
      
      return result;
***************
*** 3955,3962 ****
    else if (FLOATP (obj))
      return make_pure_float (XFLOAT_DATA (obj));
    else if (STRINGP (obj))
!     return make_pure_string (XSTRING (obj)->data, XSTRING (obj)->size,
!                            STRING_BYTES (XSTRING (obj)),
                             STRING_MULTIBYTE (obj));
    else if (COMPILEDP (obj) || VECTORP (obj))
      {
--- 3955,3962 ----
    else if (FLOATP (obj))
      return make_pure_float (XFLOAT_DATA (obj));
    else if (STRINGP (obj))
!     return make_pure_string (SDATA (obj), SCHARS (obj),
!                            SBYTES (obj),
                             STRING_MULTIBYTE (obj));
    else if (COMPILEDP (obj) || VECTORP (obj))
      {
***************
*** 4700,4706 ****
  
        if (!PURE_POINTER_P (XSTRING (ptr->xname)))
          MARK_STRING (XSTRING (ptr->xname));
!       MARK_INTERVAL_TREE (XSTRING (ptr->xname)->intervals);
        
        /* Note that we do not mark the obarray of the symbol.
           It is safe not to do so because nothing accesses that
--- 4700,4706 ----
  
        if (!PURE_POINTER_P (XSTRING (ptr->xname)))
          MARK_STRING (XSTRING (ptr->xname));
!       MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->xname));
        
        /* Note that we do not mark the obarray of the symbol.
           It is safe not to do so because nothing accesses that



reply via email to

[Prev in Thread] Current Thread [Next in Thread]