aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorKen Raeburn2002-07-15 00:01:34 +0000
committerKen Raeburn2002-07-15 00:01:34 +0000
commitd5db40779d7505244d37476b4f046641f07eea2b (patch)
tree5c8bf4dad41639287e722cb7cbdc0709e47a9e53 /src/alloc.c
parent491c2516d32fa8b9ba9422ec142c8925dd82af00 (diff)
downloademacs-d5db40779d7505244d37476b4f046641f07eea2b.tar.gz
emacs-d5db40779d7505244d37476b4f046641f07eea2b.zip
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
SCHARS, SBYTES, STRING_INTERVALS, SREF, SDATA; explicit size_byte references left unchanged for now.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 5bb636b549c..80b63345459 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1684,8 +1684,8 @@ Both LENGTH and INIT must be numbers. */)
1684 { 1684 {
1685 nbytes = XINT (length); 1685 nbytes = XINT (length);
1686 val = make_uninit_string (nbytes); 1686 val = make_uninit_string (nbytes);
1687 p = XSTRING (val)->data; 1687 p = SDATA (val);
1688 end = p + XSTRING (val)->size; 1688 end = p + SCHARS (val);
1689 while (p != end) 1689 while (p != end)
1690 *p++ = c; 1690 *p++ = c;
1691 } 1691 }
@@ -1696,7 +1696,7 @@ Both LENGTH and INIT must be numbers. */)
1696 1696
1697 nbytes = len * XINT (length); 1697 nbytes = len * XINT (length);
1698 val = make_uninit_multibyte_string (XINT (length), nbytes); 1698 val = make_uninit_multibyte_string (XINT (length), nbytes);
1699 p = XSTRING (val)->data; 1699 p = SDATA (val);
1700 end = p + nbytes; 1700 end = p + nbytes;
1701 while (p != end) 1701 while (p != end)
1702 { 1702 {
@@ -1783,8 +1783,8 @@ make_unibyte_string (contents, length)
1783{ 1783{
1784 register Lisp_Object val; 1784 register Lisp_Object val;
1785 val = make_uninit_string (length); 1785 val = make_uninit_string (length);
1786 bcopy (contents, XSTRING (val)->data, length); 1786 bcopy (contents, SDATA (val), length);
1787 SET_STRING_BYTES (XSTRING (val), -1); 1787 STRING_SET_UNIBYTE (val);
1788 return val; 1788 return val;
1789} 1789}
1790 1790
@@ -1799,7 +1799,7 @@ make_multibyte_string (contents, nchars, nbytes)
1799{ 1799{
1800 register Lisp_Object val; 1800 register Lisp_Object val;
1801 val = make_uninit_multibyte_string (nchars, nbytes); 1801 val = make_uninit_multibyte_string (nchars, nbytes);
1802 bcopy (contents, XSTRING (val)->data, nbytes); 1802 bcopy (contents, SDATA (val), nbytes);
1803 return val; 1803 return val;
1804} 1804}
1805 1805
@@ -1814,9 +1814,9 @@ make_string_from_bytes (contents, nchars, nbytes)
1814{ 1814{
1815 register Lisp_Object val; 1815 register Lisp_Object val;
1816 val = make_uninit_multibyte_string (nchars, nbytes); 1816 val = make_uninit_multibyte_string (nchars, nbytes);
1817 bcopy (contents, XSTRING (val)->data, nbytes); 1817 bcopy (contents, SDATA (val), nbytes);
1818 if (STRING_BYTES (XSTRING (val)) == XSTRING (val)->size) 1818 if (SBYTES (val) == SCHARS (val))
1819 SET_STRING_BYTES (XSTRING (val), -1); 1819 STRING_SET_UNIBYTE (val);
1820 return val; 1820 return val;
1821} 1821}
1822 1822
@@ -1833,9 +1833,9 @@ make_specified_string (contents, nchars, nbytes, multibyte)
1833{ 1833{
1834 register Lisp_Object val; 1834 register Lisp_Object val;
1835 val = make_uninit_multibyte_string (nchars, nbytes); 1835 val = make_uninit_multibyte_string (nchars, nbytes);
1836 bcopy (contents, XSTRING (val)->data, nbytes); 1836 bcopy (contents, SDATA (val), nbytes);
1837 if (!multibyte) 1837 if (!multibyte)
1838 SET_STRING_BYTES (XSTRING (val), -1); 1838 STRING_SET_UNIBYTE (val);
1839 return val; 1839 return val;
1840} 1840}
1841 1841
@@ -1860,7 +1860,7 @@ make_uninit_string (length)
1860{ 1860{
1861 Lisp_Object val; 1861 Lisp_Object val;
1862 val = make_uninit_multibyte_string (length, length); 1862 val = make_uninit_multibyte_string (length, length);
1863 SET_STRING_BYTES (XSTRING (val), -1); 1863 STRING_SET_UNIBYTE (val);
1864 return val; 1864 return val;
1865} 1865}
1866 1866
@@ -2701,10 +2701,10 @@ make_event_array (nargs, args)
2701 result = Fmake_string (make_number (nargs), make_number (0)); 2701 result = Fmake_string (make_number (nargs), make_number (0));
2702 for (i = 0; i < nargs; i++) 2702 for (i = 0; i < nargs; i++)
2703 { 2703 {
2704 XSTRING (result)->data[i] = XINT (args[i]); 2704 SREF (result, i) = XINT (args[i]);
2705 /* Move the meta bit to the right place for a string char. */ 2705 /* Move the meta bit to the right place for a string char. */
2706 if (XINT (args[i]) & CHAR_META) 2706 if (XINT (args[i]) & CHAR_META)
2707 XSTRING (result)->data[i] |= 0x80; 2707 SREF (result, i) |= 0x80;
2708 } 2708 }
2709 2709
2710 return result; 2710 return result;
@@ -3955,8 +3955,8 @@ Does not copy symbols. Copies strings without text properties. */)
3955 else if (FLOATP (obj)) 3955 else if (FLOATP (obj))
3956 return make_pure_float (XFLOAT_DATA (obj)); 3956 return make_pure_float (XFLOAT_DATA (obj));
3957 else if (STRINGP (obj)) 3957 else if (STRINGP (obj))
3958 return make_pure_string (XSTRING (obj)->data, XSTRING (obj)->size, 3958 return make_pure_string (SDATA (obj), SCHARS (obj),
3959 STRING_BYTES (XSTRING (obj)), 3959 SBYTES (obj),
3960 STRING_MULTIBYTE (obj)); 3960 STRING_MULTIBYTE (obj));
3961 else if (COMPILEDP (obj) || VECTORP (obj)) 3961 else if (COMPILEDP (obj) || VECTORP (obj))
3962 { 3962 {
@@ -4700,7 +4700,7 @@ mark_object (argptr)
4700 4700
4701 if (!PURE_POINTER_P (XSTRING (ptr->xname))) 4701 if (!PURE_POINTER_P (XSTRING (ptr->xname)))
4702 MARK_STRING (XSTRING (ptr->xname)); 4702 MARK_STRING (XSTRING (ptr->xname));
4703 MARK_INTERVAL_TREE (XSTRING (ptr->xname)->intervals); 4703 MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->xname));
4704 4704
4705 /* Note that we do not mark the obarray of the symbol. 4705 /* Note that we do not mark the obarray of the symbol.
4706 It is safe not to do so because nothing accesses that 4706 It is safe not to do so because nothing accesses that