mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-22 10:26:20 +00:00
(Fstring_to_char): Use string macros instead of Lisp_String fields.
This commit is contained in:
parent
9f5348e3c8
commit
4e491f8d1e
@ -194,15 +194,13 @@ A multibyte character is handled correctly. */)
|
||||
register Lisp_Object string;
|
||||
{
|
||||
register Lisp_Object val;
|
||||
register struct Lisp_String *p;
|
||||
CHECK_STRING (string);
|
||||
p = XSTRING (string);
|
||||
if (p->size)
|
||||
if (SCHARS (string))
|
||||
{
|
||||
if (STRING_MULTIBYTE (string))
|
||||
XSETFASTINT (val, STRING_CHAR (p->data, STRING_BYTES (p)));
|
||||
XSETFASTINT (val, STRING_CHAR (SDATA (string), SBYTES (string)));
|
||||
else
|
||||
XSETFASTINT (val, p->data[0]);
|
||||
XSETFASTINT (val, SREF (string, 0));
|
||||
}
|
||||
else
|
||||
XSETFASTINT (val, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user