/[emacs]/emacs/src/alloc.c
ViewVC logotype

Diff of /emacs/src/alloc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.275 by rms, Thu Jul 11 17:44:22 2002 UTC revision 1.276 by raeburn, Mon Jul 15 00:00:35 2002 UTC
# Line 1684  Both LENGTH and INIT must be numbers.  * Line 1684  Both LENGTH and INIT must be numbers.  *
1684      {      {
1685        nbytes = XINT (length);        nbytes = XINT (length);
1686        val = make_uninit_string (nbytes);        val = make_uninit_string (nbytes);
1687        p = XSTRING (val)->data;        p = SDATA (val);
1688        end = p + XSTRING (val)->size;        end = p + SCHARS (val);
1689        while (p != end)        while (p != end)
1690          *p++ = c;          *p++ = c;
1691      }      }
# Line 1696  Both LENGTH and INIT must be numbers.  * Line 1696  Both LENGTH and INIT must be numbers.  *
1696    
1697        nbytes = len * XINT (length);        nbytes = len * XINT (length);
1698        val = make_uninit_multibyte_string (XINT (length), nbytes);        val = make_uninit_multibyte_string (XINT (length), nbytes);
1699        p = XSTRING (val)->data;        p = SDATA (val);
1700        end = p + nbytes;        end = p + nbytes;
1701        while (p != end)        while (p != end)
1702          {          {
# Line 1783  make_unibyte_string (contents, length) Line 1783  make_unibyte_string (contents, length)
1783  {  {
1784    register Lisp_Object val;    register Lisp_Object val;
1785    val = make_uninit_string (length);    val = make_uninit_string (length);
1786    bcopy (contents, XSTRING (val)->data, length);    bcopy (contents, SDATA (val), length);
1787    SET_STRING_BYTES (XSTRING (val), -1);    STRING_SET_UNIBYTE (val);
1788    return val;    return val;
1789  }  }
1790    
# Line 1799  make_multibyte_string (contents, nchars, Line 1799  make_multibyte_string (contents, nchars,
1799  {  {
1800    register Lisp_Object val;    register Lisp_Object val;
1801    val = make_uninit_multibyte_string (nchars, nbytes);    val = make_uninit_multibyte_string (nchars, nbytes);
1802    bcopy (contents, XSTRING (val)->data, nbytes);    bcopy (contents, SDATA (val), nbytes);
1803    return val;    return val;
1804  }  }
1805    
# Line 1814  make_string_from_bytes (contents, nchars Line 1814  make_string_from_bytes (contents, nchars
1814  {  {
1815    register Lisp_Object val;    register Lisp_Object val;
1816    val = make_uninit_multibyte_string (nchars, nbytes);    val = make_uninit_multibyte_string (nchars, nbytes);
1817    bcopy (contents, XSTRING (val)->data, nbytes);    bcopy (contents, SDATA (val), nbytes);
1818    if (STRING_BYTES (XSTRING (val)) == XSTRING (val)->size)    if (SBYTES (val) == SCHARS (val))
1819      SET_STRING_BYTES (XSTRING (val), -1);      STRING_SET_UNIBYTE (val);
1820    return val;    return val;
1821  }  }
1822    
# Line 1833  make_specified_string (contents, nchars, Line 1833  make_specified_string (contents, nchars,
1833  {  {
1834    register Lisp_Object val;    register Lisp_Object val;
1835    val = make_uninit_multibyte_string (nchars, nbytes);    val = make_uninit_multibyte_string (nchars, nbytes);
1836    bcopy (contents, XSTRING (val)->data, nbytes);    bcopy (contents, SDATA (val), nbytes);
1837    if (!multibyte)    if (!multibyte)
1838      SET_STRING_BYTES (XSTRING (val), -1);      STRING_SET_UNIBYTE (val);
1839    return val;    return val;
1840  }  }
1841    
# Line 1860  make_uninit_string (length) Line 1860  make_uninit_string (length)
1860  {  {
1861    Lisp_Object val;    Lisp_Object val;
1862    val = make_uninit_multibyte_string (length, length);    val = make_uninit_multibyte_string (length, length);
1863    SET_STRING_BYTES (XSTRING (val), -1);    STRING_SET_UNIBYTE (val);
1864    return val;    return val;
1865  }  }
1866    
# Line 2701  make_event_array (nargs, args) Line 2701  make_event_array (nargs, args)
2701      result = Fmake_string (make_number (nargs), make_number (0));      result = Fmake_string (make_number (nargs), make_number (0));
2702      for (i = 0; i < nargs; i++)      for (i = 0; i < nargs; i++)
2703        {        {
2704          XSTRING (result)->data[i] = XINT (args[i]);          SREF (result, i) = XINT (args[i]);
2705          /* Move the meta bit to the right place for a string char.  */          /* Move the meta bit to the right place for a string char.  */
2706          if (XINT (args[i]) & CHAR_META)          if (XINT (args[i]) & CHAR_META)
2707            XSTRING (result)->data[i] |= 0x80;            SREF (result, i) |= 0x80;
2708        }        }
2709            
2710      return result;      return result;
# Line 3955  Does not copy symbols.  Copies strings w Line 3955  Does not copy symbols.  Copies strings w
3955    else if (FLOATP (obj))    else if (FLOATP (obj))
3956      return make_pure_float (XFLOAT_DATA (obj));      return make_pure_float (XFLOAT_DATA (obj));
3957    else if (STRINGP (obj))    else if (STRINGP (obj))
3958      return make_pure_string (XSTRING (obj)->data, XSTRING (obj)->size,      return make_pure_string (SDATA (obj), SCHARS (obj),
3959                               STRING_BYTES (XSTRING (obj)),                               SBYTES (obj),
3960                               STRING_MULTIBYTE (obj));                               STRING_MULTIBYTE (obj));
3961    else if (COMPILEDP (obj) || VECTORP (obj))    else if (COMPILEDP (obj) || VECTORP (obj))
3962      {      {
# Line 4700  mark_object (argptr) Line 4700  mark_object (argptr)
4700    
4701          if (!PURE_POINTER_P (XSTRING (ptr->xname)))          if (!PURE_POINTER_P (XSTRING (ptr->xname)))
4702            MARK_STRING (XSTRING (ptr->xname));            MARK_STRING (XSTRING (ptr->xname));
4703          MARK_INTERVAL_TREE (XSTRING (ptr->xname)->intervals);          MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->xname));
4704                    
4705          /* Note that we do not mark the obarray of the symbol.          /* Note that we do not mark the obarray of the symbol.
4706             It is safe not to do so because nothing accesses that             It is safe not to do so because nothing accesses that

Legend:
Removed from v.1.275  
changed lines
  Added in v.1.276

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26