Mercurial > emacs
changeset 46370:40db0673e6f0
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.
line wrap: on
line diff
--- a/src/abbrev.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/abbrev.c Mon Jul 15 00:00:41 2002 +0000 @@ -344,8 +344,8 @@ del_range_both (wordstart, wordstart_byte, wordend, wordend_byte, 1); - insert_from_string (expansion, 0, 0, XSTRING (expansion)->size, - STRING_BYTES (XSTRING (expansion)), 1); + insert_from_string (expansion, 0, 0, SCHARS (expansion), + SBYTES (expansion), 1); SET_PT (PT + whitecnt); if (uccount && !lccount) @@ -427,11 +427,11 @@ if (!STRINGP (val)) error ("value of abbrev-symbol must be a string"); zv_before = ZV; - del_range_byte (PT_BYTE, PT_BYTE + STRING_BYTES (XSTRING (val)), 1); + del_range_byte (PT_BYTE, PT_BYTE + SBYTES (val), 1); /* Don't inherit properties here; just copy from old contents. */ insert_from_string (Vlast_abbrev_text, 0, 0, - XSTRING (Vlast_abbrev_text)->size, - STRING_BYTES (XSTRING (Vlast_abbrev_text)), 0); + SCHARS (Vlast_abbrev_text), + SBYTES (Vlast_abbrev_text), 0); Vlast_abbrev_text = Qnil; /* Total number of characters deleted. */ adjust = ZV - zv_before;
--- a/src/alloc.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/alloc.c Mon Jul 15 00:00:41 2002 +0000 @@ -1684,8 +1684,8 @@ { nbytes = XINT (length); val = make_uninit_string (nbytes); - p = XSTRING (val)->data; - end = p + XSTRING (val)->size; + p = SDATA (val); + end = p + SCHARS (val); while (p != end) *p++ = c; } @@ -1696,7 +1696,7 @@ nbytes = len * XINT (length); val = make_uninit_multibyte_string (XINT (length), nbytes); - p = XSTRING (val)->data; + p = SDATA (val); end = p + nbytes; while (p != end) { @@ -1783,8 +1783,8 @@ { register Lisp_Object val; val = make_uninit_string (length); - bcopy (contents, XSTRING (val)->data, length); - SET_STRING_BYTES (XSTRING (val), -1); + bcopy (contents, SDATA (val), length); + STRING_SET_UNIBYTE (val); return val; } @@ -1799,7 +1799,7 @@ { register Lisp_Object val; val = make_uninit_multibyte_string (nchars, nbytes); - bcopy (contents, XSTRING (val)->data, nbytes); + bcopy (contents, SDATA (val), nbytes); return val; } @@ -1814,9 +1814,9 @@ { 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); + bcopy (contents, SDATA (val), nbytes); + if (SBYTES (val) == SCHARS (val)) + STRING_SET_UNIBYTE (val); return val; } @@ -1833,9 +1833,9 @@ { register Lisp_Object val; val = make_uninit_multibyte_string (nchars, nbytes); - bcopy (contents, XSTRING (val)->data, nbytes); + bcopy (contents, SDATA (val), nbytes); if (!multibyte) - SET_STRING_BYTES (XSTRING (val), -1); + STRING_SET_UNIBYTE (val); return val; } @@ -1860,7 +1860,7 @@ { Lisp_Object val; val = make_uninit_multibyte_string (length, length); - SET_STRING_BYTES (XSTRING (val), -1); + STRING_SET_UNIBYTE (val); return val; } @@ -2701,10 +2701,10 @@ result = Fmake_string (make_number (nargs), make_number (0)); for (i = 0; i < nargs; i++) { - XSTRING (result)->data[i] = XINT (args[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) - XSTRING (result)->data[i] |= 0x80; + SREF (result, i) |= 0x80; } return result; @@ -3955,8 +3955,8 @@ 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)), + return make_pure_string (SDATA (obj), SCHARS (obj), + SBYTES (obj), STRING_MULTIBYTE (obj)); else if (COMPILEDP (obj) || VECTORP (obj)) { @@ -4700,7 +4700,7 @@ if (!PURE_POINTER_P (XSTRING (ptr->xname))) MARK_STRING (XSTRING (ptr->xname)); - MARK_INTERVAL_TREE (XSTRING (ptr->xname)->intervals); + 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
--- a/src/buffer.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/buffer.c Mon Jul 15 00:00:41 2002 +0000 @@ -193,7 +193,7 @@ Lisp_Object spec; { if (STRINGP (spec)) - error ("No buffer named %s", XSTRING (spec)->data); + error ("No buffer named %s", SDATA (spec)); error ("Invalid buffer argument"); } @@ -341,7 +341,7 @@ if (!NILP (buf)) return buf; - if (XSTRING (name)->size == 0) + if (SCHARS (name) == 0) error ("Empty string for buffer name is not allowed"); b = (struct buffer *) allocate_buffer (); @@ -397,10 +397,10 @@ b->zv_marker = Qnil; name = Fcopy_sequence (name); - XSTRING (name)->intervals = NULL_INTERVAL; + STRING_INTERVALS (name) = NULL_INTERVAL; b->name = name; - if (XSTRING (name)->data[0] != ' ') + if (SREF (name, 0) != ' ') b->undo_list = Qnil; else b->undo_list = Qt; @@ -520,13 +520,13 @@ buf = Fget_buffer (name); if (!NILP (buf)) - error ("Buffer name `%s' is in use", XSTRING (name)->data); + error ("Buffer name `%s' is in use", SDATA (name)); base_buffer = Fget_buffer (base_buffer); if (NILP (base_buffer)) - error ("No such buffer: `%s'", XSTRING (name)->data); - - if (XSTRING (name)->size == 0) + error ("No such buffer: `%s'", SDATA (name)); + + if (SCHARS (name) == 0) error ("Empty string for buffer name is not allowed"); b = (struct buffer *) allocate_buffer (); @@ -556,7 +556,7 @@ all_buffers = b; name = Fcopy_sequence (name); - XSTRING (name)->intervals = NULL_INTERVAL; + STRING_INTERVALS (name) = NULL_INTERVAL; b->name = name; reset_buffer (b); @@ -1091,7 +1091,7 @@ CHECK_STRING (newname); - if (XSTRING (newname)->size == 0) + if (SCHARS (newname) == 0) error ("Empty string is invalid as a buffer name"); tem = Fget_buffer (newname); @@ -1106,7 +1106,7 @@ if (!NILP (unique)) newname = Fgenerate_new_buffer_name (newname, current_buffer->name); else - error ("Buffer name `%s' is in use", XSTRING (newname)->data); + error ("Buffer name `%s' is in use", SDATA (newname)); } current_buffer->name = newname; @@ -1163,7 +1163,7 @@ buf = Fcdr (Fcar (tail)); if (EQ (buf, buffer)) continue; - if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') + if (SDATA (XBUFFER (buf)->name)[0] == ' ') continue; /* If the selected frame has a buffer_predicate, disregard buffers that don't fit the predicate. */ @@ -1289,7 +1289,7 @@ { GCPRO1 (buf); tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ", - XSTRING (b->name)->data)); + SDATA (b->name))); UNGCPRO; if (NILP (tem)) return Qnil; @@ -1535,7 +1535,7 @@ Lisp_Object function; if (STRINGP (XBUFFER (buffer)->name) - && strcmp (XSTRING (XBUFFER (buffer)->name)->data, "*scratch*") == 0) + && strcmp (SDATA (XBUFFER (buffer)->name), "*scratch*") == 0) function = find_symbol_value (intern ("initial-major-mode")); else { @@ -2883,24 +2883,24 @@ ssl->used++; if (NILP (current_buffer->enable_multibyte_characters)) - nbytes = XSTRING (str)->size; + nbytes = SCHARS (str); else if (! STRING_MULTIBYTE (str)) - nbytes = count_size_as_multibyte (XSTRING (str)->data, - STRING_BYTES (XSTRING (str))); + nbytes = count_size_as_multibyte (SDATA (str), + SBYTES (str)); else - nbytes = STRING_BYTES (XSTRING (str)); + nbytes = SBYTES (str); ssl->bytes += nbytes; if (STRINGP (str2)) { if (NILP (current_buffer->enable_multibyte_characters)) - nbytes = XSTRING (str2)->size; + nbytes = SCHARS (str2); else if (! STRING_MULTIBYTE (str2)) - nbytes = count_size_as_multibyte (XSTRING (str2)->data, - STRING_BYTES (XSTRING (str2))); + nbytes = count_size_as_multibyte (SDATA (str2), + SBYTES (str2)); else - nbytes = STRING_BYTES (XSTRING (str2)); + nbytes = SBYTES (str2); ssl->bytes += nbytes; } @@ -3012,8 +3012,8 @@ { int nbytes; tem = overlay_tails.buf[i].string; - nbytes = copy_text (XSTRING (tem)->data, p, - STRING_BYTES (XSTRING (tem)), + nbytes = copy_text (SDATA (tem), p, + SBYTES (tem), STRING_MULTIBYTE (tem), multibyte); p += nbytes; } @@ -3021,15 +3021,15 @@ { int nbytes; tem = overlay_heads.buf[i].string; - nbytes = copy_text (XSTRING (tem)->data, p, - STRING_BYTES (XSTRING (tem)), + nbytes = copy_text (SDATA (tem), p, + SBYTES (tem), STRING_MULTIBYTE (tem), multibyte); p += nbytes; tem = overlay_heads.buf[i].string2; if (STRINGP (tem)) { - nbytes = copy_text (XSTRING (tem)->data, p, - STRING_BYTES (XSTRING (tem)), + nbytes = copy_text (SDATA (tem), p, + SBYTES (tem), STRING_MULTIBYTE (tem), multibyte); p += nbytes; } @@ -4282,7 +4282,7 @@ sym = PER_BUFFER_SYMBOL (offset); error ("Only %s should be stored in the buffer-local variable %s", - type_name, XSTRING (SYMBOL_NAME (sym))->data); + type_name, SDATA (SYMBOL_NAME (sym))); } @@ -5066,7 +5066,7 @@ because of the ange-ftp completion handler. However, it is not necessary to turn / into /:/. So avoid doing that. */ - && strcmp ("/", XSTRING (current_buffer->directory)->data)) + && strcmp ("/", SDATA (current_buffer->directory))) current_buffer->directory = concat2 (build_string ("/:"), current_buffer->directory);
--- a/src/bytecode.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/bytecode.c Mon Jul 15 00:00:41 2002 +0000 @@ -327,10 +327,10 @@ XUNMARK (stack->byte_string); XUNMARK (stack->constants); - if (stack->byte_string_start != XSTRING (stack->byte_string)->data) + if (stack->byte_string_start != SDATA (stack->byte_string)) { int offset = stack->pc - stack->byte_string_start; - stack->byte_string_start = XSTRING (stack->byte_string)->data; + stack->byte_string_start = SDATA (stack->byte_string); stack->pc = stack->byte_string_start + offset; } } @@ -460,11 +460,11 @@ convert them back to the originally intended unibyte form. */ bytestr = Fstring_as_unibyte (bytestr); - bytestr_length = STRING_BYTES (XSTRING (bytestr)); + bytestr_length = SBYTES (bytestr); vectorp = XVECTOR (vector)->contents; stack.byte_string = bytestr; - stack.pc = stack.byte_string_start = XSTRING (bytestr)->data; + stack.pc = stack.byte_string_start = SDATA (bytestr); stack.constants = vector; stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth) * sizeof (Lisp_Object)); @@ -896,7 +896,7 @@ case Btemp_output_buffer_setup: BEFORE_POTENTIAL_GC (); CHECK_STRING (TOP); - temp_output_buffer_setup (XSTRING (TOP)->data); + temp_output_buffer_setup (SDATA (TOP)); AFTER_POTENTIAL_GC (); TOP = Vstandard_output; break;
--- a/src/callint.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/callint.c Mon Jul 15 00:00:41 2002 +0000 @@ -288,9 +288,9 @@ { /* Make a copy of string so that if a GC relocates specs, `string' will still be valid. */ - string = (unsigned char *) alloca (STRING_BYTES (XSTRING (specs)) + 1); - bcopy (XSTRING (specs)->data, string, - STRING_BYTES (XSTRING (specs)) + 1); + string = (unsigned char *) alloca (SBYTES (specs) + 1); + bcopy (SDATA (specs), string, + SBYTES (specs) + 1); } else if (string == 0) { @@ -453,7 +453,7 @@ argstrings[j] = (EQ (visargs[j], Qnil) ? (unsigned char *) "" - : XSTRING (visargs[j])->data); + : SDATA (visargs[j])); /* Process the format-string in prompt1, putting the output into callint_message. Make callint_message bigger if necessary. @@ -599,7 +599,7 @@ if (next_event >= key_count) error ("%s must be bound to an event with parameters", (SYMBOLP (function) - ? (char *) XSTRING (SYMBOL_NAME (function))->data + ? (char *) SDATA (SYMBOL_NAME (function)) : "command")); args[i] = XVECTOR (keys)->contents[next_event++]; varies[i] = -1; @@ -644,7 +644,7 @@ tem = Fread_from_minibuffer (build_string (callint_message), Qnil, Qnil, Qnil, Qnil, Qnil, Qnil); - if (! STRINGP (tem) || XSTRING (tem)->size == 0) + if (! STRINGP (tem) || SCHARS (tem) == 0) args[i] = Qnil; else args[i] = Fread (tem);
--- a/src/callproc.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/callproc.c Mon Jul 15 00:00:41 2002 +0000 @@ -159,8 +159,8 @@ register Lisp_Object file; file = Fcdr (fdpid); emacs_close (XFASTINT (Fcar (fdpid))); - if (strcmp (XSTRING (file)-> data, NULL_DEVICE) != 0) - unlink (XSTRING (file)->data); + if (strcmp (SDATA (file), NULL_DEVICE) != 0) + unlink (SDATA (file)); #else /* not MSDOS and not MAC_OS8 */ register int pid = XFASTINT (Fcdr (fdpid)); @@ -371,7 +371,7 @@ display = nargs >= 4 ? args[3] : Qnil; - filefd = emacs_open (XSTRING (infile)->data, O_RDONLY, 0); + filefd = emacs_open (SDATA (infile), O_RDONLY, 0); if (filefd < 0) { report_file_error ("Opening process input file", Fcons (infile, Qnil)); @@ -389,7 +389,7 @@ emacs_close (filefd); report_file_error ("Searching for program", Fcons (args[0], Qnil)); } - new_argv[0] = XSTRING (path)->data; + new_argv[0] = SDATA (path); if (nargs > 4) { register int i; @@ -407,7 +407,7 @@ if (argument_coding.type == coding_type_ccl) setup_ccl_program (&(argument_coding.spec.ccl.encoder), Qnil); } - new_argv[i - 3] = XSTRING (args[i])->data; + new_argv[i - 3] = SDATA (args[i]); } UNGCPRO; new_argv[nargs - 3] = 0; @@ -443,9 +443,9 @@ #ifdef MAC_OS8 /* Since we don't have pipes on the Mac, create a temporary file to hold the output of the subprocess. */ - tempfile = (char *) alloca (STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); - bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile, - STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); + tempfile = (char *) alloca (SBYTES (Vtemp_file_name_pattern) + 1); + bcopy (SDATA (Vtemp_file_name_pattern), tempfile, + SBYTES (Vtemp_file_name_pattern) + 1); mktemp (tempfile); @@ -505,11 +505,11 @@ else if (STRINGP (error_file)) { #ifdef DOS_NT - fd_error = emacs_open (XSTRING (error_file)->data, + fd_error = emacs_open (SDATA (error_file), O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, S_IREAD | S_IWRITE); #else /* not DOS_NT */ - fd_error = creat (XSTRING (error_file)->data, 0666); + fd_error = creat (SDATA (error_file), 0666); #endif /* not DOS_NT */ } @@ -545,15 +545,15 @@ close (fd_error); fd1 = -1; /* No harm in closing that one! */ - infn = XSTRING (infile)->data; + infn = SDATA (infile); outfn = tempfile; if (NILP (error_file)) errfn = NULL_DEVICE; else if (EQ (Qt, error_file)) errfn = outfn; else - errfn = XSTRING (error_file)->data; - currdn = XSTRING (current_dir)->data; + errfn = SDATA (error_file); + currdn = SDATA (current_dir); pid = run_mac_command (new_argv, currdn, infn, outfn, errfn); /* Record that the synchronous process exited and note its @@ -1047,9 +1047,9 @@ strcat (tempfile, "detmp.XXX"); #endif #else /* not DOS_NT */ - char *tempfile = (char *) alloca (STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); - bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile, - STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); + char *tempfile = (char *) alloca (SBYTES (Vtemp_file_name_pattern) + 1); + bcopy (SDATA (Vtemp_file_name_pattern), tempfile, + SBYTES (Vtemp_file_name_pattern) + 1); #endif /* not DOS_NT */ coding_systems = Qt; @@ -1188,7 +1188,7 @@ register char *temp; register int i; - i = STRING_BYTES (XSTRING (current_dir)); + i = SBYTES (current_dir); #ifdef MSDOS /* MSDOS must have all environment variables malloc'ed, because low-level libc functions that launch subsidiary processes rely @@ -1199,7 +1199,7 @@ #endif temp = pwd_var + 4; bcopy ("PWD=", pwd_var, 4); - bcopy (XSTRING (current_dir)->data, temp, i); + bcopy (SDATA (current_dir), temp, i); if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP; temp[i] = 0; @@ -1253,7 +1253,7 @@ tem = XCDR (tem)) { char **ep = env; - char *string = (char *) XSTRING (XCAR (tem))->data; + char *string = (char *) SDATA (XCAR (tem)); /* See if this string duplicates any string already in the env. If so, don't put it in. When an env var has multiple definitions, @@ -1280,7 +1280,7 @@ } #ifdef WINDOWSNT prepare_standard_handles (in, out, err, handles); - set_process_dir (XSTRING (current_dir)->data); + set_process_dir (SDATA (current_dir)); #else /* not WINDOWSNT */ /* Make sure that in, out, and err are not actually already in descriptors zero, one, or two; this could happen if Emacs is @@ -1405,18 +1405,18 @@ entry = XCAR (scan); if (STRINGP (entry) - && STRING_BYTES (XSTRING (entry)) > varlen - && XSTRING (entry)->data[varlen] == '=' + && SBYTES (entry) > varlen + && SREF (entry, varlen) == '=' #ifdef WINDOWSNT /* NT environment variables are case insensitive. */ - && ! strnicmp (XSTRING (entry)->data, var, varlen) + && ! strnicmp (SDATA (entry), var, varlen) #else /* not WINDOWSNT */ - && ! bcmp (XSTRING (entry)->data, var, varlen) + && ! bcmp (SDATA (entry), var, varlen) #endif /* not WINDOWSNT */ ) { - *value = (char *) XSTRING (entry)->data + (varlen + 1); - *valuelen = STRING_BYTES (XSTRING (entry)) - (varlen + 1); + *value = (char *) SDATA (entry) + (varlen + 1); + *valuelen = SBYTES (entry) - (varlen + 1); return 1; } } @@ -1435,7 +1435,7 @@ int valuelen; CHECK_STRING (var); - if (getenv_internal (XSTRING (var)->data, STRING_BYTES (XSTRING (var)), + if (getenv_internal (SDATA (var), SBYTES (var), &value, &valuelen)) return make_string (value, valuelen); else @@ -1550,13 +1550,13 @@ #endif { tempdir = Fdirectory_file_name (Vexec_directory); - if (access (XSTRING (tempdir)->data, 0) < 0) + if (access (SDATA (tempdir), 0) < 0) dir_warning ("Warning: arch-dependent data dir (%s) does not exist.\n", Vexec_directory); } tempdir = Fdirectory_file_name (Vdata_directory); - if (access (XSTRING (tempdir)->data, 0) < 0) + if (access (SDATA (tempdir), 0) < 0) dir_warning ("Warning: arch-independent data dir (%s) does not exist.\n", Vdata_directory);
--- a/src/casefiddle.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/casefiddle.c Mon Jul 15 00:00:41 2002 +0000 @@ -68,12 +68,12 @@ int multibyte = STRING_MULTIBYTE (obj); obj = Fcopy_sequence (obj); - len = STRING_BYTES (XSTRING (obj)); + len = SBYTES (obj); /* Scan all single-byte characters from start of string. */ for (i = 0; i < len;) { - c = XSTRING (obj)->data[i]; + c = SREF (obj, i); if (multibyte && c >= 0x80) /* A multibyte character can't be handled in this @@ -90,7 +90,7 @@ : ! SINGLE_BYTE_CHAR_P (c)) break; - XSTRING (obj)->data[i] = c; + SREF (obj, i) = c; if ((int) flag >= (int) CASE_CAPITALIZE) inword = SYNTAX (c) == Sword; i++; @@ -107,12 +107,12 @@ = (char *) alloca ((len - i) * MAX_MULTIBYTE_LENGTH + i); /* Copy data already handled. */ - bcopy (XSTRING (obj)->data, buf, i); + bcopy (SDATA (obj), buf, i); /* From now on, I counts bytes. */ while (i < len) { - c = STRING_CHAR_AND_LENGTH (XSTRING (obj)->data + i, + c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i, len - i, fromlen); if (inword && flag != CASE_CAPITALIZE_UP) c = DOWNCASE (c); @@ -124,7 +124,7 @@ if ((int) flag >= (int) CASE_CAPITALIZE) inword = SYNTAX (c) == Sword; } - obj = make_multibyte_string (buf, XSTRING (obj)->size, + obj = make_multibyte_string (buf, SCHARS (obj), j_byte); } return obj;
--- a/src/category.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/category.c Mon Jul 15 00:00:41 2002 +0000 @@ -69,12 +69,12 @@ if (STRING_MULTIBYTE (categories)) error ("Multibyte string in make-category-set"); - len = XSTRING (categories)->size; + len = SCHARS (categories); while (--len >= 0) { Lisp_Object category; - XSETFASTINT (category, XSTRING (categories)->data[len]); + XSETFASTINT (category, SREF (categories, len)); CHECK_CATEGORY (category); SET_CATEGORY_SET (val, category, Qt); }
--- a/src/ccl.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/ccl.c Mon Jul 15 00:00:41 2002 +0000 @@ -2198,12 +2198,12 @@ if (ccl.ic < i && i < ccl.size) ccl.ic = i; } - outbufsize = STRING_BYTES (XSTRING (str)) * ccl.buf_magnification + 256; + outbufsize = SBYTES (str) * ccl.buf_magnification + 256; outbuf = (char *) xmalloc (outbufsize); ccl.last_block = NILP (contin); ccl.multibyte = STRING_MULTIBYTE (str); - produced = ccl_driver (&ccl, XSTRING (str)->data, outbuf, - STRING_BYTES (XSTRING (str)), outbufsize, (int *) 0); + produced = ccl_driver (&ccl, SDATA (str), outbuf, + SBYTES (str), outbufsize, (int *) 0); for (i = 0; i < 8; i++) XSET (AREF (status, i), Lisp_Int, ccl.reg[i]); XSETINT (AREF (status, 8), ccl.ic);
--- a/src/charset.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/charset.c Mon Jul 15 00:00:41 2002 +0000 @@ -700,14 +700,14 @@ || !STRINGP (vec[7]) || !STRINGP (vec[8])) error ("Invalid info-vector argument for defining charset %s", - XSTRING (SYMBOL_NAME (charset_symbol))->data); + SDATA (SYMBOL_NAME (charset_symbol))); if (NILP (charset_id)) { charset_id = get_new_private_charset_id (XINT (vec[0]), XINT (vec[2])); if (XINT (charset_id) == 0) error ("There's no room for a new private charset %s", - XSTRING (SYMBOL_NAME (charset_symbol))->data); + SDATA (SYMBOL_NAME (charset_symbol))); } update_charset_table (charset_id, vec[0], vec[1], vec[2], vec[3], @@ -779,7 +779,7 @@ if (XINT (final_char) < '0' || XFASTINT (final_char) > '~') error ("Invalid FINAL-CHAR %c, it should be `0'..`~'", XINT (chars)); if ((charset = get_charset_id (charset_symbol)) < 0) - error ("Invalid charset %s", XSTRING (SYMBOL_NAME (charset_symbol))->data); + error ("Invalid charset %s", SDATA (SYMBOL_NAME (charset_symbol))); ISO_CHARSET_TABLE (dimension, chars, final_char) = charset; return Qnil; @@ -943,8 +943,8 @@ CHECK_STRING (str); bzero (charsets, (MAX_CHARSET + 1) * sizeof (int)); - find_charset_in_text (XSTRING (str)->data, XSTRING (str)->size, - STRING_BYTES (XSTRING (str)), charsets, table); + find_charset_in_text (SDATA (str), SCHARS (str), + SBYTES (str), charsets, table); val = Qnil; if (charsets[1]) @@ -1335,9 +1335,9 @@ Lisp_Object string; int precision, *nchars, *nbytes; { - int len = XSTRING (string)->size; - int len_byte = STRING_BYTES (XSTRING (string)); - unsigned char *str = XSTRING (string)->data; + int len = SCHARS (string); + int len_byte = SBYTES (string); + unsigned char *str = SDATA (string); int i = 0, i_byte = 0; int width = 0; struct Lisp_Char_Table *dp = buffer_display_table ();
--- a/src/charset.h Sun Jul 14 23:54:05 2002 +0000 +++ b/src/charset.h Mon Jul 15 00:00:41 2002 +0000 @@ -573,7 +573,7 @@ CHARIDX++; \ if (STRING_MULTIBYTE (STRING)) \ { \ - unsigned char *ptr = &XSTRING (STRING)->data[BYTEIDX]; \ + unsigned char *ptr = &SREF (STRING, BYTEIDX); \ int space_left = XSTRING (STRING)->size_byte - BYTEIDX; \ int actual_len; \ \ @@ -581,7 +581,7 @@ BYTEIDX += actual_len; \ } \ else \ - OUTPUT = XSTRING (STRING)->data[BYTEIDX++]; \ + OUTPUT = SREF (STRING, BYTEIDX++); \ } \ else @@ -590,7 +590,7 @@ #define FETCH_STRING_CHAR_ADVANCE_NO_CHECK(OUTPUT, STRING, CHARIDX, BYTEIDX) \ if (1) \ { \ - unsigned char *fetch_string_char_ptr = &XSTRING (STRING)->data[BYTEIDX]; \ + unsigned char *fetch_string_char_ptr = &SREF (STRING, BYTEIDX); \ int fetch_string_char_space_left = XSTRING (STRING)->size_byte - BYTEIDX; \ int actual_len; \ \
--- a/src/coding.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/coding.c Mon Jul 15 00:00:41 2002 +0000 @@ -5224,7 +5224,7 @@ else if (VECTORP (val) || STRINGP (val)) { int len = (VECTORP (val) - ? XVECTOR (val)->size : XSTRING (val)->size); + ? XVECTOR (val)->size : SCHARS (val)); int i; for (i = 0; i < len; i++) { @@ -5832,7 +5832,7 @@ buf->enable_multibyte_characters = multibyte ? Qt : Qnil; insert_from_string (str, 0, 0, - XSTRING (str)->size, STRING_BYTES (XSTRING (str)), 0); + SCHARS (str), SBYTES (str), 0); UNGCPRO; inhibit_pre_post_conversion = 1; if (encodep) @@ -5864,7 +5864,7 @@ int consumed, consumed_char, produced, produced_char; from = 0; - to_byte = STRING_BYTES (XSTRING (str)); + to_byte = SBYTES (str); saved_coding_symbol = coding->symbol; coding->src_multibyte = STRING_MULTIBYTE (str); @@ -5874,7 +5874,7 @@ /* See the comments in code_convert_region. */ if (coding->type == coding_type_undecided) { - detect_coding (coding, XSTRING (str)->data, to_byte); + detect_coding (coding, SDATA (str), to_byte); if (coding->type == coding_type_undecided) { coding->type = coding_type_emacs_mule; @@ -5889,7 +5889,7 @@ && coding->type != coding_type_ccl) { saved_coding_symbol = coding->symbol; - detect_eol (coding, XSTRING (str)->data, to_byte); + detect_eol (coding, SDATA (str), to_byte); if (coding->eol_type == CODING_EOL_UNDECIDED) coding->eol_type = CODING_EOL_LF; /* We had better recover the original eol format if we @@ -5908,7 +5908,7 @@ { /* Decoding routines expect the source text to be unibyte. */ str = Fstring_as_unibyte (str); - to_byte = STRING_BYTES (XSTRING (str)); + to_byte = SBYTES (str); nocopy = 1; coding->src_multibyte = 0; } @@ -5916,24 +5916,24 @@ /* Try to skip the heading and tailing ASCIIs. */ if (require_decoding && coding->type != coding_type_ccl) { - SHRINK_CONVERSION_REGION (&from, &to_byte, coding, XSTRING (str)->data, + SHRINK_CONVERSION_REGION (&from, &to_byte, coding, SDATA (str), 0); if (from == to_byte) require_decoding = 0; - shrinked_bytes = from + (STRING_BYTES (XSTRING (str)) - to_byte); + shrinked_bytes = from + (SBYTES (str) - to_byte); } if (!require_decoding) { - coding->consumed = STRING_BYTES (XSTRING (str)); - coding->consumed_char = XSTRING (str)->size; + coding->consumed = SBYTES (str); + coding->consumed_char = SCHARS (str); if (coding->dst_multibyte) { str = Fstring_as_multibyte (str); nocopy = 1; } - coding->produced = STRING_BYTES (XSTRING (str)); - coding->produced_char = XSTRING (str)->size; + coding->produced = SBYTES (str); + coding->produced_char = SCHARS (str); return (nocopy ? str : Fcopy_sequence (str)); } @@ -5945,7 +5945,7 @@ consumed = consumed_char = produced = produced_char = 0; while (1) { - result = decode_coding (coding, XSTRING (str)->data + from + consumed, + result = decode_coding (coding, SDATA (str) + from + consumed, buf.data + produced, to_byte - from - consumed, buf.size - produced); consumed += coding->consumed; @@ -6014,11 +6014,11 @@ else newstr = make_uninit_string (produced + shrinked_bytes); if (from > 0) - bcopy (XSTRING (str)->data, XSTRING (newstr)->data, from); - bcopy (buf.data, XSTRING (newstr)->data + from, produced); + bcopy (SDATA (str), SDATA (newstr), from); + bcopy (buf.data, SDATA (newstr) + from, produced); if (shrinked_bytes > from) - bcopy (XSTRING (str)->data + to_byte, - XSTRING (newstr)->data + from + produced, + bcopy (SDATA (str) + to_byte, + SDATA (newstr) + from + produced, shrinked_bytes - from); free_conversion_buffer (&buf); @@ -6052,8 +6052,8 @@ str = run_pre_post_conversion_on_str (str, coding, 1); from = 0; - to = XSTRING (str)->size; - to_byte = STRING_BYTES (XSTRING (str)); + to = SCHARS (str); + to_byte = SBYTES (str); /* Encoding routines determine the multibyteness of the source text by coding->src_multibyte. */ @@ -6061,15 +6061,15 @@ coding->dst_multibyte = 0; if (! CODING_REQUIRE_ENCODING (coding)) { - coding->consumed = STRING_BYTES (XSTRING (str)); - coding->consumed_char = XSTRING (str)->size; + coding->consumed = SBYTES (str); + coding->consumed_char = SCHARS (str); if (STRING_MULTIBYTE (str)) { str = Fstring_as_unibyte (str); nocopy = 1; } - coding->produced = STRING_BYTES (XSTRING (str)); - coding->produced_char = XSTRING (str)->size; + coding->produced = SBYTES (str); + coding->produced_char = SCHARS (str); return (nocopy ? str : Fcopy_sequence (str)); } @@ -6079,11 +6079,11 @@ /* Try to skip the heading and tailing ASCIIs. */ if (coding->type != coding_type_ccl) { - SHRINK_CONVERSION_REGION (&from, &to_byte, coding, XSTRING (str)->data, + SHRINK_CONVERSION_REGION (&from, &to_byte, coding, SDATA (str), 1); if (from == to_byte) return (nocopy ? str : Fcopy_sequence (str)); - shrinked_bytes = from + (STRING_BYTES (XSTRING (str)) - to_byte); + shrinked_bytes = from + (SBYTES (str) - to_byte); } len = encoding_buffer_size (coding, to_byte - from); @@ -6092,7 +6092,7 @@ consumed = consumed_char = produced = produced_char = 0; while (1) { - result = encode_coding (coding, XSTRING (str)->data + from + consumed, + result = encode_coding (coding, SDATA (str) + from + consumed, buf.data + produced, to_byte - from - consumed, buf.size - produced); consumed += coding->consumed; @@ -6114,11 +6114,11 @@ newstr = make_uninit_string (produced + shrinked_bytes); if (from > 0) - bcopy (XSTRING (str)->data, XSTRING (newstr)->data, from); - bcopy (buf.data, XSTRING (newstr)->data + from, produced); + bcopy (SDATA (str), SDATA (newstr), from); + bcopy (buf.data, SDATA (newstr) + from, produced); if (shrinked_bytes > from) - bcopy (XSTRING (str)->data + to_byte, - XSTRING (newstr)->data + from + produced, + bcopy (SDATA (str) + to_byte, + SDATA (newstr) + from + produced, shrinked_bytes - from); free_conversion_buffer (&buf); @@ -6160,7 +6160,7 @@ val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil, Qt, Qnil, Qcoding_system_history, Qnil, Qnil); } - while (XSTRING (val)->size == 0); + while (SCHARS (val) == 0); return (Fintern (val, Qnil)); } @@ -6176,7 +6176,7 @@ val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil, Qt, Qnil, Qcoding_system_history, default_coding_system, Qnil); - return (XSTRING (val)->size == 0 ? Qnil : Fintern (val, Qnil)); + return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil)); } DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system, @@ -6318,12 +6318,12 @@ { CHECK_STRING (string); - return detect_coding_system (XSTRING (string)->data, + return detect_coding_system (SDATA (string), /* "+ 1" is to include the anchor byte `\0'. With this, code detectors can handle the tailing bytes more accurately. */ - STRING_BYTES (XSTRING (string)) + 1, + SBYTES (string) + 1, !NILP (highest), STRING_MULTIBYTE (string)); } @@ -6420,9 +6420,9 @@ { if (!STRING_MULTIBYTE (start)) return Qt; - p1 = XSTRING (start)->data, p1end = p1 + STRING_BYTES (XSTRING (start)); + p1 = SDATA (start), p1end = p1 + SBYTES (start); p2 = p2end = p1end; - if (XSTRING (start)->size != STRING_BYTES (XSTRING (start))) + if (SCHARS (start) != SBYTES (start)) non_ascii_p = 1; } else @@ -6508,7 +6508,7 @@ return make_number (to - from); if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) - error ("Invalid coding system: %s", XSTRING (SYMBOL_NAME (coding_system))->data); + error ("Invalid coding system: %s", SDATA (SYMBOL_NAME (coding_system))); coding.mode |= CODING_MODE_LAST_BLOCK; coding.src_multibyte = coding.dst_multibyte @@ -6563,7 +6563,7 @@ return (NILP (nocopy) ? Fcopy_sequence (string) : string); if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) - error ("Invalid coding system: %s", XSTRING (SYMBOL_NAME (coding_system))->data); + error ("Invalid coding system: %s", SDATA (SYMBOL_NAME (coding_system))); coding.mode |= CODING_MODE_LAST_BLOCK; string = (encodep @@ -6622,7 +6622,7 @@ return string; if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) - error ("Invalid coding system: %s", XSTRING (SYMBOL_NAME (coding_system))->data); + error ("Invalid coding system: %s", SDATA (SYMBOL_NAME (coding_system))); coding.composing = COMPOSITION_DISABLED; coding.mode |= CODING_MODE_LAST_BLOCK; @@ -6867,7 +6867,7 @@ error ("Invalid first argument"); if (nargs < 1 + XINT (target_idx)) error ("Too few arguments for operation: %s", - XSTRING (SYMBOL_NAME (operation))->data); + SDATA (SYMBOL_NAME (operation))); target = args[XINT (target_idx) + 1]; if (!(STRINGP (target) || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) @@ -7430,7 +7430,7 @@ Lisp_Object dec = code_convert_string_norecord (build_string (str), Vlocale_coding_system, 0); - str = (char *) XSTRING (dec)->data; + str = (char *) SDATA (dec); } return str;
--- a/src/composite.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/composite.c Mon Jul 15 00:00:41 2002 +0000 @@ -615,8 +615,8 @@ count = SPECPDL_INDEX (); GCPRO1 (string); stop = end; - ptr = XSTRING (string)->data + string_char_to_byte (string, start); - pend = ptr + STRING_BYTES (XSTRING (string)); + ptr = SDATA (string) + string_char_to_byte (string, start); + pend = ptr + SBYTES (string); } else { @@ -650,7 +650,7 @@ break; stop = end; if (STRINGP (string)) - ptr = XSTRING (string)->data + string_char_to_byte (string, start); + ptr = SDATA (string) + string_char_to_byte (string, start); else ptr = CHAR_POS_ADDR (start); } @@ -680,7 +680,7 @@ { start += XINT (val); if (STRINGP (string)) - ptr = XSTRING (string)->data + string_char_to_byte (string, start); + ptr = SDATA (string) + string_char_to_byte (string, start); else ptr = CHAR_POS_ADDR (start); } @@ -746,7 +746,7 @@ if (XINT (start) < 0 || XINT (start) > XINT (end) - || XINT (end) > XSTRING (string)->size) + || XINT (end) > SCHARS (string)) args_out_of_range (start, end); compose_text (XINT (start), XINT (end), components, mod_func, string); @@ -779,7 +779,7 @@ if (!NILP (string)) { CHECK_STRING (string); - if (XINT (pos) < 0 || XINT (pos) > XSTRING (string)->size) + if (XINT (pos) < 0 || XINT (pos) > SCHARS (string)) args_out_of_range (string, pos); } else
--- a/src/data.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/data.c Mon Jul 15 00:00:41 2002 +0000 @@ -311,7 +311,7 @@ Lisp_Object object; { if (SYMBOLP (object) - && XSTRING (SYMBOL_NAME (object))->data[0] == ':' + && SREF (SYMBOL_NAME (object), 0) == ':' && SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (object)) return Qt; return Qnil; @@ -873,7 +873,7 @@ *XINTFWD (valcontents)->intvar = XINT (newval); if (*XINTFWD (valcontents)->intvar != XINT (newval)) error ("Value out of range for variable `%s'", - XSTRING (SYMBOL_NAME (symbol))->data); + SDATA (SYMBOL_NAME (symbol))); break; case Lisp_Misc_Boolfwd: @@ -891,7 +891,7 @@ type = PER_BUFFER_TYPE (offset); if (XINT (type) == -1) - error ("Variable %s is read-only", XSTRING (SYMBOL_NAME (symbol))->data); + error ("Variable %s is read-only", SDATA (SYMBOL_NAME (symbol))); if (! NILP (type) && ! NILP (newval) && XTYPE (newval) != XINT (type)) @@ -1447,7 +1447,7 @@ valcontents = SYMBOL_VALUE (variable); if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) - error ("Symbol %s may not be buffer-local", XSTRING (SYMBOL_NAME (variable))->data); + error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) return variable; @@ -1500,7 +1500,7 @@ valcontents = SYMBOL_VALUE (variable); if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) - error ("Symbol %s may not be buffer-local", XSTRING (SYMBOL_NAME (variable))->data); + error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) { @@ -1643,7 +1643,7 @@ valcontents = SYMBOL_VALUE (variable); if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents) || BUFFER_OBJFWDP (valcontents)) - error ("Symbol %s may not be frame-local", XSTRING (SYMBOL_NAME (variable))->data); + error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); if (BUFFER_LOCAL_VALUEP (valcontents) || SOME_BUFFER_LOCAL_VALUEP (valcontents)) @@ -1827,14 +1827,14 @@ { int c, idxval_byte; - if (idxval < 0 || idxval >= XSTRING (array)->size) + if (idxval < 0 || idxval >= SCHARS (array)) args_out_of_range (array, idx); if (! STRING_MULTIBYTE (array)) - return make_number ((unsigned char) XSTRING (array)->data[idxval]); + return make_number ((unsigned char) SREF (array, idxval)); idxval_byte = string_char_to_byte (array, idxval); - c = STRING_CHAR (&XSTRING (array)->data[idxval_byte], - STRING_BYTES (XSTRING (array)) - idxval_byte); + c = STRING_CHAR (&SREF (array, idxval_byte), + SBYTES (array) - idxval_byte); return make_number (c); } else if (BOOL_VECTOR_P (array)) @@ -2026,29 +2026,29 @@ int idxval_byte, prev_bytes, new_bytes; unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; - if (idxval < 0 || idxval >= XSTRING (array)->size) + if (idxval < 0 || idxval >= SCHARS (array)) args_out_of_range (array, idx); CHECK_NUMBER (newelt); idxval_byte = string_char_to_byte (array, idxval); - p1 = &XSTRING (array)->data[idxval_byte]; + p1 = &SREF (array, idxval_byte); PARSE_MULTIBYTE_SEQ (p1, nbytes - idxval_byte, prev_bytes); new_bytes = CHAR_STRING (XINT (newelt), p0); if (prev_bytes != new_bytes) { /* We must relocate the string data. */ - int nchars = XSTRING (array)->size; - int nbytes = STRING_BYTES (XSTRING (array)); + int nchars = SCHARS (array); + int nbytes = SBYTES (array); unsigned char *str; str = (nbytes <= MAX_ALLOCA ? (unsigned char *) alloca (nbytes) : (unsigned char *) xmalloc (nbytes)); - bcopy (XSTRING (array)->data, str, nbytes); + bcopy (SDATA (array), str, nbytes); allocate_string_data (XSTRING (array), nchars, nbytes + new_bytes - prev_bytes); - bcopy (str, XSTRING (array)->data, idxval_byte); - p1 = XSTRING (array)->data + idxval_byte; + bcopy (str, SDATA (array), idxval_byte); + p1 = SDATA (array) + idxval_byte; bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, nbytes - (idxval_byte + prev_bytes)); if (nbytes > MAX_ALLOCA) @@ -2060,36 +2060,36 @@ } else { - if (idxval < 0 || idxval >= XSTRING (array)->size) + if (idxval < 0 || idxval >= SCHARS (array)) args_out_of_range (array, idx); CHECK_NUMBER (newelt); if (XINT (newelt) < 0 || SINGLE_BYTE_CHAR_P (XINT (newelt))) - XSTRING (array)->data[idxval] = XINT (newelt); + SREF (array, idxval) = XINT (newelt); else { /* We must relocate the string data while converting it to multibyte. */ int idxval_byte, prev_bytes, new_bytes; unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; - unsigned char *origstr = XSTRING (array)->data, *str; + unsigned char *origstr = SDATA (array), *str; int nchars, nbytes; - nchars = XSTRING (array)->size; + nchars = SCHARS (array); nbytes = idxval_byte = count_size_as_multibyte (origstr, idxval); nbytes += count_size_as_multibyte (origstr + idxval, nchars - idxval); str = (nbytes <= MAX_ALLOCA ? (unsigned char *) alloca (nbytes) : (unsigned char *) xmalloc (nbytes)); - copy_text (XSTRING (array)->data, str, nchars, 0, 1); + copy_text (SDATA (array), str, nchars, 0, 1); PARSE_MULTIBYTE_SEQ (str + idxval_byte, nbytes - idxval_byte, prev_bytes); new_bytes = CHAR_STRING (XINT (newelt), p0); allocate_string_data (XSTRING (array), nchars, nbytes + new_bytes - prev_bytes); - bcopy (str, XSTRING (array)->data, idxval_byte); - p1 = XSTRING (array)->data + idxval_byte; + bcopy (str, SDATA (array), idxval_byte); + p1 = SDATA (array) + idxval_byte; while (new_bytes--) *p1++ = *p0++; bcopy (str + idxval_byte + prev_bytes, p1, @@ -2339,7 +2339,7 @@ /* Skip any whitespace at the front of the number. Some versions of atoi do this anyway, so we might as well make Emacs lisp consistent. */ - p = XSTRING (string)->data; + p = SDATA (string); while (*p == ' ' || *p == '\t') p++;
--- a/src/dired.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/dired.c Mon Jul 15 00:00:41 2002 +0000 @@ -188,7 +188,7 @@ unwind_protect to do so would be a pain. */ retry: - d = opendir (XSTRING (dirfilename)->data); + d = opendir (SDATA (dirfilename)); if (d == NULL) report_file_error ("Opening directory", Fcons (directory, Qnil)); @@ -199,13 +199,13 @@ Fcons (make_number (((unsigned long) d) >> 16), make_number (((unsigned long) d) & 0xffff))); - directory_nbytes = STRING_BYTES (XSTRING (directory)); + directory_nbytes = SBYTES (directory); re_match_object = Qt; /* Decide whether we need to add a directory separator. */ #ifndef VMS if (directory_nbytes == 0 - || !IS_ANY_SEP (XSTRING (directory)->data[directory_nbytes - 1])) + || !IS_ANY_SEP (SREF (directory, directory_nbytes - 1))) needsep = 1; #endif /* not VMS */ @@ -237,7 +237,7 @@ /* Note: ENCODE_FILE can GC; it should protect its argument, though. */ name = DECODE_FILE (name); - len = STRING_BYTES (XSTRING (name)); + len = SBYTES (name); /* Now that we have unwind_protect in place, we might as well allow matching to be interrupted. */ @@ -245,7 +245,7 @@ QUIT; if (NILP (match) - || (0 <= re_search (bufp, XSTRING (name)->data, len, 0, len, 0))) + || (0 <= re_search (bufp, SDATA (name), len, 0, len, 0))) wanted = 1; immediate_quit = 0; @@ -259,25 +259,25 @@ int nchars; fullname = make_uninit_multibyte_string (nbytes, nbytes); - bcopy (XSTRING (directory)->data, XSTRING (fullname)->data, + bcopy (SDATA (directory), SDATA (fullname), directory_nbytes); if (needsep) - XSTRING (fullname)->data[directory_nbytes] = DIRECTORY_SEP; + SREF (fullname, directory_nbytes) = DIRECTORY_SEP; - bcopy (XSTRING (name)->data, - XSTRING (fullname)->data + directory_nbytes + needsep, + bcopy (SDATA (name), + SDATA (fullname) + directory_nbytes + needsep, len); - nchars = chars_in_text (XSTRING (fullname)->data, nbytes); + nchars = chars_in_text (SDATA (fullname), nbytes); /* Some bug somewhere. */ if (nchars > nbytes) abort (); - XSTRING (fullname)->size = nchars; + SCHARS (fullname) = nchars; if (nchars == nbytes) - SET_STRING_BYTES (XSTRING (fullname), -1); + STRING_SET_UNIBYTE (fullname); finalname = fullname; } @@ -519,7 +519,7 @@ for (passcount = !!all_flag; NILP (bestmatch) && passcount < 2; passcount++) { - d = opendir (XSTRING (Fdirectory_file_name (encoded_dir))->data); + d = opendir (SDATA (Fdirectory_file_name (encoded_dir))); if (!d) report_file_error ("Opening directory", Fcons (dirname, Qnil)); @@ -542,9 +542,9 @@ if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) goto quit; if (! DIRENTRY_NONEMPTY (dp) - || len < XSTRING (encoded_file)->size - || 0 <= scmp (dp->d_name, XSTRING (encoded_file)->data, - XSTRING (encoded_file)->size)) + || len < SCHARS (encoded_file) + || 0 <= scmp (dp->d_name, SDATA (encoded_file), + SCHARS (encoded_file))) continue; if (file_name_completion_stat (encoded_dir, dp, &st) < 0) @@ -561,7 +561,7 @@ actually in the way in a directory contains only one file. */ if (!passcount && TRIVIAL_DIRECTORY_ENTRY (dp->d_name)) continue; - if (!passcount && len > XSTRING (encoded_file)->size) + if (!passcount && len > SCHARS (encoded_file)) /* Ignore directories if they match an element of completion-ignored-extensions which ends in a slash. */ for (tem = Vcompletion_ignored_extensions; @@ -575,10 +575,10 @@ /* Need to encode ELT, since scmp compares unibyte strings only. */ elt = ENCODE_FILE (elt); - elt_len = XSTRING (elt)->size - 1; /* -1 for trailing / */ + elt_len = SCHARS (elt) - 1; /* -1 for trailing / */ if (elt_len <= 0) continue; - p1 = XSTRING (elt)->data; + p1 = SDATA (elt); if (p1[elt_len] != '/') continue; skip = len - elt_len; @@ -594,7 +594,7 @@ { /* Compare extensions-to-be-ignored against end of this file name */ /* if name is not an exact match against specified string */ - if (!passcount && len > XSTRING (encoded_file)->size) + if (!passcount && len > SCHARS (encoded_file)) /* and exit this for loop if a match is found */ for (tem = Vcompletion_ignored_extensions; CONSP (tem); tem = XCDR (tem)) @@ -604,12 +604,12 @@ /* Need to encode ELT, since scmp compares unibyte strings only. */ elt = ENCODE_FILE (elt); - skip = len - XSTRING (elt)->size; + skip = len - SCHARS (elt); if (skip < 0) continue; if (0 <= scmp (dp->d_name + skip, - XSTRING (elt)->data, - XSTRING (elt)->size)) + SDATA (elt), + SCHARS (elt))) continue; break; } @@ -661,13 +661,13 @@ else { bestmatch = name; - bestmatchsize = XSTRING (name)->size; + bestmatchsize = SCHARS (name); } } else { compare = min (bestmatchsize, len); - p1 = XSTRING (bestmatch)->data; + p1 = SDATA (bestmatch); p2 = (unsigned char *) dp->d_name; matchsize = scmp(p1, p2, compare); if (matchsize < 0) @@ -682,7 +682,7 @@ but BESTMATCH is not (it is too long). */ if ((matchsize == len && matchsize + !!directoryp - < XSTRING (bestmatch)->size) + < SCHARS (bestmatch)) || /* If there is no exact match ignoring case, prefer a match that does not change the case @@ -695,9 +695,9 @@ (((matchsize == len) == (matchsize + !!directoryp - == XSTRING (bestmatch)->size)) - && !bcmp (p2, XSTRING (encoded_file)->data, XSTRING (encoded_file)->size) - && bcmp (p1, XSTRING (encoded_file)->data, XSTRING (encoded_file)->size))) + == SCHARS (bestmatch))) + && !bcmp (p2, SDATA (encoded_file), SCHARS (encoded_file)) + && bcmp (p1, SDATA (encoded_file), SCHARS (encoded_file)))) { bestmatch = make_string (dp->d_name, len); if (directoryp) @@ -727,7 +727,7 @@ bestmatch = DECODE_FILE (bestmatch); return bestmatch; } - if (matchcount == 1 && bestmatchsize == XSTRING (file)->size) + if (matchcount == 1 && bestmatchsize == SCHARS (file)) return Qt; bestmatch = Fsubstring (bestmatch, make_number (0), make_number (bestmatchsize)); @@ -777,7 +777,7 @@ struct stat *st_addr; { int len = NAMLEN (dp); - int pos = XSTRING (dirname)->size; + int pos = SCHARS (dirname); int value; char *fullname = (char *) alloca (len + pos + 2); @@ -794,7 +794,7 @@ #endif /* __DJGPP__ > 1 */ #endif /* MSDOS */ - bcopy (XSTRING (dirname)->data, fullname, pos); + bcopy (SDATA (dirname), fullname, pos); #ifndef VMS if (!IS_DIRECTORY_SEP (fullname[pos - 1])) fullname[pos++] = DIRECTORY_SEP; @@ -847,7 +847,7 @@ filename = Fexpand_file_name (filename, Qnil); fab = cc$rms_fab; xabfhc = cc$rms_xabfhc; - fab.fab$l_fna = XSTRING (filename)->data; + fab.fab$l_fna = SDATA (filename); fab.fab$b_fns = strlen (fab.fab$l_fna); fab.fab$l_xab = (char *) &xabfhc; status = sys$open (&fab, 0, 0); @@ -916,7 +916,7 @@ encoded = ENCODE_FILE (filename); - if (lstat (XSTRING (encoded)->data, &s) < 0) + if (lstat (SDATA (encoded), &s) < 0) return Qnil; switch (s.st_mode & S_IFMT) @@ -946,7 +946,7 @@ dirname = Ffile_name_directory (filename); if (! NILP (dirname)) encoded = ENCODE_FILE (dirname); - if (! NILP (dirname) && stat (XSTRING (encoded)->data, &sdir) == 0) + if (! NILP (dirname) && stat (SDATA (encoded), &sdir) == 0) values[9] = (sdir.st_gid != s.st_gid) ? Qt : Qnil; else /* if we can't tell, assume worst */ values[9] = Qt;
--- a/src/dispnew.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/dispnew.c Mon Jul 15 00:00:41 2002 +0000 @@ -379,7 +379,7 @@ w, ((BUFFERP (w->buffer) && STRINGP (XBUFFER (w->buffer)->name)) - ? (char *) XSTRING (XBUFFER (w->buffer)->name)->data + ? (char *) SDATA (XBUFFER (w->buffer)->name) : "???"), paused_p ? " ***paused***" : ""); strcat (buf, msg); @@ -6058,7 +6058,7 @@ if (! NILP (file)) { file = Fexpand_file_name (file, Qnil); - termscript = fopen (XSTRING (file)->data, "w"); + termscript = fopen (SDATA (file), "w"); if (termscript == 0) report_file_error ("Opening termscript", Fcons (file, Qnil)); } @@ -6075,11 +6075,11 @@ { /* ??? Perhaps we should do something special for multibyte strings here. */ CHECK_STRING (string); - fwrite (XSTRING (string)->data, 1, STRING_BYTES (XSTRING (string)), stdout); + fwrite (SDATA (string), 1, SBYTES (string), stdout); fflush (stdout); if (termscript) { - fwrite (XSTRING (string)->data, 1, STRING_BYTES (XSTRING (string)), + fwrite (SDATA (string), 1, SBYTES (string), termscript); fflush (termscript); } @@ -6330,7 +6330,7 @@ { buf = XCDR (XCAR (tail)); /* Ignore buffers that aren't included in buffer lists. */ - if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') + if (SREF (XBUFFER (buf)->name, 0) == ' ') continue; if (!EQ (*vecp++, buf)) goto changed; @@ -6364,7 +6364,7 @@ { buf = XCDR (XCAR (tail)); /* Ignore buffers that aren't included in buffer lists. */ - if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') + if (SREF (XBUFFER (buf)->name, 0) == ' ') continue; *vecp++ = buf; *vecp++ = XBUFFER (buf)->read_only;
--- a/src/disptab.h Sun Jul 14 23:54:05 2002 +0000 +++ b/src/disptab.h Mon Jul 15 00:00:41 2002 +0000 @@ -90,8 +90,8 @@ /* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 0, return the length and the address of the character-sequence used for outputting GLYPH G. */ -#define GLYPH_LENGTH(base,g) XSTRING (base[g])->size -#define GLYPH_STRING(base,g) XSTRING (base[g])->data +#define GLYPH_LENGTH(base,g) SCHARS (base[g]) +#define GLYPH_STRING(base,g) SDATA (base[g]) /* GLYPH for a space character. */
--- a/src/doc.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/doc.c Mon Jul 15 00:00:41 2002 +0000 @@ -158,18 +158,18 @@ tem = Ffile_name_absolute_p (file); if (NILP (tem)) { - minsize = XSTRING (Vdoc_directory)->size; + minsize = SCHARS (Vdoc_directory); /* sizeof ("../etc/") == 8 */ if (minsize < 8) minsize = 8; - name = (char *) alloca (minsize + XSTRING (file)->size + 8); - strcpy (name, XSTRING (Vdoc_directory)->data); - strcat (name, XSTRING (file)->data); + name = (char *) alloca (minsize + SCHARS (file) + 8); + strcpy (name, SDATA (Vdoc_directory)); + strcat (name, SDATA (file)); munge_doc_file_name (name); } else { - name = (char *) XSTRING (file)->data; + name = (char *) SDATA (file); } fd = emacs_open (name, O_RDONLY, 0); @@ -181,7 +181,7 @@ /* Preparing to dump; DOC file is probably not installed. So check in ../etc. */ strcpy (name, "../etc/"); - strcat (name, XSTRING (file)->data); + strcat (name, SDATA (file)); munge_doc_file_name (name); fd = emacs_open (name, O_RDONLY, 0); @@ -590,17 +590,17 @@ (0) #endif /* CANNOT_DUMP */ { - name = (char *) alloca (XSTRING (filename)->size + 14); + name = (char *) alloca (SCHARS (filename) + 14); strcpy (name, "../etc/"); } else { CHECK_STRING (Vdoc_directory); - name = (char *) alloca (XSTRING (filename)->size - + XSTRING (Vdoc_directory)->size + 1); - strcpy (name, XSTRING (Vdoc_directory)->data); + name = (char *) alloca (SCHARS (filename) + + SCHARS (Vdoc_directory) + 1); + strcpy (name, SDATA (Vdoc_directory)); } - strcat (name, XSTRING (filename)->data); /*** Add this line ***/ + strcat (name, SDATA (filename)); /*** Add this line ***/ #ifdef VMS #ifndef VMS4_4 /* For VMS versions with limited file name syntax, @@ -722,11 +722,11 @@ if (NILP (keymap)) keymap = Voverriding_local_map; - bsize = STRING_BYTES (XSTRING (string)); + bsize = SBYTES (string); bufp = buf = (unsigned char *) xmalloc (bsize); - strp = (unsigned char *) XSTRING (string)->data; - while (strp < XSTRING (string)->data + STRING_BYTES (XSTRING (string))) + strp = (unsigned char *) SDATA (string); + while (strp < SDATA (string) + SBYTES (string)) { if (strp[0] == '\\' && strp[1] == '=') { @@ -737,7 +737,7 @@ if (multibyte) { int len; - int maxlen = XSTRING (string)->data + STRING_BYTES (XSTRING (string)) - strp; + int maxlen = SDATA (string) + SBYTES (string) - strp; STRING_CHAR_AND_LENGTH (strp, maxlen, len); if (len == 1) @@ -759,10 +759,10 @@ changed = 1; strp += 2; /* skip \[ */ start = strp; - start_idx = start - XSTRING (string)->data; + start_idx = start - SDATA (string); - while ((strp - (unsigned char *) XSTRING (string)->data - < STRING_BYTES (XSTRING (string))) + while ((strp - (unsigned char *) SDATA (string) + < SBYTES (string)) && *strp != ']') strp++; length_byte = strp - start; @@ -770,14 +770,14 @@ strp++; /* skip ] */ /* Save STRP in IDX. */ - idx = strp - (unsigned char *) XSTRING (string)->data; + idx = strp - (unsigned char *) SDATA (string); tem = Fintern (make_string (start, length_byte), Qnil); /* Note the Fwhere_is_internal can GC, so we have to take relocation of string contents into account. */ tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qnil); - strp = XSTRING (string)->data + idx; - start = XSTRING (string)->data + start_idx; + strp = SDATA (string) + idx; + start = SDATA (string) + start_idx; /* Disregard menu bar bindings; it is positively annoying to mention them when there's no menu bar, and it isn't terribly @@ -819,10 +819,10 @@ changed = 1; strp += 2; /* skip \{ or \< */ start = strp; - start_idx = start - XSTRING (string)->data; + start_idx = start - SDATA (string); - while ((strp - (unsigned char *) XSTRING (string)->data - < XSTRING (string)->size) + while ((strp - (unsigned char *) SDATA (string) + < SCHARS (string)) && *strp != '}' && *strp != '>') strp++; @@ -830,7 +830,7 @@ strp++; /* skip } or > */ /* Save STRP in IDX. */ - idx = strp - (unsigned char *) XSTRING (string)->data; + idx = strp - (unsigned char *) SDATA (string); /* Get the value of the keymap in TEM, or nil if undefined. Do this while still in the user's current buffer @@ -844,8 +844,8 @@ { tem = get_keymap (tem, 0, 1); /* Note that get_keymap can GC. */ - strp = XSTRING (string)->data + idx; - start = XSTRING (string)->data + start_idx; + strp = SDATA (string) + idx; + start = SDATA (string) + start_idx; } } @@ -858,8 +858,8 @@ name = Fsymbol_name (name); insert_string ("\nUses keymap \""); insert_from_string (name, 0, 0, - XSTRING (name)->size, - STRING_BYTES (XSTRING (name)), 1); + SCHARS (name), + SBYTES (name), 1); insert_string ("\", which is not currently defined.\n"); if (start[-1] == '<') keymap = Qnil; } @@ -872,9 +872,9 @@ set_buffer_internal (oldbuf); subst_string: - start = XSTRING (tem)->data; - length = XSTRING (tem)->size; - length_byte = STRING_BYTES (XSTRING (tem)); + start = SDATA (tem); + length = SCHARS (tem); + length_byte = SBYTES (tem); subst: { int offset = bufp - buf; @@ -884,7 +884,7 @@ bufp += length_byte; nchars += length; /* Check STRING again in case gc relocated it. */ - strp = (unsigned char *) XSTRING (string)->data + idx; + strp = (unsigned char *) SDATA (string) + idx; } } else if (! multibyte) /* just copy other chars */ @@ -892,7 +892,7 @@ else { int len; - int maxlen = XSTRING (string)->data + STRING_BYTES (XSTRING (string)) - strp; + int maxlen = SDATA (string) + SBYTES (string) - strp; STRING_CHAR_AND_LENGTH (strp, maxlen, len); if (len == 1)
--- a/src/dosfns.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/dosfns.c Mon Jul 15 00:00:41 2002 +0000 @@ -503,7 +503,7 @@ if (FRAME_MSDOS_P (f)) { BLOCK_INPUT; - w95_set_virtual_machine_title (XSTRING (name)->data); + w95_set_virtual_machine_title (SDATA (name)); UNBLOCK_INPUT; } } @@ -525,7 +525,7 @@ filename = Fexpand_file_name (filename, Qnil); encoded = ENCODE_FILE (filename); - if (statfs (XSTRING (encoded)->data, &stfs)) + if (statfs (SDATA (encoded), &stfs)) value = Qnil; else value = list3 (make_float ((double) stfs.f_bsize * stfs.f_blocks),
--- a/src/editfns.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/editfns.c Mon Jul 15 00:00:41 2002 +0000 @@ -1202,7 +1202,7 @@ else if (NUMBERP (uid)) pw = (struct passwd *) getpwuid ((uid_t) XFLOATINT (uid)); else if (STRINGP (uid)) - pw = (struct passwd *) getpwnam (XSTRING (uid)->data); + pw = (struct passwd *) getpwnam (SDATA (uid)); else error ("Invalid UID specification"); @@ -1215,7 +1215,7 @@ full = make_string (p, q ? q - p : strlen (p)); #ifdef AMPERSAND_FULL_NAME - p = XSTRING (full)->data; + p = SDATA (full); q = (unsigned char *) index (p, '&'); /* Substitute the login name for the &, upcasing the first character. */ if (q) @@ -1224,10 +1224,10 @@ Lisp_Object login; login = Fuser_login_name (make_number (pw->pw_uid)); - r = (unsigned char *) alloca (strlen (p) + XSTRING (login)->size + 1); + r = (unsigned char *) alloca (strlen (p) + SCHARS (login) + 1); bcopy (p, r, q - p); r[q - p] = 0; - strcat (r, XSTRING (login)->data); + strcat (r, SDATA (login)); r[q - p] = UPCASE (r[q - p]); strcat (r, q + 1); full = build_string (r); @@ -1250,7 +1250,7 @@ get_system_name () { if (STRINGP (Vsystem_name)) - return (char *) XSTRING (Vsystem_name)->data; + return (char *) SDATA (Vsystem_name); else return ""; } @@ -1479,7 +1479,7 @@ Vlocale_coding_system, 1); /* This is probably enough. */ - size = STRING_BYTES (XSTRING (format_string)) * 6 + 50; + size = SBYTES (format_string) * 6 + 50; tm = ut ? gmtime (&value) : localtime (&value); if (! tm) @@ -1493,8 +1493,8 @@ int result; buf[0] = '\1'; - result = emacs_memftimeu (buf, size, XSTRING (format_string)->data, - STRING_BYTES (XSTRING (format_string)), + result = emacs_memftimeu (buf, size, SDATA (format_string), + SBYTES (format_string), tm, ut); if ((result > 0 && result < size) || (result == 0 && buf[0] == '\0')) return code_convert_string_norecord (make_string (buf, result), @@ -1502,8 +1502,8 @@ /* If buffer was too small, make it bigger and try again. */ result = emacs_memftimeu (NULL, (size_t) -1, - XSTRING (format_string)->data, - STRING_BYTES (XSTRING (format_string)), + SDATA (format_string), + SBYTES (format_string), tm, ut); size = result + 1; } @@ -1610,7 +1610,7 @@ if (EQ (zone, Qt)) tzstring = "UTC0"; else if (STRINGP (zone)) - tzstring = (char *) XSTRING (zone)->data; + tzstring = (char *) SDATA (zone); else if (INTEGERP (zone)) { int abszone = abs (XINT (zone)); @@ -1788,7 +1788,7 @@ else { CHECK_STRING (tz); - tzstring = (char *) XSTRING (tz)->data; + tzstring = (char *) SDATA (tz); } set_time_zone_rule (tzstring); @@ -1934,8 +1934,8 @@ else if (STRINGP (val)) { (*insert_from_string_func) (val, 0, 0, - XSTRING (val)->size, - STRING_BYTES (XSTRING (val)), + SCHARS (val), + SBYTES (val), inherit); } else @@ -2146,7 +2146,7 @@ result = make_uninit_multibyte_string (end - start, end_byte - start_byte); else result = make_uninit_string (end - start); - bcopy (BYTE_POS_ADDR (start_byte), XSTRING (result)->data, + bcopy (BYTE_POS_ADDR (start_byte), SDATA (result), end_byte - start_byte); /* If desired, update and copy the text properties. */ @@ -2659,8 +2659,8 @@ validate_region (&start, &end); CHECK_STRING (table); - size = STRING_BYTES (XSTRING (table)); - tt = XSTRING (table)->data; + size = SBYTES (table); + tt = SDATA (table); pos_byte = CHAR_TO_BYTE (XINT (start)); stop = CHAR_TO_BYTE (XINT (end)); @@ -2929,7 +2929,7 @@ { register Lisp_Object val; val = Fformat (nargs, args); - message3 (val, STRING_BYTES (XSTRING (val)), STRING_MULTIBYTE (val)); + message3 (val, SBYTES (val), STRING_MULTIBYTE (val)); return val; } } @@ -2979,13 +2979,13 @@ message_text = (char *)xmalloc (80); message_length = 80; } - if (STRING_BYTES (XSTRING (val)) > message_length) + if (SBYTES (val) > message_length) { - message_length = STRING_BYTES (XSTRING (val)); + message_length = SBYTES (val); message_text = (char *)xrealloc (message_text, message_length); } - bcopy (XSTRING (val)->data, message_text, STRING_BYTES (XSTRING (val))); - message2 (message_text, STRING_BYTES (XSTRING (val)), + bcopy (SDATA (val), message_text, SBYTES (val)); + message2 (message_text, SBYTES (val), STRING_MULTIBYTE (val)); return val; } @@ -3058,7 +3058,7 @@ } Fadd_text_properties (make_number (0), - make_number (XSTRING (string)->size), + make_number (SCHARS (string)), properties, string); RETURN_UNGCPRO (string); } @@ -3069,9 +3069,8 @@ #define CONVERTED_BYTE_SIZE(MULTIBYTE, STRING) \ (((MULTIBYTE) && ! STRING_MULTIBYTE (STRING)) \ - ? count_size_as_multibyte (XSTRING (STRING)->data, \ - STRING_BYTES (XSTRING (STRING))) \ - : STRING_BYTES (XSTRING (STRING))) + ? count_size_as_multibyte (SDATA (STRING), SBYTES (STRING)) \ + : SBYTES (STRING)) DEFUN ("format", Fformat, Sformat, 1, MANY, 0, doc: /* Format a string out of a control-string and arguments. @@ -3133,8 +3132,8 @@ and later find it has to be multibyte, we jump back to retry. */ retry: - format = XSTRING (args[0])->data; - end = format + STRING_BYTES (XSTRING (args[0])); + format = SDATA (args[0]); + end = format + SBYTES (args[0]); longest_format = 0; /* Make room in result for all the non-%-codes in the control string. */ @@ -3255,7 +3254,7 @@ goto retry; } args[n] = Fchar_to_string (args[n]); - thissize = STRING_BYTES (XSTRING (args[n])); + thissize = SBYTES (args[n]); } } else if (FLOATP (args[n]) && *format != 's') @@ -3303,7 +3302,7 @@ n = 0; /* Scan the format and store result in BUF. */ - format = XSTRING (args[0])->data; + format = SDATA (args[0]); maybe_combine_byte = 0; while (format != end) { @@ -3353,13 +3352,13 @@ && multibyte && !ASCII_BYTE_P (*((unsigned char *) p - 1)) && STRING_MULTIBYTE (args[n]) - && !CHAR_HEAD_P (XSTRING (args[n])->data[0])) + && !CHAR_HEAD_P (SREF (args[n], 0))) maybe_combine_byte = 1; - nbytes = copy_text (XSTRING (args[n])->data, p, - STRING_BYTES (XSTRING (args[n])), + nbytes = copy_text (SDATA (args[n]), p, + SBYTES (args[n]), STRING_MULTIBYTE (args[n]), multibyte); p += nbytes; - nchars += XSTRING (args[n])->size; + nchars += SCHARS (args[n]); end = nchars; if (negative) @@ -3371,7 +3370,7 @@ /* If this argument has text properties, record where in the result string it appears. */ - if (XSTRING (args[n])->intervals) + if (STRING_INTERVALS (args[n])) { if (!info) { @@ -3450,19 +3449,19 @@ arguments has text properties, set up text properties of the result string. */ - if (XSTRING (args[0])->intervals || info) + if (STRING_INTERVALS (args[0]) || info) { Lisp_Object len, new_len, props; struct gcpro gcpro1; /* Add text properties from the format string. */ - len = make_number (XSTRING (args[0])->size); + len = make_number (SCHARS (args[0])); props = text_property_list (args[0], make_number (0), len, Qnil); GCPRO1 (props); if (CONSP (props)) { - new_len = make_number (XSTRING (val)->size); + new_len = make_number (SCHARS (val)); extend_property_ranges (props, len, new_len); add_text_properties_from_list (val, props, make_number (0)); } @@ -3472,7 +3471,7 @@ for (n = 1; n < nargs; ++n) if (info[n].end) { - len = make_number (XSTRING (args[n])->size); + len = make_number (SCHARS (args[n])); new_len = make_number (info[n].end - info[n].start); props = text_property_list (args[n], make_number (0), len, Qnil); extend_property_ranges (props, len, new_len);
--- a/src/emacs.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/emacs.c Mon Jul 15 00:00:41 2002 +0000 @@ -743,7 +743,7 @@ if (!STRINGP(temp)) return REPORT_EMACS_BUG_ADDRESS; - string = XSTRING (temp)->data; + string = SDATA (temp); /* Count dots in `emacs-version'. */ while (*string) @@ -817,7 +817,7 @@ } else { - printf ("GNU Emacs %s\n", XSTRING (tem)->data); + printf ("GNU Emacs %s\n", SDATA (tem)); printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n"); printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); printf ("You may redistribute copies of Emacs\n"); @@ -1908,7 +1908,7 @@ kill it because we are exiting Emacs deliberately (not crashing). Do it after shut_down_emacs, which does an auto-save. */ if (STRINGP (Vauto_save_list_file_name)) - unlink (XSTRING (Vauto_save_list_file_name)->data); + unlink (SDATA (Vauto_save_list_file_name)); exit (INTEGERP (arg) ? XINT (arg) #ifdef VMS @@ -1977,8 +1977,8 @@ #ifdef HAVE_X_WINDOWS /* It's not safe to call intern here. Maybe we are crashing. */ if (!noninteractive && SYMBOLP (Vwindow_system) - && XSTRING (SYMBOL_NAME (Vwindow_system))->size == 1 - && XSTRING (SYMBOL_NAME (Vwindow_system))->data[0] == 'x' + && SCHARS (SYMBOL_NAME (Vwindow_system)) == 1 + && SREF (SYMBOL_NAME (Vwindow_system), 0) == 'x' && ! no_x) Fx_close_current_connection (); #endif /* HAVE_X_WINDOWS */ @@ -2036,7 +2036,7 @@ #ifndef SYSTEM_MALLOC memory_warnings (my_edata, malloc_warning); #endif - map_out_data (XSTRING (filename)->data); + map_out_data (SDATA (filename)); Vpurify_flag = tem; @@ -2075,7 +2075,7 @@ if (!NILP (symfile)) { CHECK_STRING (symfile); - if (XSTRING (symfile)->size) + if (SCHARS (symfile)) symfile = Fexpand_file_name (symfile, Qnil); } @@ -2092,7 +2092,7 @@ fflush (stdout); #ifdef VMS - mapout_data (XSTRING (filename)->data); + mapout_data (SDATA (filename)); #else /* Tell malloc where start of impure now is. */ /* Also arrange for warnings when nearly out of space. */ @@ -2110,8 +2110,8 @@ #ifdef USE_MMAP_FOR_BUFFERS mmap_set_vars (0); #endif - unexec (XSTRING (filename)->data, - !NILP (symfile) ? XSTRING (symfile)->data : 0, my_edata, 0, 0); + unexec (SDATA (filename), + !NILP (symfile) ? SDATA (symfile) : 0, my_edata, 0, 0); #ifdef USE_MMAP_FOR_BUFFERS mmap_set_vars (1); #endif @@ -2151,7 +2151,7 @@ { *plocale = desired_locale; setlocale (category, (STRINGP (desired_locale) - ? (char *)(XSTRING (desired_locale)->data) + ? (char *)(SDATA (desired_locale)) : "")); } }
--- a/src/eval.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/eval.c Mon Jul 15 00:00:41 2002 +0000 @@ -837,7 +837,7 @@ if (INTEGERP (documentation) && XINT (documentation) < 0) return Qt; if (STRINGP (documentation) - && ((unsigned char) XSTRING (documentation)->data[0] == '*')) + && ((unsigned char) SREF (documentation, 0) == '*')) return Qt; /* If it is (STRING . INTEGER), a negative integer means a user variable. */ if (CONSP (documentation) @@ -1554,7 +1554,7 @@ data = Fcons (error_symbol, data); string = Ferror_message_string (data); - fatal ("%s", XSTRING (string)->data, 0); + fatal ("%s", SDATA (string), 0); } /* Return nonzero iff LIST is a non-nil atom or @@ -1920,7 +1920,7 @@ of what files are preloaded and when. */ if (! NILP (Vpurify_flag)) error ("Attempt to autoload %s while preparing to dump", - XSTRING (SYMBOL_NAME (funname))->data); + SDATA (SYMBOL_NAME (funname))); fun = funname; CHECK_SYMBOL (funname); @@ -1959,7 +1959,7 @@ if (!NILP (Fequal (fun, fundef))) error ("Autoloading failed to define function %s", - XSTRING (SYMBOL_NAME (funname))->data); + SDATA (SYMBOL_NAME (funname))); UNGCPRO; } @@ -2938,7 +2938,7 @@ { tem = AREF (object, COMPILED_BYTECODE); if (CONSP (tem) && STRINGP (XCAR (tem))) - error ("Invalid byte code in %s", XSTRING (XCAR (tem))->data); + error ("Invalid byte code in %s", SDATA (XCAR (tem))); else error ("Invalid byte code"); }
--- a/src/fileio.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/fileio.c Mon Jul 15 00:00:41 2002 +0000 @@ -269,8 +269,8 @@ default: /* System error messages are capitalized. Downcase the initial unless it is followed by a slash. */ - if (XSTRING (errstring)->data[1] != '/') - XSTRING (errstring)->data[0] = DOWNCASE (XSTRING (errstring)->data[0]); + if (SREF (errstring, 1) != '/') + SREF (errstring, 0) = DOWNCASE (SREF (errstring, 0)); Fsignal (Qfile_error, Fcons (build_string (string), Fcons (errstring, data))); @@ -408,11 +408,11 @@ #ifdef FILE_SYSTEM_CASE filename = FILE_SYSTEM_CASE (filename); #endif - beg = XSTRING (filename)->data; + beg = SDATA (filename); #ifdef DOS_NT beg = strcpy (alloca (strlen (beg) + 1), beg); #endif - p = beg + STRING_BYTES (XSTRING (filename)); + p = beg + SBYTES (filename); while (p != beg && !IS_DIRECTORY_SEP (p[-1]) #ifdef VMS @@ -480,8 +480,8 @@ if (!NILP (handler)) return call2 (handler, Qfile_name_nondirectory, filename); - beg = XSTRING (filename)->data; - end = p = beg + STRING_BYTES (XSTRING (filename)); + beg = SDATA (filename); + end = p = beg + SBYTES (filename); while (p != beg && !IS_DIRECTORY_SEP (p[-1]) #ifdef VMS @@ -637,8 +637,8 @@ if (!NILP (handler)) return call2 (handler, Qfile_name_as_directory, file); - buf = (char *) alloca (STRING_BYTES (XSTRING (file)) + 10); - return build_string (file_name_as_directory (buf, XSTRING (file)->data)); + buf = (char *) alloca (SBYTES (file) + 10); + return build_string (file_name_as_directory (buf, SDATA (file))); } /* @@ -833,11 +833,11 @@ /* 20 extra chars is insufficient for VMS, since we might perform a logical name translation. an equivalence string can be up to 255 chars long, so grab that much extra space... - sss */ - buf = (char *) alloca (STRING_BYTES (XSTRING (directory)) + 20 + 255); + buf = (char *) alloca (SBYTES (directory) + 20 + 255); #else - buf = (char *) alloca (STRING_BYTES (XSTRING (directory)) + 20); + buf = (char *) alloca (SBYTES (directory) + 20); #endif - directory_file_name (XSTRING (directory)->data, buf); + directory_file_name (SDATA (directory), buf); return build_string (buf); } @@ -912,10 +912,10 @@ #endif } - len = XSTRING (prefix)->size; + len = SCHARS (prefix); val = make_uninit_string (len + 3 + pidlen); - data = XSTRING (val)->data; - bcopy(XSTRING (prefix)->data, data, len); + data = SDATA (val); + bcopy(SDATA (prefix), data, len); p = data + len; bcopy (pidbuf, p, pidlen); @@ -970,7 +970,7 @@ } error ("Cannot create temporary name for prefix `%s'", - XSTRING (prefix)->data); + SDATA (prefix)); return Qnil; } @@ -1073,7 +1073,7 @@ return call3 (handler, Qexpand_file_name, name, default_directory); } - o = XSTRING (default_directory)->data; + o = SDATA (default_directory); /* Make sure DEFAULT_DIRECTORY is properly expanded. It would be better to do this down below where we actually use @@ -1118,7 +1118,7 @@ name = FILE_SYSTEM_CASE (name); #endif - nm = XSTRING (name)->data; + nm = SDATA (name); #ifdef DOS_NT /* We will force directory separators to be either all \ or /, so make @@ -1292,21 +1292,21 @@ #ifdef WINDOWSNT if (IS_DIRECTORY_SEP (nm[1])) { - if (strcmp (nm, XSTRING (name)->data) != 0) + if (strcmp (nm, SDATA (name)) != 0) name = build_string (nm); } else #endif /* drive must be set, so this is okay */ - if (strcmp (nm - 2, XSTRING (name)->data) != 0) + if (strcmp (nm - 2, SDATA (name)) != 0) { name = make_string (nm - 2, p - nm + 2); - XSTRING (name)->data[0] = DRIVE_LETTER (drive); - XSTRING (name)->data[1] = ':'; + SREF (name, 0) = DRIVE_LETTER (drive); + SREF (name, 1) = ':'; } return name; #else /* not DOS_NT */ - if (nm == XSTRING (name)->data) + if (nm == SDATA (name)) return name; return build_string (nm); #endif /* not DOS_NT */ @@ -1419,7 +1419,7 @@ #endif && !newdir) { - newdir = XSTRING (default_directory)->data; + newdir = SDATA (default_directory); #ifdef DOS_NT /* Note if special escape prefix is present, but remove for now. */ if (newdir[0] == '/' && newdir[1] == ':') @@ -1726,7 +1726,7 @@ name = Fupcase (name); #endif - nm = XSTRING (name)->data; + nm = SDATA (name); /* If nm is absolute, flush ...// and detect /./ and /../. If no /./ or /../ we can return right away. */ @@ -1835,7 +1835,7 @@ if (index (nm, '/')) return build_string (sys_translate_unix (nm)); #endif /* VMS */ - if (nm == XSTRING (name)->data) + if (nm == SDATA (name)) return name; return build_string (nm); } @@ -1896,7 +1896,7 @@ if (NILP (defalt)) defalt = current_buffer->directory; CHECK_STRING (defalt); - newdir = XSTRING (defalt)->data; + newdir = SDATA (defalt); } /* Now concatenate the directory and name to new space in the stack frame */ @@ -2046,13 +2046,13 @@ if (!NILP (handler)) return call2 (handler, Qsubstitute_in_file_name, filename); - nm = XSTRING (filename)->data; + nm = SDATA (filename); #ifdef DOS_NT nm = strcpy (alloca (strlen (nm) + 1), nm); CORRECT_DIR_SEPS (nm); - substituted = (strcmp (nm, XSTRING (filename)->data) != 0); + substituted = (strcmp (nm, SDATA (filename)) != 0); #endif - endp = nm + STRING_BYTES (XSTRING (filename)); + endp = nm + SBYTES (filename); /* If /~ or // appears, discard everything through first slash. */ @@ -2168,7 +2168,7 @@ /* If substitution required, recopy the string and do it */ /* Make space in stack frame for the new copy */ - xnm = (unsigned char *) alloca (STRING_BYTES (XSTRING (filename)) + total + 1); + xnm = (unsigned char *) alloca (SBYTES (filename) + total + 1); x = xnm; /* Copy the rest of the name through, replacing $ constructs with values */ @@ -2279,16 +2279,16 @@ absname = Fexpand_file_name (filename, defdir); #ifdef VMS { - register int c = XSTRING (absname)->data[STRING_BYTES (XSTRING (absname)) - 1]; + register int c = SREF (absname, SBYTES (absname) - 1); if (c == ':' || c == ']' || c == '>') absname = Fdirectory_file_name (absname); } #else /* Remove final slash, if any (unless this is the root dir). stat behaves differently depending! */ - if (XSTRING (absname)->size > 1 - && IS_DIRECTORY_SEP (XSTRING (absname)->data[STRING_BYTES (XSTRING (absname)) - 1]) - && !IS_DEVICE_SEP (XSTRING (absname)->data[STRING_BYTES (XSTRING (absname))-2])) + if (SCHARS (absname) > 1 + && IS_DIRECTORY_SEP (SREF (absname, SBYTES (absname) - 1)) + && !IS_DEVICE_SEP (SREF (absname, SBYTES (absname)-2))) /* We cannot take shortcuts; they might be wrong for magic file names. */ absname = Fdirectory_file_name (absname); #endif @@ -2323,7 +2323,7 @@ /* stat is a good way to tell whether the file exists, regardless of what access permissions it has. */ - if (stat (XSTRING (encoded_filename)->data, &statbuf) >= 0) + if (stat (SDATA (encoded_filename), &statbuf) >= 0) { if (! interactive) Fsignal (Qfile_already_exists, @@ -2331,7 +2331,7 @@ Fcons (absname, Qnil))); GCPRO1 (absname); tem = format1 ("File %s already exists; %s anyway? ", - XSTRING (absname)->data, querystring); + SDATA (absname), querystring); if (quick) tem = Fy_or_n_p (tem); else @@ -2404,12 +2404,12 @@ || INTEGERP (ok_if_already_exists)) barf_or_query_if_file_exists (encoded_newname, "copy to it", INTEGERP (ok_if_already_exists), &out_st, 0); - else if (stat (XSTRING (encoded_newname)->data, &out_st) < 0) + else if (stat (SDATA (encoded_newname), &out_st) < 0) out_st.st_mode = 0; #ifdef WINDOWSNT - if (!CopyFile (XSTRING (encoded_file)->data, - XSTRING (encoded_newname)->data, + if (!CopyFile (SDATA (encoded_file), + SDATA (encoded_newname), FALSE)) report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil))); else if (NILP (keep_time)) @@ -2419,7 +2419,7 @@ char * filename; EMACS_GET_TIME (now); - filename = XSTRING (encoded_newname)->data; + filename = SDATA (encoded_newname); /* Ensure file is writable while its modified time is set. */ attributes = GetFileAttributes (filename); @@ -2436,7 +2436,7 @@ SetFileAttributes (filename, attributes); } #else /* not WINDOWSNT */ - ifd = emacs_open (XSTRING (encoded_file)->data, O_RDONLY, 0); + ifd = emacs_open (SDATA (encoded_file), O_RDONLY, 0); if (ifd < 0) report_file_error ("Opening input file", Fcons (file, Qnil)); @@ -2472,13 +2472,13 @@ #ifdef VMS /* Create the copy file with the same record format as the input file */ - ofd = sys_creat (XSTRING (encoded_newname)->data, 0666, ifd); + ofd = sys_creat (SDATA (encoded_newname), 0666, ifd); #else #ifdef MSDOS /* System's default file type was set to binary by _fmode in emacs.c. */ - ofd = creat (XSTRING (encoded_newname)->data, S_IREAD | S_IWRITE); + ofd = creat (SDATA (encoded_newname), S_IREAD | S_IWRITE); #else /* not MSDOS */ - ofd = creat (XSTRING (encoded_newname)->data, 0666); + ofd = creat (SDATA (encoded_newname), 0666); #endif /* not MSDOS */ #endif /* VMS */ if (ofd < 0) @@ -2504,14 +2504,14 @@ EMACS_TIME atime, mtime; EMACS_SET_SECS_USECS (atime, st.st_atime, 0); EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); - if (set_file_times (XSTRING (encoded_newname)->data, + if (set_file_times (SDATA (encoded_newname), atime, mtime)) Fsignal (Qfile_date_error, Fcons (build_string ("Cannot set file date"), Fcons (newname, Qnil))); } #ifndef MSDOS - chmod (XSTRING (encoded_newname)->data, st.st_mode & 07777); + chmod (SDATA (encoded_newname), st.st_mode & 07777); #else /* MSDOS */ #if defined (__DJGPP__) && __DJGPP__ > 1 /* In DJGPP v2.0 and later, fstat usually returns true file mode bits, @@ -2519,7 +2519,7 @@ get only the READ bit, which will make the copied file read-only, so it's better not to chmod at all. */ if ((_djstat_flags & _STFAIL_WRITEBIT) == 0) - chmod (XSTRING (encoded_newname)->data, st.st_mode & 07777); + chmod (SDATA (encoded_newname), st.st_mode & 07777); #endif /* DJGPP version 2 or newer */ #endif /* MSDOS */ } @@ -2553,7 +2553,7 @@ encoded_dir = ENCODE_FILE (directory); - dir = XSTRING (encoded_dir)->data; + dir = SDATA (encoded_dir); #ifdef WINDOWSNT if (mkdir (dir) != 0) @@ -2583,7 +2583,7 @@ encoded_dir = ENCODE_FILE (directory); - dir = XSTRING (encoded_dir)->data; + dir = SDATA (encoded_dir); if (rmdir (dir) != 0) report_file_error ("Removing directory", Flist (1, &directory)); @@ -2609,7 +2609,7 @@ encoded_file = ENCODE_FILE (filename); - if (0 > unlink (XSTRING (encoded_file)->data)) + if (0 > unlink (SDATA (encoded_file))) report_file_error ("Removing old name", Flist (1, &filename)); return Qnil; } @@ -2679,10 +2679,10 @@ barf_or_query_if_file_exists (encoded_newname, "rename to it", INTEGERP (ok_if_already_exists), 0, 0); #ifndef BSD4_1 - if (0 > rename (XSTRING (encoded_file)->data, XSTRING (encoded_newname)->data)) + if (0 > rename (SDATA (encoded_file), SDATA (encoded_newname))) #else - if (0 > link (XSTRING (encoded_file)->data, XSTRING (encoded_newname)->data) - || 0 > unlink (XSTRING (encoded_file)->data)) + if (0 > link (SDATA (encoded_file), SDATA (encoded_newname)) + || 0 > unlink (SDATA (encoded_file))) #endif { if (errno == EXDEV) @@ -2754,8 +2754,8 @@ barf_or_query_if_file_exists (encoded_newname, "make it a new name", INTEGERP (ok_if_already_exists), 0, 0); - unlink (XSTRING (newname)->data); - if (0 > link (XSTRING (encoded_file)->data, XSTRING (encoded_newname)->data)) + unlink (SDATA (newname)); + if (0 > link (SDATA (encoded_file), SDATA (encoded_newname))) { #ifdef NO_ARG_ARRAY args[0] = file; @@ -2795,7 +2795,7 @@ /* If the link target has a ~, we must expand it to get a truly valid file name. Otherwise, do not expand; we want to permit links to relative file names. */ - if (XSTRING (filename)->data[0] == '~') + if (SREF (filename, 0) == '~') filename = Fexpand_file_name (filename, Qnil); linkname = Fexpand_file_name (linkname, Qnil); @@ -2820,15 +2820,15 @@ || INTEGERP (ok_if_already_exists)) barf_or_query_if_file_exists (encoded_linkname, "make it a link", INTEGERP (ok_if_already_exists), 0, 0); - if (0 > symlink (XSTRING (encoded_filename)->data, - XSTRING (encoded_linkname)->data)) + if (0 > symlink (SDATA (encoded_filename), + SDATA (encoded_linkname))) { /* If we didn't complain already, silently delete existing file. */ if (errno == EEXIST) { - unlink (XSTRING (encoded_linkname)->data); - if (0 <= symlink (XSTRING (encoded_filename)->data, - XSTRING (encoded_linkname)->data)) + unlink (SDATA (encoded_linkname)); + if (0 <= symlink (SDATA (encoded_filename), + SDATA (encoded_linkname))) { UNGCPRO; return Qnil; @@ -2860,15 +2860,15 @@ { CHECK_STRING (name); if (NILP (string)) - delete_logical_name (XSTRING (name)->data); + delete_logical_name (SDATA (name)); else { CHECK_STRING (string); - if (XSTRING (string)->size == 0) - delete_logical_name (XSTRING (name)->data); + if (SCHARS (string) == 0) + delete_logical_name (SDATA (name)); else - define_logical_name (XSTRING (name)->data, XSTRING (string)->data); + define_logical_name (SDATA (name), SDATA (string)); } return string; @@ -2887,7 +2887,7 @@ CHECK_STRING (path); CHECK_STRING (login); - netresult = netunam (XSTRING (path)->data, XSTRING (login)->data); + netresult = netunam (SDATA (path), SDATA (login)); if (netresult == -1) return Qnil; @@ -2906,7 +2906,7 @@ unsigned char *ptr; CHECK_STRING (filename); - ptr = XSTRING (filename)->data; + ptr = SDATA (filename); if (IS_DIRECTORY_SEP (*ptr) || *ptr == '~' #ifdef VMS /* ??? This criterion is probably wrong for '<'. */ @@ -3003,7 +3003,7 @@ absname = ENCODE_FILE (absname); - return (stat (XSTRING (absname)->data, &statbuf) >= 0) ? Qt : Qnil; + return (stat (SDATA (absname), &statbuf) >= 0) ? Qt : Qnil; } DEFUN ("file-executable-p", Ffile_executable_p, Sfile_executable_p, 1, 1, 0, @@ -3026,7 +3026,7 @@ absname = ENCODE_FILE (absname); - return (check_executable (XSTRING (absname)->data) ? Qt : Qnil); + return (check_executable (SDATA (absname)) ? Qt : Qnil); } DEFUN ("file-readable-p", Ffile_readable_p, Sfile_readable_p, 1, 1, 0, @@ -3055,7 +3055,7 @@ #if defined(DOS_NT) || defined(macintosh) /* Under MS-DOS, Windows, and Macintosh, open does not work for directories. */ - if (access (XSTRING (absname)->data, 0) == 0) + if (access (SDATA (absname), 0) == 0) return Qt; return Qnil; #else /* not DOS_NT and not macintosh */ @@ -3064,13 +3064,13 @@ /* Opening a fifo without O_NONBLOCK can wait. We don't want to wait. But we don't want to mess wth O_NONBLOCK except in the case of a fifo, on a system which handles it. */ - desc = stat (XSTRING (absname)->data, &statbuf); + desc = stat (SDATA (absname), &statbuf); if (desc < 0) return Qnil; if (S_ISFIFO (statbuf.st_mode)) flags |= O_NONBLOCK; #endif - desc = emacs_open (XSTRING (absname)->data, flags, 0); + desc = emacs_open (SDATA (absname), flags, 0); if (desc < 0) return Qnil; emacs_close (desc); @@ -3099,8 +3099,8 @@ return call2 (handler, Qfile_writable_p, absname); encoded = ENCODE_FILE (absname); - if (stat (XSTRING (encoded)->data, &statbuf) >= 0) - return (check_writable (XSTRING (encoded)->data) + if (stat (SDATA (encoded), &statbuf) >= 0) + return (check_writable (SDATA (encoded)) ? Qt : Qnil); dir = Ffile_name_directory (absname); @@ -3118,11 +3118,11 @@ /* The read-only attribute of the parent directory doesn't affect whether a file or directory can be created within it. Some day we should check ACLs though, which do affect this. */ - if (stat (XSTRING (dir)->data, &statbuf) < 0) + if (stat (SDATA (dir), &statbuf) < 0) return Qnil; return (statbuf.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil; #else - return (check_writable (!NILP (dir) ? (char *) XSTRING (dir)->data : "") + return (check_writable (!NILP (dir) ? (char *) SDATA (dir) : "") ? Qt : Qnil); #endif } @@ -3150,9 +3150,9 @@ encoded_filename = ENCODE_FILE (absname); - fd = emacs_open (XSTRING (encoded_filename)->data, O_RDONLY, 0); + fd = emacs_open (SDATA (encoded_filename), O_RDONLY, 0); if (fd < 0) - report_file_error (XSTRING (string)->data, Fcons (filename, Qnil)); + report_file_error (SDATA (string), Fcons (filename, Qnil)); emacs_close (fd); return Qnil; @@ -3192,7 +3192,7 @@ bzero (buf, bufsize); errno = 0; - valsize = readlink (XSTRING (filename)->data, buf, bufsize); + valsize = readlink (SDATA (filename), buf, bufsize); if (valsize == -1) { #ifdef ERANGE @@ -3241,7 +3241,7 @@ absname = ENCODE_FILE (absname); - if (stat (XSTRING (absname)->data, &st) < 0) + if (stat (SDATA (absname), &st) < 0) return Qnil; return (st.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil; } @@ -3307,7 +3307,7 @@ /* Tell stat to use expensive method to get accurate info. */ Vw32_get_true_file_attributes = Qt; - result = stat (XSTRING (absname)->data, &st); + result = stat (SDATA (absname), &st); Vw32_get_true_file_attributes = tem; if (result < 0) @@ -3315,7 +3315,7 @@ return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil; } #else - if (stat (XSTRING (absname)->data, &st) < 0) + if (stat (SDATA (absname), &st) < 0) return Qnil; return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil; #endif @@ -3340,10 +3340,10 @@ absname = ENCODE_FILE (absname); - if (stat (XSTRING (absname)->data, &st) < 0) + if (stat (SDATA (absname), &st) < 0) return Qnil; #if defined (MSDOS) && __DJGPP__ < 2 - if (check_executable (XSTRING (absname)->data)) + if (check_executable (SDATA (absname))) st.st_mode |= S_IEXEC; #endif /* MSDOS && __DJGPP__ < 2 */ @@ -3370,7 +3370,7 @@ encoded_absname = ENCODE_FILE (absname); - if (chmod (XSTRING (encoded_absname)->data, XINT (mode)) < 0) + if (chmod (SDATA (encoded_absname), XINT (mode)) < 0) report_file_error ("Doing chmod", Fcons (absname, Qnil)); return Qnil; @@ -3456,12 +3456,12 @@ absname2 = ENCODE_FILE (absname2); UNGCPRO; - if (stat (XSTRING (absname1)->data, &st) < 0) + if (stat (SDATA (absname1), &st) < 0) return Qnil; mtime1 = st.st_mtime; - if (stat (XSTRING (absname2)->data, &st) < 0) + if (stat (SDATA (absname2), &st) < 0) return Qt; return (mtime1 > st.st_mtime) ? Qt : Qnil; @@ -3640,15 +3640,15 @@ /* Tell stat to use expensive method to get accurate info. */ Vw32_get_true_file_attributes = Qt; - total = stat (XSTRING (filename)->data, &st); + total = stat (SDATA (filename), &st); Vw32_get_true_file_attributes = tem; } if (total < 0) #else #ifndef APOLLO - if (stat (XSTRING (filename)->data, &st) < 0) + if (stat (SDATA (filename), &st) < 0) #else - if ((fd = emacs_open (XSTRING (filename)->data, O_RDONLY, 0)) < 0 + if ((fd = emacs_open (SDATA (filename), O_RDONLY, 0)) < 0 || fstat (fd, &st) < 0) #endif /* not APOLLO */ #endif /* WINDOWSNT */ @@ -3683,7 +3683,7 @@ #endif if (fd < 0) - if ((fd = emacs_open (XSTRING (filename)->data, O_RDONLY, 0)) < 0) + if ((fd = emacs_open (SDATA (filename), O_RDONLY, 0)) < 0) goto badopen; /* Replacement should preserve point as it preserves markers. */ @@ -3779,7 +3779,7 @@ if (nread < 0) error ("IO error reading %s: %s", - XSTRING (orig_filename)->data, emacs_strerror (errno)); + SDATA (orig_filename), emacs_strerror (errno)); else if (nread > 0) { struct buffer *prev = current_buffer; @@ -3896,7 +3896,7 @@ nread = emacs_read (fd, buffer, sizeof buffer); if (nread < 0) error ("IO error reading %s: %s", - XSTRING (orig_filename)->data, emacs_strerror (errno)); + SDATA (orig_filename), emacs_strerror (errno)); else if (nread == 0) break; @@ -3967,7 +3967,7 @@ nread = emacs_read (fd, buffer + total_read, trial - total_read); if (nread < 0) error ("IO error reading %s: %s", - XSTRING (orig_filename)->data, emacs_strerror (errno)); + SDATA (orig_filename), emacs_strerror (errno)); else if (nread == 0) break; total_read += nread; @@ -4150,7 +4150,7 @@ if (how_much == -1) error ("IO error reading %s: %s", - XSTRING (orig_filename)->data, emacs_strerror (errno)); + SDATA (orig_filename), emacs_strerror (errno)); else if (how_much == -2) error ("maximum buffer size exceeded"); } @@ -4370,7 +4370,7 @@ if (how_much < 0) error ("IO error reading %s: %s", - XSTRING (orig_filename)->data, emacs_strerror (errno)); + SDATA (orig_filename), emacs_strerror (errno)); notfound: @@ -4493,7 +4493,7 @@ if (!EQ (current_buffer->undo_list, Qt)) current_buffer->undo_list = Qnil; #ifdef APOLLO - stat (XSTRING (filename)->data, &st); + stat (SDATA (filename), &st); #endif if (NILP (handler)) @@ -4880,7 +4880,7 @@ encoded_filename = ENCODE_FILE (filename); - fn = XSTRING (encoded_filename)->data; + fn = SDATA (encoded_filename); desc = -1; if (!NILP (append)) #ifdef DOS_NT @@ -4897,7 +4897,7 @@ desc = emacs_open (fn, O_RDWR, 0); if (desc < 0) desc = creat_copy_attrs (STRINGP (current_buffer->filename) - ? XSTRING (current_buffer->filename)->data : 0, + ? SDATA (current_buffer->filename) : 0, fn); } else /* Write to temporary name and rename if no errors */ @@ -4909,8 +4909,8 @@ { temp_name = Fmake_temp_name (concat2 (temp_name, build_string ("$$SAVE$$"))); - fname = XSTRING (filename)->data; - fn = XSTRING (temp_name)->data; + fname = SDATA (filename); + fn = SDATA (temp_name); desc = creat_copy_attrs (fname, fn); if (desc < 0) { @@ -5019,7 +5019,7 @@ if (STRINGP (start)) { - failure = 0 > a_write (desc, start, 0, XSTRING (start)->size, + failure = 0 > a_write (desc, start, 0, SCHARS (start), &annotations, &coding); save_errno = errno; } @@ -5129,7 +5129,7 @@ current_buffer->modtime = st.st_mtime; if (failure) - error ("IO error writing %s: %s", XSTRING (filename)->data, + error ("IO error writing %s: %s", SDATA (filename), emacs_strerror (save_errno)); if (visiting) @@ -5304,7 +5304,7 @@ tem = Fcdr (Fcar (*annot)); if (STRINGP (tem)) { - if (0 > e_write (desc, tem, 0, XSTRING (tem)->size, coding)) + if (0 > e_write (desc, tem, 0, SCHARS (tem), coding)) return -1; } *annot = Fcdr (*annot); @@ -5340,8 +5340,8 @@ if (STRINGP (string)) { - addr = XSTRING (string)->data; - nbytes = STRING_BYTES (XSTRING (string)); + addr = SDATA (string); + nbytes = SBYTES (string); coding->src_multibyte = STRING_MULTIBYTE (string); } else if (start < end) @@ -5429,7 +5429,7 @@ filename = ENCODE_FILE (b->filename); - if (stat (XSTRING (filename)->data, &st) < 0) + if (stat (SDATA (filename), &st) < 0) { /* If the file doesn't exist now and didn't exist before, we say that it isn't modified, provided the error is a tame one. */ @@ -5497,7 +5497,7 @@ filename = ENCODE_FILE (filename); - if (stat (XSTRING (filename)->data, &st) >= 0) + if (stat (SDATA (filename), &st) >= 0) current_buffer->modtime = st.st_mtime; } @@ -5519,14 +5519,14 @@ args[2] = Ferror_message_string (error); msg = Fformat (3, args); GCPRO1 (msg); - nbytes = STRING_BYTES (XSTRING (msg)); + nbytes = SBYTES (msg); for (i = 0; i < 3; ++i) { if (i == 0) - message2 (XSTRING (msg)->data, nbytes, STRING_MULTIBYTE (msg)); + message2 (SDATA (msg), nbytes, STRING_MULTIBYTE (msg)); else - message2_nolog (XSTRING (msg)->data, nbytes, STRING_MULTIBYTE (msg)); + message2_nolog (SDATA (msg), nbytes, STRING_MULTIBYTE (msg)); Fsleep_for (make_number (1), Qnil); } @@ -5541,7 +5541,7 @@ /* Get visited file's mode to become the auto save file's mode. */ if (! NILP (current_buffer->filename) - && stat (XSTRING (current_buffer->filename)->data, &st) >= 0) + && stat (SDATA (current_buffer->filename), &st) >= 0) /* But make sure we can overwrite it later! */ auto_save_mode_bits = st.st_mode | 0600; else @@ -5635,7 +5635,7 @@ call2 (Qmake_directory, dir, Qt); } - stream = fopen (XSTRING (listfile)->data, "w"); + stream = fopen (SDATA (listfile), "w"); if (stream != NULL) { /* Arrange to close that file whether or not we get an error. @@ -5678,12 +5678,12 @@ { if (!NILP (b->filename)) { - fwrite (XSTRING (b->filename)->data, 1, - STRING_BYTES (XSTRING (b->filename)), stream); + fwrite (SDATA (b->filename), 1, + SBYTES (b->filename), stream); } putc ('\n', stream); - fwrite (XSTRING (b->auto_save_file_name)->data, 1, - STRING_BYTES (XSTRING (b->auto_save_file_name)), stream); + fwrite (SDATA (b->auto_save_file_name), 1, + SBYTES (b->auto_save_file_name), stream); putc ('\n', stream); } @@ -5817,17 +5817,17 @@ register int n; int osize, count; - osize = STRING_BYTES (XSTRING (val)); + osize = SBYTES (val); /* Count the number of $ characters. */ - for (n = osize, count = 0, old = XSTRING (val)->data; n > 0; n--) + for (n = osize, count = 0, old = SDATA (val); n > 0; n--) if (*old++ == '$') count++; if (count > 0) { - old = XSTRING (val)->data; - val = make_uninit_multibyte_string (XSTRING (val)->size + count, + old = SDATA (val); + val = make_uninit_multibyte_string (SCHARS (val) + count, osize + count); - new = XSTRING (val)->data; + new = SDATA (val); for (n = osize; n > 0; n--) if (*old != '$') *new++ = *old++; @@ -5870,7 +5870,7 @@ /* No need to protect ACTION--we only compare it with t and nil. */ GCPRO5 (string, realdir, name, specdir, orig_string); - if (XSTRING (string)->size == 0) + if (SCHARS (string) == 0) { if (EQ (action, Qlambda)) { @@ -5931,8 +5931,8 @@ Lisp_Object tem = XCAR (all); int len; if (STRINGP (tem) && - (len = XSTRING (tem)->size, len > 0) && - IS_DIRECTORY_SEP (XSTRING (tem)->data[len-1])) + (len = SCHARS (tem), len > 0) && + IS_DIRECTORY_SEP (SREF (tem, len-1))) comp = Fcons (tem, comp); } } @@ -5957,7 +5957,7 @@ #ifdef VMS /* Supposedly this helps commands such as `cd' that read directory names, but can someone explain how it helps them? -- RMS */ - if (XSTRING (name)->size == 0) + if (SCHARS (name) == 0) return Qt; #endif /* VMS */ if (!NILP (Vread_file_name_predicate)) @@ -6014,23 +6014,23 @@ #endif if (homedir != 0 && STRINGP (dir) - && !strncmp (homedir, XSTRING (dir)->data, strlen (homedir)) - && IS_DIRECTORY_SEP (XSTRING (dir)->data[strlen (homedir)])) + && !strncmp (homedir, SDATA (dir), strlen (homedir)) + && IS_DIRECTORY_SEP (SDATA (dir)[strlen (homedir)])) { - dir = make_string (XSTRING (dir)->data + strlen (homedir) - 1, - STRING_BYTES (XSTRING (dir)) - strlen (homedir) + 1); - XSTRING (dir)->data[0] = '~'; + dir = make_string (SDATA (dir) + strlen (homedir) - 1, + SBYTES (dir) - strlen (homedir) + 1); + SREF (dir, 0) = '~'; } /* Likewise for default_filename. */ if (homedir != 0 && STRINGP (default_filename) - && !strncmp (homedir, XSTRING (default_filename)->data, strlen (homedir)) - && IS_DIRECTORY_SEP (XSTRING (default_filename)->data[strlen (homedir)])) + && !strncmp (homedir, SDATA (default_filename), strlen (homedir)) + && IS_DIRECTORY_SEP (SDATA (default_filename)[strlen (homedir)])) { default_filename - = make_string (XSTRING (default_filename)->data + strlen (homedir) - 1, - STRING_BYTES (XSTRING (default_filename)) - strlen (homedir) + 1); - XSTRING (default_filename)->data[0] = '~'; + = make_string (SDATA (default_filename) + strlen (homedir) - 1, + SBYTES (default_filename) - strlen (homedir) + 1); + SREF (default_filename, 0) = '~'; } if (!NILP (default_filename)) { @@ -6048,7 +6048,7 @@ args[0] = insdef; args[1] = initial; insdef = Fconcat (2, args); - pos = make_number (XSTRING (double_dollars (dir))->size); + pos = make_number (SCHARS (double_dollars (dir))); insdef = Fcons (double_dollars (insdef), pos); } else @@ -6093,7 +6093,7 @@ /* If DIR contains a file name, split it. */ Lisp_Object file; file = Ffile_name_nondirectory (dir); - if (XSTRING (file)->size && NILP (default_filename)) + if (SCHARS (file) && NILP (default_filename)) { default_filename = file; dir = Ffile_name_directory (dir); @@ -6137,7 +6137,7 @@ if (!NILP (tem) && !NILP (default_filename)) val = default_filename; - else if (XSTRING (val)->size == 0 && NILP (insdef)) + else if (SCHARS (val) == 0 && NILP (insdef)) { if (!NILP (default_filename)) val = default_filename;
--- a/src/filelock.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/filelock.c Mon Jul 15 00:00:41 2002 +0000 @@ -222,7 +222,7 @@ args[3] = Qnil; args[4] = build_string ("-c"); sprintf (cmd_string, "gunzip < %s.%d.gz > %s", - WTMP_FILE, counter, XSTRING (tempname)->data); + WTMP_FILE, counter, SDATA (tempname)); args[5] = build_string (cmd_string); Fcall_process (6, args); filename = tempname; @@ -232,9 +232,9 @@ if (! NILP (filename)) { - get_boot_time_1 (XSTRING (filename)->data, 1); + get_boot_time_1 (SDATA (filename), 1); if (delete_flag) - unlink (XSTRING (filename)->data); + unlink (SDATA (filename)); } } @@ -325,7 +325,7 @@ trailing period plus one for the digit after it plus one for the null. */ #define MAKE_LOCK_NAME(lock, file) \ - (lock = (char *) alloca (STRING_BYTES (XSTRING (file)) + 2 + 1 + 1 + 1), \ + (lock = (char *) alloca (SBYTES (file) + 2 + 1 + 1 + 1), \ fill_in_lock_file_name (lock, (file))) static void @@ -337,7 +337,7 @@ struct stat st; int count = 0; - strcpy (lockfile, XSTRING (fn)->data); + strcpy (lockfile, SDATA (fn)); /* Shift the nondirectory part of the file name (including the null) right two characters. Here is one of the places where we'd have to @@ -378,11 +378,11 @@ char *lock_info_str; if (STRINGP (Fuser_login_name (Qnil))) - user_name = (char *)XSTRING (Fuser_login_name (Qnil))->data; + user_name = (char *)SDATA (Fuser_login_name (Qnil)); else user_name = ""; if (STRINGP (Fsystem_name ())) - host_name = (char *)XSTRING (Fsystem_name ())->data; + host_name = (char *)SDATA (Fsystem_name ()); else host_name = ""; lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) @@ -503,7 +503,7 @@ /* On current host? */ if (STRINGP (Fsystem_name ()) - && strcmp (owner->host, XSTRING (Fsystem_name ())->data) == 0) + && strcmp (owner->host, SDATA (Fsystem_name ())) == 0) { if (owner->pid == getpid ()) ret = 2; /* We own it. */
--- a/src/fns.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/fns.c Mon Jul 15 00:00:41 2002 +0000 @@ -132,7 +132,7 @@ retry: if (STRINGP (sequence)) - XSETFASTINT (val, XSTRING (sequence)->size); + XSETFASTINT (val, SCHARS (sequence)); else if (VECTORP (sequence)) XSETFASTINT (val, XVECTOR (sequence)->size); else if (CHAR_TABLE_P (sequence)) @@ -208,7 +208,7 @@ Lisp_Object string; { CHECK_STRING (string); - return make_number (STRING_BYTES (XSTRING (string))); + return make_number (SBYTES (string)); } DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0, @@ -225,9 +225,9 @@ CHECK_STRING (s1); CHECK_STRING (s2); - if (XSTRING (s1)->size != XSTRING (s2)->size - || STRING_BYTES (XSTRING (s1)) != STRING_BYTES (XSTRING (s2)) - || bcmp (XSTRING (s1)->data, XSTRING (s2)->data, STRING_BYTES (XSTRING (s1)))) + if (SCHARS (s1) != SCHARS (s2) + || SBYTES (s1) != SBYTES (s2) + || bcmp (SDATA (s1), SDATA (s2), SBYTES (s1))) return Qnil; return Qt; } @@ -272,11 +272,11 @@ i1_byte = string_char_to_byte (str1, i1); i2_byte = string_char_to_byte (str2, i2); - end1_char = XSTRING (str1)->size; + end1_char = SCHARS (str1); if (! NILP (end1) && end1_char > XINT (end1)) end1_char = XINT (end1); - end2_char = XSTRING (str2)->size; + end2_char = SCHARS (str2); if (! NILP (end2) && end2_char > XINT (end2)) end2_char = XINT (end2); @@ -290,7 +290,7 @@ FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c1, str1, i1, i1_byte); else { - c1 = XSTRING (str1)->data[i1++]; + c1 = SREF (str1, i1++); c1 = unibyte_char_to_multibyte (c1); } @@ -298,7 +298,7 @@ FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c2, str2, i2, i2_byte); else { - c2 = XSTRING (str2)->data[i2++]; + c2 = SREF (str2, i2++); c2 = unibyte_char_to_multibyte (c2); } @@ -354,9 +354,9 @@ i1 = i1_byte = i2 = i2_byte = 0; - end = XSTRING (s1)->size; - if (end > XSTRING (s2)->size) - end = XSTRING (s2)->size; + end = SCHARS (s1); + if (end > SCHARS (s2)) + end = SCHARS (s2); while (i1 < end) { @@ -370,7 +370,7 @@ if (c1 != c2) return c1 < c2 ? Qt : Qnil; } - return i1 < XSTRING (s2)->size ? Qt : Qnil; + return i1 < SCHARS (s2) ? Qt : Qnil; } static Lisp_Object concat (); @@ -641,11 +641,11 @@ if (STRING_MULTIBYTE (this)) { some_multibyte = 1; - result_len_byte += STRING_BYTES (XSTRING (this)); + result_len_byte += SBYTES (this); } else - result_len_byte += count_size_as_multibyte (XSTRING (this)->data, - XSTRING (this)->size); + result_len_byte += count_size_as_multibyte (SDATA (this), + SCHARS (this)); } } @@ -695,17 +695,17 @@ if (STRINGP (this) && STRINGP (val) && STRING_MULTIBYTE (this) == some_multibyte) { - int thislen_byte = STRING_BYTES (XSTRING (this)); + int thislen_byte = SBYTES (this); int combined; - bcopy (XSTRING (this)->data, XSTRING (val)->data + toindex_byte, - STRING_BYTES (XSTRING (this))); + bcopy (SDATA (this), SDATA (val) + toindex_byte, + SBYTES (this)); combined = (some_multibyte && toindex_byte > 0 - ? count_combining (XSTRING (val)->data, + ? count_combining (SDATA (val), toindex_byte + thislen_byte, toindex_byte) : 0); - if (! NULL_INTERVAL_P (XSTRING (this)->intervals)) + if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) { textprops[num_textprops].argnum = argnum; /* We ignore text properties on characters being combined. */ @@ -714,20 +714,20 @@ } toindex_byte += thislen_byte; toindex += thisleni - combined; - XSTRING (val)->size -= combined; + SCHARS (val) -= combined; } /* Copy a single-byte string to a multibyte string. */ else if (STRINGP (this) && STRINGP (val)) { - if (! NULL_INTERVAL_P (XSTRING (this)->intervals)) + if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) { textprops[num_textprops].argnum = argnum; textprops[num_textprops].from = 0; textprops[num_textprops++].to = toindex; } - toindex_byte += copy_text (XSTRING (this)->data, - XSTRING (val)->data + toindex_byte, - XSTRING (this)->size, 0, 1); + toindex_byte += copy_text (SDATA (this), + SDATA (val) + toindex_byte, + SCHARS (this), 0, 1); toindex += thisleni; } else @@ -755,7 +755,7 @@ } else { - XSETFASTINT (elt, XSTRING (this)->data[thisindex++]); + XSETFASTINT (elt, SREF (this, thisindex++)); if (some_multibyte && (XINT (elt) >= 0240 || (XINT (elt) >= 0200 @@ -797,14 +797,14 @@ if (some_multibyte) toindex_byte += CHAR_STRING (XINT (elt), - XSTRING (val)->data + toindex_byte); + SDATA (val) + toindex_byte); else - XSTRING (val)->data[toindex_byte++] = XINT (elt); + SREF (val, toindex_byte++) = XINT (elt); if (some_multibyte && toindex_byte > 0 - && count_combining (XSTRING (val)->data, + && count_combining (SDATA (val), toindex_byte, toindex_byte - 1)) - XSTRING (val)->size--; + SCHARS (val)--; else toindex++; } @@ -815,7 +815,7 @@ int c = XINT (elt); /* P exists as a variable to avoid a bug on the Masscomp C compiler. */ - unsigned char *p = & XSTRING (val)->data[toindex_byte]; + unsigned char *p = & SREF (val, toindex_byte); toindex_byte += CHAR_STRING (c, p); toindex++; @@ -836,7 +836,7 @@ this = args[textprops[argnum].argnum]; props = text_property_list (this, make_number (0), - make_number (XSTRING (this)->size), + make_number (SCHARS (this)), Qnil); /* If successive arguments have properites, be sure that the value of `composition' property be the copy. */ @@ -844,7 +844,7 @@ make_composition_value_copy (props); add_text_properties_from_list (val, props, make_number (textprops[argnum].to)); - last_to_end = textprops[argnum].to + XSTRING (this)->size; + last_to_end = textprops[argnum].to + SCHARS (this); } } return val; @@ -875,8 +875,8 @@ return char_index; best_below = best_below_byte = 0; - best_above = XSTRING (string)->size; - best_above_byte = STRING_BYTES (XSTRING (string)); + best_above = SCHARS (string); + best_above_byte = SBYTES (string); if (EQ (string, string_char_byte_cache_string)) { @@ -907,7 +907,7 @@ { while (best_above > char_index) { - unsigned char *pend = XSTRING (string)->data + best_above_byte; + unsigned char *pend = SDATA (string) + best_above_byte; unsigned char *pbeg = pend - best_above_byte; unsigned char *p = pend - 1; int bytes; @@ -948,8 +948,8 @@ return byte_index; best_below = best_below_byte = 0; - best_above = XSTRING (string)->size; - best_above_byte = STRING_BYTES (XSTRING (string)); + best_above = SCHARS (string); + best_above_byte = SBYTES (string); if (EQ (string, string_char_byte_cache_string)) { @@ -980,7 +980,7 @@ { while (best_above_byte > byte_index) { - unsigned char *pend = XSTRING (string)->data + best_above_byte; + unsigned char *pend = SDATA (string) + best_above_byte; unsigned char *pbeg = pend - best_above_byte; unsigned char *p = pend - 1; int bytes; @@ -1020,18 +1020,18 @@ if (STRING_MULTIBYTE (string)) return string; - nbytes = count_size_as_multibyte (XSTRING (string)->data, - XSTRING (string)->size); + nbytes = count_size_as_multibyte (SDATA (string), + SCHARS (string)); /* If all the chars are ASCII, they won't need any more bytes once converted. In that case, we can return STRING itself. */ - if (nbytes == STRING_BYTES (XSTRING (string))) + if (nbytes == SBYTES (string)) return string; buf = (unsigned char *) alloca (nbytes); - copy_text (XSTRING (string)->data, buf, STRING_BYTES (XSTRING (string)), + copy_text (SDATA (string), buf, SBYTES (string), 0, 1); - return make_multibyte_string (buf, XSTRING (string)->size, nbytes); + return make_multibyte_string (buf, SCHARS (string), nbytes); } /* Convert STRING to a single-byte string. */ @@ -1045,12 +1045,12 @@ if (! STRING_MULTIBYTE (string)) return string; - buf = (unsigned char *) alloca (XSTRING (string)->size); - - copy_text (XSTRING (string)->data, buf, STRING_BYTES (XSTRING (string)), + buf = (unsigned char *) alloca (SCHARS (string)); + + copy_text (SDATA (string), buf, SBYTES (string), 1, 0); - return make_unibyte_string (buf, XSTRING (string)->size); + return make_unibyte_string (buf, SCHARS (string)); } DEFUN ("string-make-multibyte", Fstring_make_multibyte, Sstring_make_multibyte, @@ -1096,10 +1096,10 @@ if (STRING_MULTIBYTE (string)) { - int bytes = STRING_BYTES (XSTRING (string)); + int bytes = SBYTES (string); unsigned char *str = (unsigned char *) xmalloc (bytes); - bcopy (XSTRING (string)->data, str, bytes); + bcopy (SDATA (string), str, bytes); bytes = str_as_unibyte (str, bytes); string = make_unibyte_string (str, bytes); xfree (str); @@ -1125,17 +1125,17 @@ Lisp_Object new_string; int nchars, nbytes; - parse_str_as_multibyte (XSTRING (string)->data, - STRING_BYTES (XSTRING (string)), + parse_str_as_multibyte (SDATA (string), + SBYTES (string), &nchars, &nbytes); new_string = make_uninit_multibyte_string (nchars, nbytes); - bcopy (XSTRING (string)->data, XSTRING (new_string)->data, - STRING_BYTES (XSTRING (string))); - if (nbytes != STRING_BYTES (XSTRING (string))) - str_as_multibyte (XSTRING (new_string)->data, nbytes, - STRING_BYTES (XSTRING (string)), NULL); + bcopy (SDATA (string), SDATA (new_string), + SBYTES (string)); + if (nbytes != SBYTES (string)) + str_as_multibyte (SDATA (new_string), nbytes, + SBYTES (string), NULL); string = new_string; - XSTRING (string)->intervals = NULL_INTERVAL; + STRING_INTERVALS (string) = NULL_INTERVAL; } return string; } @@ -1190,8 +1190,8 @@ if (STRINGP (string)) { - size = XSTRING (string)->size; - size_byte = STRING_BYTES (XSTRING (string)); + size = SCHARS (string); + size_byte = SBYTES (string); } else size = XVECTOR (string)->size; @@ -1225,7 +1225,7 @@ if (STRINGP (string)) { - res = make_specified_string (XSTRING (string)->data + from_byte, + res = make_specified_string (SDATA (string) + from_byte, to_char - from_char, to_byte - from_byte, STRING_MULTIBYTE (string)); copy_text_properties (make_number (from_char), make_number (to_char), @@ -1257,8 +1257,8 @@ CHECK_STRING (string); - size = XSTRING (string)->size; - size_byte = STRING_BYTES (XSTRING (string)); + size = SCHARS (string); + size_byte = SBYTES (string); if (NILP (from)) from_char = from_byte = 0; @@ -1292,7 +1292,7 @@ args_out_of_range_3 (string, make_number (from_char), make_number (to_char)); - return make_specified_string (XSTRING (string)->data + from_byte, + return make_specified_string (SDATA (string) + from_byte, to_char - from_char, to_byte - from_byte, STRING_MULTIBYTE (string)); } @@ -1314,8 +1314,8 @@ if (STRINGP (string)) { - size = XSTRING (string)->size; - size_byte = STRING_BYTES (XSTRING (string)); + size = SCHARS (string); + size_byte = SBYTES (string); } else size = XVECTOR (string)->size; @@ -1325,7 +1325,7 @@ if (STRINGP (string)) { - res = make_specified_string (XSTRING (string)->data + from_byte, + res = make_specified_string (SDATA (string) + from_byte, to - from, to_byte - from_byte, STRING_MULTIBYTE (string)); copy_text_properties (make_number (from), make_number (to), @@ -1693,18 +1693,18 @@ int c; for (i = nchars = nbytes = ibyte = 0; - i < XSTRING (seq)->size; + i < SCHARS (seq); ++i, ibyte += cbytes) { if (STRING_MULTIBYTE (seq)) { - c = STRING_CHAR (&XSTRING (seq)->data[ibyte], - STRING_BYTES (XSTRING (seq)) - ibyte); + c = STRING_CHAR (&SREF (seq, ibyte), + SBYTES (seq) - ibyte); cbytes = CHAR_BYTES (c); } else { - c = XSTRING (seq)->data[i]; + c = SREF (seq, i); cbytes = 1; } @@ -1715,34 +1715,34 @@ } } - if (nchars != XSTRING (seq)->size) + if (nchars != SCHARS (seq)) { Lisp_Object tem; tem = make_uninit_multibyte_string (nchars, nbytes); if (!STRING_MULTIBYTE (seq)) - SET_STRING_BYTES (XSTRING (tem), -1); + STRING_SET_UNIBYTE (tem); for (i = nchars = nbytes = ibyte = 0; - i < XSTRING (seq)->size; + i < SCHARS (seq); ++i, ibyte += cbytes) { if (STRING_MULTIBYTE (seq)) { - c = STRING_CHAR (&XSTRING (seq)->data[ibyte], - STRING_BYTES (XSTRING (seq)) - ibyte); + c = STRING_CHAR (&SREF (seq, ibyte), + SBYTES (seq) - ibyte); cbytes = CHAR_BYTES (c); } else { - c = XSTRING (seq)->data[i]; + c = SREF (seq, i); cbytes = 1; } if (!INTEGERP (elt) || c != XINT (elt)) { - unsigned char *from = &XSTRING (seq)->data[ibyte]; - unsigned char *to = &XSTRING (tem)->data[nbytes]; + unsigned char *from = &SREF (seq, ibyte); + unsigned char *to = &SREF (tem, nbytes); EMACS_INT n; ++nchars; @@ -2176,12 +2176,12 @@ break; case Lisp_String: - if (XSTRING (o1)->size != XSTRING (o2)->size) + if (SCHARS (o1) != SCHARS (o2)) return 0; - if (STRING_BYTES (XSTRING (o1)) != STRING_BYTES (XSTRING (o2))) + if (SBYTES (o1) != SBYTES (o2)) return 0; - if (bcmp (XSTRING (o1)->data, XSTRING (o2)->data, - STRING_BYTES (XSTRING (o1)))) + if (bcmp (SDATA (o1), SDATA (o2), + SBYTES (o1))) return 0; return 1; @@ -2221,15 +2221,15 @@ } else if (STRINGP (array)) { - register unsigned char *p = XSTRING (array)->data; + register unsigned char *p = SDATA (array); CHECK_NUMBER (item); charval = XINT (item); - size = XSTRING (array)->size; + size = SCHARS (array); if (STRING_MULTIBYTE (array)) { unsigned char str[MAX_MULTIBYTE_LENGTH]; int len = CHAR_STRING (charval, str); - int size_byte = STRING_BYTES (XSTRING (array)); + int size_byte = SBYTES (array); unsigned char *p1 = p, *endp = p + size_byte; int i; @@ -3113,12 +3113,12 @@ ans = Fdowncase (Fread_from_minibuffer (prompt, Qnil, Qnil, Qnil, Qyes_or_no_p_history, Qnil, Qnil)); - if (XSTRING (ans)->size == 3 && !strcmp (XSTRING (ans)->data, "yes")) + if (SCHARS (ans) == 3 && !strcmp (SDATA (ans), "yes")) { UNGCPRO; return Qt; } - if (XSTRING (ans)->size == 2 && !strcmp (XSTRING (ans)->data, "no")) + if (SCHARS (ans) == 2 && !strcmp (SDATA (ans), "no")) { UNGCPRO; return Qnil; @@ -3257,7 +3257,7 @@ of what files are preloaded and when. */ if (! NILP (Vpurify_flag)) error ("(require %s) while preparing to dump", - XSTRING (SYMBOL_NAME (feature))->data); + SDATA (SYMBOL_NAME (feature))); /* A certain amount of recursive `require' is legitimate, but if we require the same feature recursively 3 times, @@ -3271,7 +3271,7 @@ } if (nesting > 2) error ("Recursive `require' for feature `%s'", - XSTRING (SYMBOL_NAME (feature))->data); + SDATA (SYMBOL_NAME (feature))); /* Update the list for any nested `require's that occur. */ record_unwind_protect (require_unwind, require_nesting_list); @@ -3294,7 +3294,7 @@ tem = Fmemq (feature, Vfeatures); if (NILP (tem)) error ("Required feature `%s' was not provided", - XSTRING (SYMBOL_NAME (feature))->data); + SDATA (SYMBOL_NAME (feature))); /* Once loading finishes, don't undo it. */ Vautoload_queue = Qt; @@ -3557,7 +3557,7 @@ /* We need to allocate enough room for encoding the text. We need 33 1/3% more space, plus a newline every 76 characters, and then we round up. */ - length = STRING_BYTES (XSTRING (string)); + length = SBYTES (string); allength = length + length/3 + 1; allength += allength / MIME_LINE_LENGTH + 1 + 6; @@ -3567,7 +3567,7 @@ else encoded = (char *) xmalloc (allength); - encoded_length = base64_encode_1 (XSTRING (string)->data, + encoded_length = base64_encode_1 (SDATA (string), encoded, length, NILP (no_line_break), STRING_MULTIBYTE (string)); if (encoded_length > allength) @@ -3760,7 +3760,7 @@ CHECK_STRING (string); - length = STRING_BYTES (XSTRING (string)); + length = SBYTES (string); /* We need to allocate enough room for decoding the text. */ if (length <= MAX_ALLOCA) decoded = (char *) alloca (length); @@ -3768,7 +3768,7 @@ decoded = (char *) xmalloc (length); /* The decoded result should be unibyte. */ - decoded_length = base64_decode_1 (XSTRING (string)->data, decoded, length, + decoded_length = base64_decode_1 (SDATA (string), decoded, length, 0, NULL); if (decoded_length > length) abort (); @@ -4772,8 +4772,8 @@ break; case Lisp_Symbol: - hash = sxhash_string (XSTRING (SYMBOL_NAME (obj))->data, - XSTRING (SYMBOL_NAME (obj))->size); + hash = sxhash_string (SDATA (SYMBOL_NAME (obj)), + SCHARS (SYMBOL_NAME (obj))); break; case Lisp_Misc: @@ -4781,7 +4781,7 @@ break; case Lisp_String: - hash = sxhash_string (XSTRING (obj)->data, XSTRING (obj)->size); + hash = sxhash_string (SDATA (obj), SCHARS (obj)); break; /* This can be everything from a vector to an overlay. */ @@ -5206,8 +5206,8 @@ if (STRING_MULTIBYTE (object)) object = code_convert_string1 (object, coding_system, Qnil, 1); - size = XSTRING (object)->size; - size_byte = STRING_BYTES (XSTRING (object)); + size = SCHARS (object); + size_byte = SBYTES (object); if (!NILP (start)) { @@ -5339,8 +5339,8 @@ object = code_convert_string1 (object, coding_system, Qnil, 1); } - md5_buffer (XSTRING (object)->data + start_byte, - STRING_BYTES(XSTRING (object)) - (size_byte - end_byte), + md5_buffer (SDATA (object) + start_byte, + SBYTES (object) - (size_byte - end_byte), digest); for (i = 0; i < 16; i++)
--- a/src/fontset.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/fontset.c Mon Jul 15 00:00:41 2002 +0000 @@ -370,7 +370,7 @@ int force; { Lisp_Object family, registry; - char *p = XSTRING (fontname)->data; + char *p = SDATA (fontname); char *sep[15]; int i = 0; @@ -557,7 +557,7 @@ font name. */ elt = XCDR (elt); xassert (STRINGP (elt)); - fontp = FS_LOAD_FONT (f, c, XSTRING (elt)->data, -1); + fontp = FS_LOAD_FONT (f, c, SDATA (elt), -1); if (!fontp) return Qnil; @@ -616,7 +616,7 @@ if (!fontname && charset == CHARSET_ASCII) { elt = FONTSET_ASCII (fontset); - fontname = XSTRING (XCDR (elt))->data; + fontname = SDATA (XCDR (elt)); } } @@ -705,7 +705,7 @@ the corresponding regular expression. */ static Lisp_Object Vcached_fontset_data; -#define CACHED_FONTSET_NAME (XSTRING (XCAR (Vcached_fontset_data))->data) +#define CACHED_FONTSET_NAME (SDATA (XCAR (Vcached_fontset_data))) #define CACHED_FONTSET_REGEX (XCDR (Vcached_fontset_data)) /* If fontset name PATTERN contains any wild card, return regular @@ -715,21 +715,21 @@ fontset_pattern_regexp (pattern) Lisp_Object pattern; { - if (!index (XSTRING (pattern)->data, '*') - && !index (XSTRING (pattern)->data, '?')) + if (!index (SDATA (pattern), '*') + && !index (SDATA (pattern), '?')) /* PATTERN does not contain any wild cards. */ return Qnil; if (!CONSP (Vcached_fontset_data) - || strcmp (XSTRING (pattern)->data, CACHED_FONTSET_NAME)) + || strcmp (SDATA (pattern), CACHED_FONTSET_NAME)) { /* We must at first update the cached data. */ - char *regex = (char *) alloca (XSTRING (pattern)->size * 2 + 3); + char *regex = (char *) alloca (SCHARS (pattern) * 2 + 3); char *p0, *p1 = regex; /* Convert "*" to ".*", "?" to ".". */ *p1++ = '^'; - for (p0 = (char *) XSTRING (pattern)->data; *p0; p0++) + for (p0 = (char *) SDATA (pattern); *p0; p0++) { if (*p0 == '*') { @@ -744,7 +744,7 @@ *p1++ = '$'; *p1++ = 0; - Vcached_fontset_data = Fcons (build_string (XSTRING (pattern)->data), + Vcached_fontset_data = Fcons (build_string (SDATA (pattern)), build_string (regex)); } @@ -789,10 +789,10 @@ || !BASE_FONTSET_P (fontset)) continue; - this_name = XSTRING (FONTSET_NAME (fontset))->data; + this_name = SDATA (FONTSET_NAME (fontset)); if (regexpp ? fast_c_string_match_ignore_case (name, this_name) >= 0 - : !strcmp (XSTRING (name)->data, this_name)) + : !strcmp (SDATA (name), this_name)) return i; } return -1; @@ -815,7 +815,7 @@ CHECK_STRING (pattern); - if (XSTRING (pattern)->size == 0) + if (SCHARS (pattern) == 0) return Qnil; id = fs_query_fontset (pattern, !NILP (regexpp)); @@ -854,11 +854,11 @@ || !BASE_FONTSET_P (fontset) || !EQ (frame, FONTSET_FRAME (fontset))) continue; - name = XSTRING (FONTSET_NAME (fontset))->data; + name = SDATA (FONTSET_NAME (fontset)); if (!NILP (regexp) ? (fast_c_string_match_ignore_case (regexp, name) < 0) - : strcmp (XSTRING (pattern)->data, name)) + : strcmp (SDATA (pattern), name)) continue; if (size) @@ -892,7 +892,7 @@ tem = Fquery_fontset (name, Qnil); if (!NILP (tem)) error ("Fontset `%s' matches the existing fontset `%s'", - XSTRING (name)->data, XSTRING (tem)->data); + SDATA (name), SDATA (tem)); /* Check the validity of FONTLIST while creating a template for fontset elements. */ @@ -969,7 +969,7 @@ CHECK_STRING (name); id = fs_query_fontset (name, 0); if (id < 0) - error ("Fontset `%s' does not exist", XSTRING (name)->data); + error ("Fontset `%s' does not exist", SDATA (name)); return FONTSET_FROM_ID (id); } @@ -1120,7 +1120,7 @@ if (!query_font_func) error ("Font query function is not supported"); - fontp = (*query_font_func) (f, XSTRING (name)->data); + fontp = (*query_font_func) (f, SDATA (name)); if (!fontp) return Qnil; @@ -1338,7 +1338,7 @@ if (CONSP (elt)) { elt = XCAR (elt); - fontp = (*query_font_func) (f, XSTRING (elt)->data); + fontp = (*query_font_func) (f, SDATA (elt)); } val = Fmake_vector (make_number (3), val); AREF (val, 0) = fontp ? make_number (fontp->size) : make_number (0);
--- a/src/frame.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/frame.c Mon Jul 15 00:00:41 2002 +0000 @@ -293,7 +293,7 @@ buf = Fcurrent_buffer (); /* If buf is a 'hidden' buffer (i.e. one whose name starts with a space), try to find another one. */ - if (XSTRING (Fbuffer_name (buf))->data[0] == ' ') + if (SREF (Fbuffer_name (buf), 0) == ' ') buf = Fother_buffer (buf, Qnil, Qnil); /* Use set_window_buffer, not Fset_window_buffer, and don't let @@ -1115,7 +1115,7 @@ #ifdef MAC_OS8 /* Terminal frame deleted before any other visible frames are created. */ - && strcmp (XSTRING (f->name)->data, "F1") != 0 + && strcmp (SDATA (f->name), "F1") != 0 #endif ) error ("Attempt to delete the sole visible or iconified frame"); @@ -1869,8 +1869,8 @@ /* Check for no change needed in this very common case before we do any consing. */ - if (frame_name_fnn_p (XSTRING (f->name)->data, - STRING_BYTES (XSTRING (f->name)))) + if (frame_name_fnn_p (SDATA (f->name), + SBYTES (f->name))) return; terminal_frame_count++; @@ -1887,7 +1887,7 @@ /* Don't allow the user to set the frame name to F<num>, so it doesn't clash with the names we generate for terminal frames. */ - if (frame_name_fnn_p (XSTRING (name)->data, STRING_BYTES (XSTRING (name)))) + if (frame_name_fnn_p (SDATA (name), SBYTES (name))) error ("Frame names of the form F<num> are usurped by Emacs"); } @@ -2005,13 +2005,13 @@ elt = Fassq (Qforeground_color, alist); if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) { - if (strncmp (XSTRING (XCDR (elt))->data, + if (strncmp (SDATA (XCDR (elt)), unspecified_bg, - XSTRING (XCDR (elt))->size) == 0) + SCHARS (XCDR (elt))) == 0) store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg)); - else if (strncmp (XSTRING (XCDR (elt))->data, + else if (strncmp (SDATA (XCDR (elt)), unspecified_fg, - XSTRING (XCDR (elt))->size) == 0) + SCHARS (XCDR (elt))) == 0) store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg)); } else @@ -2019,13 +2019,13 @@ elt = Fassq (Qbackground_color, alist); if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) { - if (strncmp (XSTRING (XCDR (elt))->data, + if (strncmp (SDATA (XCDR (elt)), unspecified_fg, - XSTRING (XCDR (elt))->size) == 0) + SCHARS (XCDR (elt))) == 0) store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg)); - else if (strncmp (XSTRING (XCDR (elt))->data, + else if (strncmp (SDATA (XCDR (elt)), unspecified_bg, - XSTRING (XCDR (elt))->size) == 0) + SCHARS (XCDR (elt))) == 0) store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg)); } else @@ -2112,8 +2112,8 @@ if (EQ (parameter, Qbackground_color)) { - color_name = XSTRING (value)->data; - csz = XSTRING (value)->size; + color_name = SDATA (value); + csz = SCHARS (value); if (strncmp (color_name, unspecified_bg, csz) == 0) value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f)); else if (strncmp (color_name, unspecified_fg, csz) == 0) @@ -2121,8 +2121,8 @@ } else if (EQ (parameter, Qforeground_color)) { - color_name = XSTRING (value)->data; - csz = XSTRING (value)->size; + color_name = SDATA (value); + csz = SCHARS (value); if (strncmp (color_name, unspecified_fg, csz) == 0) value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f)); else if (strncmp (color_name, unspecified_bg, csz) == 0)
--- a/src/indent.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/indent.c Mon Jul 15 00:00:41 2002 +0000 @@ -667,7 +667,7 @@ int b, e; if (NILP (end)) - e = XSTRING (string)->size; + e = SCHARS (string); else { CHECK_NUMBER (end); @@ -683,10 +683,10 @@ } /* Make a pointer for decrementing through the chars before point. */ - ptr = XSTRING (string)->data + e; + ptr = SDATA (string) + e; /* Make a pointer to where consecutive chars leave off, going backwards from point. */ - stop = XSTRING (string)->data + b; + stop = SDATA (string) + b; if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
--- a/src/insdel.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/insdel.c Mon Jul 15 00:00:41 2002 +0000 @@ -1111,7 +1111,7 @@ outgoing_nbytes = nchars; else if (! STRING_MULTIBYTE (string)) outgoing_nbytes - = count_size_as_multibyte (&XSTRING (string)->data[pos_byte], + = count_size_as_multibyte (&SREF (string, pos_byte), nbytes); GCPRO1 (string); @@ -1128,7 +1128,7 @@ /* Copy the string text into the buffer, perhaps converting between single-byte and multibyte. */ - copy_text (XSTRING (string)->data + pos_byte, GPT_ADDR, nbytes, + copy_text (SDATA (string) + pos_byte, GPT_ADDR, nbytes, STRING_MULTIBYTE (string), ! NILP (current_buffer->enable_multibyte_characters)); @@ -1169,9 +1169,9 @@ offset_intervals (current_buffer, PT, nchars); - intervals = XSTRING (string)->intervals; + intervals = STRING_INTERVALS (string); /* Get the intervals for the part of the string we are inserting. */ - if (nbytes < STRING_BYTES (XSTRING (string))) + if (nbytes < SBYTES (string)) intervals = copy_intervals (intervals, pos, nchars); /* Insert those intervals. */ @@ -1358,8 +1358,8 @@ if (STRINGP (prev_text)) { - nchars_del = XSTRING (prev_text)->size; - nbytes_del = STRING_BYTES (XSTRING (prev_text)); + nchars_del = SCHARS (prev_text); + nbytes_del = SBYTES (prev_text); } /* Update various buffer positions for the new text. */ @@ -1493,8 +1493,8 @@ Lisp_Object new; int from, to, prepare, inherit, markers; { - int inschars = XSTRING (new)->size; - int insbytes = STRING_BYTES (XSTRING (new)); + int inschars = SCHARS (new); + int insbytes = SBYTES (new); int from_byte, to_byte; int nbytes_del, nchars_del; register Lisp_Object temp; @@ -1539,7 +1539,7 @@ outgoing_insbytes = inschars; else if (! STRING_MULTIBYTE (new)) outgoing_insbytes - = count_size_as_multibyte (XSTRING (new)->data, insbytes); + = count_size_as_multibyte (SDATA (new), insbytes); /* Make sure point-max won't overflow after this insertion. */ XSETINT (temp, Z_BYTE - nbytes_del + insbytes); @@ -1582,7 +1582,7 @@ /* Copy the string text into the buffer, perhaps converting between single-byte and multibyte. */ - copy_text (XSTRING (new)->data, GPT_ADDR, insbytes, + copy_text (SDATA (new), GPT_ADDR, insbytes, STRING_MULTIBYTE (new), ! NILP (current_buffer->enable_multibyte_characters)); @@ -1629,7 +1629,7 @@ /* Get the intervals for the part of the string we are inserting-- not including the combined-before bytes. */ - intervals = XSTRING (new)->intervals; + intervals = STRING_INTERVALS (new); /* Insert those intervals. */ graft_intervals_into_buffer (intervals, from, inschars, current_buffer, inherit);
--- a/src/intervals.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/intervals.c Mon Jul 15 00:00:41 2002 +0000 @@ -80,8 +80,8 @@ } else if (STRINGP (parent)) { - new->total_length = XSTRING (parent)->size; - XSTRING (parent)->intervals = new; + new->total_length = SCHARS (parent); + STRING_INTERVALS (parent) = new; new->position = 0; } @@ -452,7 +452,7 @@ if (BUFFERP (parent)) BUF_INTERVALS (XBUFFER (parent)) = interval; else if (STRINGP (parent)) - XSTRING (parent)->intervals = interval; + STRING_INTERVALS (parent) = interval; } return interval; @@ -1280,7 +1280,7 @@ if (BUFFERP (owner)) BUF_INTERVALS (XBUFFER (owner)) = parent; else if (STRINGP (owner)) - XSTRING (owner)->intervals = parent; + STRING_INTERVALS (owner) = parent; else abort (); @@ -2247,7 +2247,7 @@ else if (BUFFERP (object)) i = find_interval (BUF_INTERVALS (XBUFFER (object)), pos); else if (STRINGP (object)) - i = find_interval (XSTRING (object)->intervals, pos); + i = find_interval (STRING_INTERVALS (object), pos); else abort (); @@ -2384,7 +2384,7 @@ return; SET_INTERVAL_OBJECT (interval_copy, string); - XSTRING (string)->intervals = interval_copy; + STRING_INTERVALS (string) = interval_copy; } /* Return 1 if strings S1 and S2 have identical properties; 0 otherwise. @@ -2396,10 +2396,10 @@ { INTERVAL i1, i2; int pos = 0; - int end = XSTRING (s1)->size; + int end = SCHARS (s1); - i1 = find_interval (XSTRING (s1)->intervals, 0); - i2 = find_interval (XSTRING (s2)->intervals, 0); + i1 = find_interval (STRING_INTERVALS (s1), 0); + i2 = find_interval (STRING_INTERVALS (s2), 0); while (pos < end) {
--- a/src/keyboard.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/keyboard.c Mon Jul 15 00:00:41 2002 +0000 @@ -855,7 +855,7 @@ echoing = 1; message3_nolog (current_kboard->echo_string, SBYTES (current_kboard->echo_string), - SMBP (current_kboard->echo_string)); + STRING_MULTIBYTE (current_kboard->echo_string)); echoing = 0; /* Record in what buffer we echoed, and from which kboard. */ @@ -1204,7 +1204,7 @@ *Messages*. */ if (!NILP (Vsignaling_function) && SYMBOLP (Vsignaling_function)) { - char *name = XSTRING (SYMBOL_NAME (Vsignaling_function))->data; + char *name = SDATA (SYMBOL_NAME (Vsignaling_function)); message_dolog (name, strlen (name), 0, 0); message_dolog (": ", 2, 0, 0); Vsignaling_function = Qnil; @@ -2111,14 +2111,14 @@ Vpre_help_message = current_message (); specbind (Qmessage_truncate_lines, Qt); - message3_nolog (help, STRING_BYTES (XSTRING (help)), + message3_nolog (help, SBYTES (help), STRING_MULTIBYTE (help)); unbind_to (count, Qnil); } else if (STRINGP (Vpre_help_message)) { message3_nolog (Vpre_help_message, - STRING_BYTES (XSTRING (Vpre_help_message)), + SBYTES (Vpre_help_message), STRING_MULTIBYTE (Vpre_help_message)); Vpre_help_message = Qnil; } @@ -2745,7 +2745,7 @@ RETURN_UNGCPRO (c); if ((STRINGP (Vkeyboard_translate_table) - && XSTRING (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c)) + && SCHARS (Vkeyboard_translate_table) > (unsigned) XFASTINT (c)) || (VECTORP (Vkeyboard_translate_table) && XVECTOR (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c)) || (CHAR_TABLE_P (Vkeyboard_translate_table) @@ -3161,8 +3161,8 @@ if (SYMBOLP (dribblee)) { putc ('<', dribble); - fwrite (XSTRING (SYMBOL_NAME (dribblee))->data, sizeof (char), - STRING_BYTES (XSTRING (SYMBOL_NAME (dribblee))), + fwrite (SDATA (SYMBOL_NAME (dribblee)), sizeof (char), + SBYTES (SYMBOL_NAME (dribblee)), dribble); putc ('>', dribble); } @@ -4929,7 +4929,7 @@ if (NILP (string)) break; if (column >= XINT (pos) - && column < XINT (pos) + XSTRING (string)->size) + && column < XINT (pos) + SCHARS (string)) { item = AREF (items, i); break; @@ -5703,8 +5703,8 @@ new_name = make_uninit_multibyte_string (mod_len + base_len, mod_len + base_len_byte); - bcopy (new_mods, XSTRING (new_name)->data, mod_len); - bcopy (base, XSTRING (new_name)->data + mod_len, base_len_byte); + bcopy (new_mods, SDATA (new_name), mod_len); + bcopy (base, SDATA (new_name) + mod_len, base_len_byte); return Fintern (new_name, Qnil); } @@ -5762,8 +5762,8 @@ Lisp_Object unmodified; Lisp_Object mask; - unmodified = Fintern (make_string (XSTRING (SYMBOL_NAME (symbol))->data + end, - STRING_BYTES (XSTRING (SYMBOL_NAME (symbol))) - end), + unmodified = Fintern (make_string (SDATA (SYMBOL_NAME (symbol)) + end, + SBYTES (SYMBOL_NAME (symbol)) - end), Qnil); if (modifiers & ~VALMASK) @@ -5816,9 +5816,9 @@ { /* We have to create the symbol ourselves. */ new_symbol = apply_modifiers_uncached (modifiers, - XSTRING (SYMBOL_NAME (base))->data, - XSTRING (SYMBOL_NAME (base))->size, - STRING_BYTES (XSTRING (SYMBOL_NAME (base)))); + SDATA (SYMBOL_NAME (base)), + SCHARS (SYMBOL_NAME (base)), + SBYTES (SYMBOL_NAME (base))); /* Add the new symbol to the base's cache. */ entry = Fcons (index, new_symbol); @@ -5956,9 +5956,9 @@ value = Fcdr_safe (Fassq (symbol_int, name_alist_or_stem)); else if (STRINGP (name_alist_or_stem)) { - int len = STRING_BYTES (XSTRING (name_alist_or_stem)); + int len = SBYTES (name_alist_or_stem); char *buf = (char *) alloca (len + 50); - sprintf (buf, "%s-%d", XSTRING (name_alist_or_stem)->data, + sprintf (buf, "%s-%d", SDATA (name_alist_or_stem), XINT (symbol_int) + 1); value = intern (buf); } @@ -6039,8 +6039,8 @@ } /* Let the symbol A refer to the character A. */ - if (SYMBOLP (base) && XSTRING (SYMBOL_NAME (base))->size == 1) - XSETINT (base, XSTRING (SYMBOL_NAME (base))->data[0]); + if (SYMBOLP (base) && SCHARS (SYMBOL_NAME (base)) == 1) + XSETINT (base, SDATA (SYMBOL_NAME (base))[0]); if (INTEGERP (base)) { @@ -7720,8 +7720,8 @@ return Qnil; /* Prompt string always starts with map's prompt, and a space. */ - strcpy (menu, XSTRING (name)->data); - nlength = STRING_BYTES (XSTRING (name)); + strcpy (menu, SDATA (name)); + nlength = SBYTES (name); menu[nlength++] = ':'; menu[nlength++] = ' '; menu[nlength] = 0; @@ -7799,8 +7799,8 @@ upcased_event = Fupcase (event); downcased_event = Fdowncase (event); - char_matches = (XINT (upcased_event) == XSTRING (s)->data[0] - || XINT (downcased_event) == XSTRING (s)->data[0]); + char_matches = (XINT (upcased_event) == SREF (s, 0) + || XINT (downcased_event) == SREF (s, 0)); if (! char_matches) desc = Fsingle_key_description (event, Qnil); @@ -7829,8 +7829,8 @@ /* If we have room for the prompt string, add it to this line. If this is the first on the line, always add it. */ - if ((XSTRING (s)->size + i + 2 - + (char_matches ? 0 : XSTRING (desc)->size + 3)) + if ((SCHARS (s) + i + 2 + + (char_matches ? 0 : SCHARS (desc) + 3)) < width || !notfirst) { @@ -7850,20 +7850,20 @@ if (! char_matches) { /* Add as much of string as fits. */ - thiswidth = XSTRING (desc)->size; + thiswidth = SCHARS (desc); if (thiswidth + i > width) thiswidth = width - i; - bcopy (XSTRING (desc)->data, menu + i, thiswidth); + bcopy (SDATA (desc), menu + i, thiswidth); i += thiswidth; strcpy (menu + i, " = "); i += 3; } /* Add as much of string as fits. */ - thiswidth = XSTRING (s)->size; + thiswidth = SCHARS (s); if (thiswidth + i > width) thiswidth = width - i; - bcopy (XSTRING (s)->data, menu + i, thiswidth); + bcopy (SDATA (s), menu + i, thiswidth); i += thiswidth; menu[i] = 0; } @@ -8594,7 +8594,7 @@ pos = XCDR (string); string = XCAR (string); if (XINT (pos) >= 0 - && XINT (pos) < XSTRING (string)->size) + && XINT (pos) < SCHARS (string)) { map = Fget_text_property (pos, Qlocal_map, string); if (!NILP (map)) @@ -8622,7 +8622,7 @@ pos = XCDR (string); string = XCAR (string); if (XINT (pos) >= 0 - && XINT (pos) < XSTRING (string)->size) + && XINT (pos) < SCHARS (string)) { map = Fget_text_property (pos, Qlocal_map, string); if (!NILP (map)) @@ -8923,7 +8923,7 @@ for (i = 0; i < len; i++) XSETFASTINT (keybuf[fkey_start + i], - XSTRING (fkey_next)->data[i]); + SREF (fkey_next, i)); } mock_input = t; @@ -9462,7 +9462,7 @@ Qt, Qnil, Qextended_command_history, Qnil, Qnil); - if (STRINGP (function) && XSTRING (function)->size == 0) + if (STRINGP (function) && SCHARS (function) == 0) error ("No command name given"); /* Set this_command_keys to the concatenation of saved_keys and @@ -9538,12 +9538,12 @@ binding = Fkey_description (bindings); newmessage - = (char *) alloca (XSTRING (SYMBOL_NAME (function))->size - + STRING_BYTES (XSTRING (binding)) + = (char *) alloca (SCHARS (SYMBOL_NAME (function)) + + SBYTES (binding) + 100); sprintf (newmessage, "You can run the command `%s' with %s", - XSTRING (SYMBOL_NAME (function))->data, - XSTRING (binding)->data); + SDATA (SYMBOL_NAME (function)), + SDATA (binding)); message2_nolog (newmessage, strlen (newmessage), STRING_MULTIBYTE (binding)); @@ -9769,7 +9769,7 @@ if (!NILP (file)) { file = Fexpand_file_name (file, Qnil); - dribble = fopen (XSTRING (file)->data, "w"); + dribble = fopen (SDATA (file), "w"); if (dribble == 0) report_file_error ("Opening dribble", Fcons (file, Qnil)); } @@ -9869,8 +9869,8 @@ { register int count; - p = XSTRING (stuffstring)->data; - count = STRING_BYTES (XSTRING (stuffstring)); + p = SDATA (stuffstring); + count = SBYTES (stuffstring); while (count-- > 0) stuff_char (*p++); stuff_char ('\n');
--- a/src/keymap.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/keymap.c Mon Jul 15 00:00:41 2002 +0000 @@ -1062,7 +1062,7 @@ /* We must use Fkey_description rather than just passing key to error; key might be a vector, not a string. */ error ("Key sequence %s uses invalid prefix characters", - XSTRING (Fkey_description (key))->data); + SDATA (Fkey_description (key))); } } @@ -1223,8 +1223,8 @@ error ((modifiers & ~meta_modifier ? "To bind the key %s, use [?%s], not [%s]" : "To bind the key %s, use \"%s\", not [%s]"), - XSTRING (SYMBOL_NAME (c))->data, XSTRING (keystring)->data, - XSTRING (SYMBOL_NAME (c))->data); + SDATA (SYMBOL_NAME (c)), SDATA (keystring), + SDATA (SYMBOL_NAME (c))); } } @@ -1746,8 +1746,8 @@ int i, i_byte, c; Lisp_Object copy; - copy = Fmake_vector (make_number (XSTRING (prefix)->size), Qnil); - for (i = 0, i_byte = 0; i < XSTRING (prefix)->size;) + copy = Fmake_vector (make_number (SCHARS (prefix)), Qnil); + for (i = 0, i_byte = 0; i < SCHARS (prefix);) { int i_before = i; @@ -1876,7 +1876,7 @@ { Lisp_Object vector; vector = Fmake_vector (Flength (keys), Qnil); - for (i = 0, i_byte = 0; i < XSTRING (keys)->size; ) + for (i = 0, i_byte = 0; i < SCHARS (keys); ) { int c; int i_before = i; @@ -2120,8 +2120,8 @@ if (NILP (no_angles)) { char *buffer - = (char *) alloca (STRING_BYTES (XSTRING (SYMBOL_NAME (key))) + 5); - sprintf (buffer, "<%s>", XSTRING (SYMBOL_NAME (key))->data); + = (char *) alloca (SBYTES (SYMBOL_NAME (key)) + 5); + sprintf (buffer, "<%s>", SDATA (SYMBOL_NAME (key))); return build_string (buffer); } else @@ -2659,8 +2659,8 @@ if (STRINGP (Vkeyboard_translate_table) && !NILP (prefix)) { int c; - unsigned char *translate = XSTRING (Vkeyboard_translate_table)->data; - int translate_len = XSTRING (Vkeyboard_translate_table)->size; + unsigned char *translate = SDATA (Vkeyboard_translate_table); + int translate_len = SCHARS (Vkeyboard_translate_table); for (c = 0; c < translate_len; c++) if (translate[c] != c) @@ -2738,13 +2738,13 @@ if (!SYMBOLP (modes[i])) abort(); - p = title = (char *) alloca (42 + XSTRING (SYMBOL_NAME (modes[i]))->size); + p = title = (char *) alloca (42 + SCHARS (SYMBOL_NAME (modes[i]))); *p++ = '\f'; *p++ = '\n'; *p++ = '`'; - bcopy (XSTRING (SYMBOL_NAME (modes[i]))->data, p, - XSTRING (SYMBOL_NAME (modes[i]))->size); - p += XSTRING (SYMBOL_NAME (modes[i]))->size; + bcopy (SDATA (SYMBOL_NAME (modes[i])), p, + SCHARS (SYMBOL_NAME (modes[i]))); + p += SCHARS (SYMBOL_NAME (modes[i])); *p++ = '\''; bcopy (" Minor Mode Bindings", p, sizeof (" Minor Mode Bindings") - 1); p += sizeof (" Minor Mode Bindings") - 1; @@ -2875,7 +2875,7 @@ /* If the sequence by which we reach this keymap is zero-length, then the shadow map for this keymap is just SHADOW. */ - if ((STRINGP (prefix) && XSTRING (prefix)->size == 0) + if ((STRINGP (prefix) && SCHARS (prefix) == 0) || (VECTORP (prefix) && XVECTOR (prefix)->size == 0)) ; /* If the sequence by which we reach this keymap actually has @@ -3361,8 +3361,8 @@ insert_string ("<"); tem2 = CHARSET_TABLE_INFO (i - 128, CHARSET_SHORT_NAME_IDX); if (STRINGP (tem2)) - insert_from_string (tem2, 0, 0, XSTRING (tem2)->size, - STRING_BYTES (XSTRING (tem2)), 0); + insert_from_string (tem2, 0, 0, SCHARS (tem2), + SBYTES (tem2), 0); else insert ("?", 1); insert (">", 1);
--- a/src/lread.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/lread.c Mon Jul 15 00:00:41 2002 +0000 @@ -695,9 +695,9 @@ /* Avoid weird lossage with null string as arg, since it would try to load a directory as a Lisp file */ - if (XSTRING (file)->size > 0) + if (SCHARS (file) > 0) { - int size = STRING_BYTES (XSTRING (file)); + int size = SBYTES (file); Lisp_Object tmp[2]; GCPRO1 (file); @@ -706,10 +706,10 @@ { /* Don't insist on adding a suffix if FILE already ends with one. */ if (size > 3 - && !strcmp (XSTRING (file)->data + size - 3, ".el")) + && !strcmp (SDATA (file) + size - 3, ".el")) must_suffix = Qnil; else if (size > 4 - && !strcmp (XSTRING (file)->data + size - 4, ".elc")) + && !strcmp (SDATA (file) + size - 4, ".elc")) must_suffix = Qnil; /* Don't insist on adding a suffix if the argument includes a directory name. */ @@ -778,7 +778,7 @@ Vloads_in_progress = Fcons (found, Vloads_in_progress); } - if (!bcmp (&(XSTRING (found)->data[STRING_BYTES (XSTRING (found)) - 4]), + if (!bcmp (&(SREF (found, SBYTES (found) - 4)), ".elc", 4)) /* Load .elc files directly, but not when they are remote and have no handler! */ @@ -793,7 +793,7 @@ safe_p = 0; if (!load_dangerous_libraries) error ("File `%s' was not compiled in Emacs", - XSTRING (found)->data); + SDATA (found)); else if (!NILP (nomessage)) message_with_string ("File `%s' not compiled in Emacs", found, 1); } @@ -806,10 +806,10 @@ #ifdef DOS_NT fmode = "rb"; #endif /* DOS_NT */ - stat ((char *)XSTRING (efound)->data, &s1); - XSTRING (efound)->data[STRING_BYTES (XSTRING (efound)) - 1] = 0; - result = stat ((char *)XSTRING (efound)->data, &s2); - XSTRING (efound)->data[STRING_BYTES (XSTRING (efound)) - 1] = 'c'; + stat ((char *)SDATA (efound), &s1); + SREF (efound, SBYTES (efound) - 1) = 0; + result = stat ((char *)SDATA (efound), &s2); + SREF (efound, SBYTES (efound) - 1) = 'c'; UNGCPRO; if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) @@ -823,7 +823,7 @@ Lisp_Object file; file = Fsubstring (found, make_number (0), make_number (-1)); message_with_string ("Source file `%s' newer than byte-compiled file", - file, SMBP (file)); + file, STRING_MULTIBYTE (file)); } } } @@ -848,7 +848,7 @@ emacs_close (fd); GCPRO1 (efound); efound = ENCODE_FILE (found); - stream = fopen ((char *) XSTRING (efound)->data, fmode); + stream = fopen ((char *) SDATA (efound), fmode); UNGCPRO; #else /* not WINDOWSNT */ stream = fdopen (fd, fmode); @@ -856,7 +856,7 @@ if (stream == 0) { emacs_close (fd); - error ("Failure to create stdio stream for %s", XSTRING (file)->data); + error ("Failure to create stdio stream for %s", SDATA (file)); } if (! NILP (Vpurify_flag)) @@ -958,9 +958,9 @@ complete_filename_p (pathname) Lisp_Object pathname; { - register unsigned char *s = XSTRING (pathname)->data; + register unsigned char *s = SDATA (pathname); return (IS_DIRECTORY_SEP (s[0]) - || (XSTRING (pathname)->size > 2 + || (SCHARS (pathname) > 2 && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2])) #ifdef ALTOS || *s == '@' @@ -1032,7 +1032,7 @@ { CHECK_STRING_CAR (tail); max_suffix_len = max (max_suffix_len, - STRING_BYTES (XSTRING (XCAR (tail)))); + SBYTES (XCAR (tail))); } string = filename = Qnil; @@ -1060,7 +1060,7 @@ /* Calculate maximum size of any filename made from this path element/specified file name and any possible suffix. */ - want_size = max_suffix_len + STRING_BYTES (XSTRING (filename)) + 1; + want_size = max_suffix_len + SBYTES (filename) + 1; if (fn_size < want_size) fn = (char *) alloca (fn_size = 100 + want_size); @@ -1068,29 +1068,29 @@ for (tail = NILP (suffixes) ? default_suffixes : suffixes; CONSP (tail); tail = XCDR (tail)) { - int lsuffix = STRING_BYTES (XSTRING (XCAR (tail))); + int lsuffix = SBYTES (XCAR (tail)); Lisp_Object handler; int exists; /* Concatenate path element/specified name with the suffix. If the directory starts with /:, remove that. */ - if (XSTRING (filename)->size > 2 - && XSTRING (filename)->data[0] == '/' - && XSTRING (filename)->data[1] == ':') + if (SCHARS (filename) > 2 + && SREF (filename, 0) == '/' + && SREF (filename, 1) == ':') { - strncpy (fn, XSTRING (filename)->data + 2, - STRING_BYTES (XSTRING (filename)) - 2); - fn[STRING_BYTES (XSTRING (filename)) - 2] = 0; + strncpy (fn, SDATA (filename) + 2, + SBYTES (filename) - 2); + fn[SBYTES (filename) - 2] = 0; } else { - strncpy (fn, XSTRING (filename)->data, - STRING_BYTES (XSTRING (filename))); - fn[STRING_BYTES (XSTRING (filename))] = 0; + strncpy (fn, SDATA (filename), + SBYTES (filename)); + fn[SBYTES (filename)] = 0; } if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */ - strncat (fn, XSTRING (XCAR (tail))->data, lsuffix); + strncat (fn, SDATA (XCAR (tail)), lsuffix); /* Check that the file exists and is not a directory. */ /* We used to only check for handlers on non-absolute file names: @@ -1125,7 +1125,7 @@ char *pfn; encoded_fn = ENCODE_FILE (string); - pfn = XSTRING (encoded_fn)->data; + pfn = SDATA (encoded_fn); exists = (stat (pfn, &st) >= 0 && (st.st_mode & S_IFMT) != S_IFDIR); if (exists) @@ -1507,12 +1507,12 @@ { int startval, endval; if (NILP (end)) - endval = XSTRING (stream)->size; + endval = SCHARS (stream); else { CHECK_NUMBER (end); endval = XINT (end); - if (endval < 0 || endval > XSTRING (stream)->size) + if (endval < 0 || endval > SCHARS (stream)) args_out_of_range (stream, end); } @@ -1963,17 +1963,17 @@ UNREAD (c); tmp = read1 (readcharfun, pch, first_in_list); - if (size_in_chars != XSTRING (tmp)->size + if (size_in_chars != SCHARS (tmp) /* We used to print 1 char too many when the number of bits was a multiple of 8. Accept such input in case it came from an old version. */ && ! (XFASTINT (length) - == (XSTRING (tmp)->size - 1) * BITS_PER_CHAR)) + == (SCHARS (tmp) - 1) * BITS_PER_CHAR)) Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#&...", 5), Qnil)); val = Fmake_bool_vector (length, Qnil); - bcopy (XSTRING (tmp)->data, XBOOL_VECTOR (val)->data, + bcopy (SDATA (tmp), XBOOL_VECTOR (val)->data, size_in_chars); /* Clear the extraneous bits in the last byte. */ if (XINT (length) != size_in_chars * BITS_PER_CHAR) @@ -2614,7 +2614,7 @@ /* Check for text properties in each interval. substitute_in_interval contains part of the logic. */ - INTERVAL root_interval = XSTRING (subtree)->intervals; + INTERVAL root_interval = STRING_INTERVALS (subtree); Lisp_Object arg = Fcons (object, placeholder); traverse_intervals_noorder (root_interval, @@ -2760,8 +2760,8 @@ /* Coerce string to unibyte (like string-as-unibyte, but without generating extra garbage and guaranteeing no change in the contents). */ - XSTRING (bytestr)->size = STRING_BYTES (XSTRING (bytestr)); - SET_STRING_BYTES (XSTRING (bytestr), -1); + SCHARS (bytestr) = SBYTES (bytestr); + STRING_SET_UNIBYTE (bytestr); item = Fread (bytestr); if (!CONSP (item)) @@ -3040,9 +3040,9 @@ CHECK_STRING (string); - tem = oblookup (obarray, XSTRING (string)->data, - XSTRING (string)->size, - STRING_BYTES (XSTRING (string))); + tem = oblookup (obarray, SDATA (string), + SCHARS (string), + SBYTES (string)); if (!INTEGERP (tem)) return tem; @@ -3055,7 +3055,7 @@ else XSYMBOL (sym)->interned = SYMBOL_INTERNED; - if ((XSTRING (string)->data[0] == ':') + if ((SREF (string, 0) == ':') && EQ (obarray, initial_obarray)) { XSYMBOL (sym)->constant = 1; @@ -3124,9 +3124,9 @@ string = name; } - tem = oblookup (obarray, XSTRING (string)->data, - XSTRING (string)->size, - STRING_BYTES (XSTRING (string))); + tem = oblookup (obarray, SDATA (string), + SCHARS (string), + SBYTES (string)); if (INTEGERP (tem)) return Qnil; /* If arg was a symbol, don't delete anything but that symbol itself. */ @@ -3203,9 +3203,9 @@ else for (tail = bucket; ; XSETSYMBOL (tail, XSYMBOL (tail)->next)) { - if (STRING_BYTES (XSTRING (SYMBOL_NAME (tail))) == size_byte - && XSTRING (SYMBOL_NAME (tail))->size == size - && !bcmp (XSTRING (SYMBOL_NAME (tail))->data, ptr, size_byte)) + if (SBYTES (SYMBOL_NAME (tail)) == size_byte + && SCHARS (SYMBOL_NAME (tail)) == size + && !bcmp (SDATA (SYMBOL_NAME (tail)), ptr, size_byte)) return tail; else if (XSYMBOL (tail)->next == 0) break; @@ -3618,7 +3618,7 @@ if (STRINGP (dirfile)) { dirfile = Fdirectory_file_name (dirfile); - if (access (XSTRING (dirfile)->data, 0) < 0) + if (access (SDATA (dirfile), 0) < 0) dir_warning ("Warning: Lisp directory `%s' does not exist.\n", XCAR (path_tail)); } @@ -3654,10 +3654,10 @@ Lisp_Object dirname; { char *buffer - = (char *) alloca (XSTRING (dirname)->size + strlen (format) + 5); - - fprintf (stderr, format, XSTRING (dirname)->data); - sprintf (buffer, format, XSTRING (dirname)->data); + = (char *) alloca (SCHARS (dirname) + strlen (format) + 5); + + fprintf (stderr, format, SDATA (dirname)); + sprintf (buffer, format, SDATA (dirname)); /* Don't log the warning before we've initialized!! */ if (initialized) message_dolog (buffer, strlen (buffer), 0, STRING_MULTIBYTE (dirname));
--- a/src/mac.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/mac.c Mon Jul 15 00:00:41 2002 +0000 @@ -2048,7 +2048,7 @@ if (NILP (path)) return -1; - if (posix_to_mac_pathname (XSTRING (path)->data, tempmacpathname, + if (posix_to_mac_pathname (SDATA (path), tempmacpathname, MAXPATHLEN+1) == 0) return -1; } @@ -2529,7 +2529,7 @@ CHECK_STRING (script); - status = do_applescript (XSTRING (script)->data, &result); + status = do_applescript (SDATA (script), &result); if (status) { if (!result) @@ -2566,7 +2566,7 @@ CHECK_STRING (mac_filename); - if (mac_to_posix_pathname (XSTRING (mac_filename)->data, posix_filename, + if (mac_to_posix_pathname (SDATA (mac_filename), posix_filename, MAXPATHLEN)) return build_string (posix_filename); else @@ -2584,7 +2584,7 @@ CHECK_STRING (posix_filename); - if (posix_to_mac_pathname (XSTRING (posix_filename)->data, mac_filename, + if (posix_to_mac_pathname (SDATA (posix_filename), mac_filename, MAXPATHLEN)) return build_string (mac_filename); else @@ -2670,9 +2670,9 @@ CHECK_STRING (value); - len = XSTRING (value)->size; + len = SCHARS (value); buf = (char *) alloca (len+1); - bcopy (XSTRING (value)->data, buf, len); + bcopy (SDATA (value), buf, len); buf[len] = '\0'; /* convert to Mac-style eol's before sending to clipboard */
--- a/src/macfns.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/macfns.c Mon Jul 15 00:00:41 2002 +0000 @@ -534,7 +534,7 @@ { if (dpyinfo->bitmaps[id].refcount && dpyinfo->bitmaps[id].file - && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data)) + && !strcmp (dpyinfo->bitmaps[id].file, (char *) SDATA (file))) { ++dpyinfo->bitmaps[id].refcount; return id + 1; @@ -550,7 +550,7 @@ return -1; emacs_close (fd); - filename = (char *) XSTRING (found)->data; + filename = (char *) SDATA (found); hinst = LoadLibraryEx (filename, NULL, LOAD_LIBRARY_AS_DATAFILE); @@ -566,11 +566,11 @@ id = x_allocate_bitmap_record (f); dpyinfo->bitmaps[id - 1].pixmap = bitmap; dpyinfo->bitmaps[id - 1].refcount = 1; - dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (XSTRING (file)->size + 1); + dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (SCHARS (file) + 1); dpyinfo->bitmaps[id - 1].depth = 1; dpyinfo->bitmaps[id - 1].height = height; dpyinfo->bitmaps[id - 1].width = width; - strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data); + strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file)); return id; #endif /* MAC_TODO */ @@ -2067,9 +2067,9 @@ CHECK_STRING (arg); - if (strcmp (XSTRING (arg)->data, "black") == 0) + if (strcmp (SDATA (arg), "black") == 0) return BLACK_PIX_DEFAULT (f); - else if (strcmp (XSTRING (arg)->data, "white") == 0) + else if (strcmp (SDATA (arg), "white") == 0) return WHITE_PIX_DEFAULT (f); #if 0 @@ -2078,7 +2078,7 @@ return def; #endif - if (mac_defined_color (f, XSTRING (arg)->data, &cdef, 1)) + if (mac_defined_color (f, SDATA (arg), &cdef, 1)) return cdef.pixel; /* defined_color failed; return an ultimate default. */ @@ -2509,11 +2509,11 @@ BLOCK_INPUT; result = x_text_icon (f, - (char *) XSTRING ((!NILP (f->icon_name) - ? f->icon_name - : !NILP (f->title) - ? f->title - : f->name))->data); + (char *) SDATA ((!NILP (f->icon_name) + ? f->icon_name + : !NILP (f->title) + ? f->title + : f->name))); if (result) { @@ -2555,12 +2555,12 @@ BLOCK_INPUT; result = (STRINGP (fontset_name) - ? x_new_fontset (f, XSTRING (fontset_name)->data) - : x_new_font (f, XSTRING (arg)->data)); + ? x_new_fontset (f, SDATA (fontset_name)) + : x_new_font (f, SDATA (arg))); UNBLOCK_INPUT; if (EQ (result, Qnil)) - error ("Font `%s' is not defined", XSTRING (arg)->data); + error ("Font `%s' is not defined", SDATA (arg)); else if (EQ (result, Qt)) error ("The characters of the given font have varying widths"); else if (STRINGP (result)) @@ -2836,7 +2836,7 @@ /* Check for no change needed in this very common case before we do any consing. */ if (!strcmp (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name, - XSTRING (f->name)->data)) + SDATA (f->name))) return; name = build_string (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name); } @@ -2867,9 +2867,9 @@ { Str255 windowTitle; - if (strlen (XSTRING (name)->data) < 255) + if (strlen (SDATA (name)) < 255) { - strcpy (windowTitle, XSTRING (name)->data); + strcpy (windowTitle, SDATA (name)); c2pstr (windowTitle); SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); } @@ -2941,9 +2941,9 @@ { Str255 windowTitle; - if (strlen (XSTRING (name)->data) < 255) + if (strlen (SDATA (name)) < 255) { - strcpy (windowTitle, XSTRING (name)->data); + strcpy (windowTitle, SDATA (name)); c2pstr (windowTitle); SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); } @@ -3067,10 +3067,10 @@ if (STRINGP (Vx_resource_name)) { - unsigned char *p = XSTRING (Vx_resource_name)->data; + unsigned char *p = SDATA (Vx_resource_name); int i; - len = STRING_BYTES (XSTRING (Vx_resource_name)); + len = SBYTES (Vx_resource_name); /* Only letters, digits, - and _ are valid in resource names. Count the valid characters and count the invalid ones. */ @@ -3109,12 +3109,12 @@ for (i = 0; i < len; i++) { - int c = XSTRING (new)->data[i]; + int c = SREF (new, i); if (! ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '_')) - XSTRING (new)->data[i] = '_'; + SREF (new, i) = '_'; } } @@ -3153,37 +3153,37 @@ /* Allocate space for the components, the dots which separate them, and the final '\0'. Make them big enough for the worst case. */ - name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) + name_key = (char *) alloca (SBYTES (Vx_resource_name) + (STRINGP (component) - ? STRING_BYTES (XSTRING (component)) : 0) - + STRING_BYTES (XSTRING (attribute)) + ? SBYTES (component) : 0) + + SBYTES (attribute) + 3); class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) - + STRING_BYTES (XSTRING (class)) + + SBYTES (class) + (STRINGP (subclass) - ? STRING_BYTES (XSTRING (subclass)) : 0) + ? SBYTES (subclass) : 0) + 3); /* Start with emacs.FRAMENAME for the name (the specific one) and with `Emacs' for the class key (the general one). */ - strcpy (name_key, XSTRING (Vx_resource_name)->data); + strcpy (name_key, SDATA (Vx_resource_name)); strcpy (class_key, EMACS_CLASS); strcat (class_key, "."); - strcat (class_key, XSTRING (class)->data); + strcat (class_key, SDATA (class)); if (!NILP (component)) { strcat (class_key, "."); - strcat (class_key, XSTRING (subclass)->data); + strcat (class_key, SDATA (subclass)); strcat (name_key, "."); - strcat (name_key, XSTRING (component)->data); + strcat (name_key, SDATA (component)); } strcat (name_key, "."); - strcat (name_key, XSTRING (attribute)->data); + strcat (name_key, SDATA (attribute)); value = x_get_string_resource (Qnil, name_key, class_key); @@ -3206,13 +3206,13 @@ /* Allocate space for the components, the dots which separate them, and the final '\0'. */ - name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name)) + name_key = (char *) alloca (SBYTES (Vinvocation_name) + strlen (attribute) + 2); class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) + strlen (class) + 2); sprintf (name_key, "%s.%s", - XSTRING (Vinvocation_name)->data, + SDATA (Vinvocation_name), attribute); sprintf (class_key, "%s.%s", EMACS_CLASS, class); @@ -3269,15 +3269,15 @@ switch (type) { case RES_TYPE_NUMBER: - return make_number (atoi (XSTRING (tem)->data)); + return make_number (atoi (SDATA (tem))); case RES_TYPE_FLOAT: - return make_float (atof (XSTRING (tem)->data)); + return make_float (atof (SDATA (tem))); case RES_TYPE_BOOLEAN: tem = Fdowncase (tem); - if (!strcmp (XSTRING (tem)->data, "on") - || !strcmp (XSTRING (tem)->data, "true")) + if (!strcmp (SDATA (tem), "on") + || !strcmp (SDATA (tem), "true")) return Qt; else return Qnil; @@ -3291,11 +3291,11 @@ { Lisp_Object lower; lower = Fdowncase (tem); - if (!strcmp (XSTRING (lower)->data, "on") - || !strcmp (XSTRING (lower)->data, "true")) + if (!strcmp (SDATA (lower), "on") + || !strcmp (SDATA (lower), "true")) return Qt; - else if (!strcmp (XSTRING (lower)->data, "off") - || !strcmp (XSTRING (lower)->data, "false")) + else if (!strcmp (SDATA (lower), "off") + || !strcmp (SDATA (lower), "false")) return Qnil; else return Fintern (tem, Qnil); @@ -3490,7 +3490,7 @@ CHECK_STRING (string); - geometry = XParseGeometry ((char *) XSTRING (string)->data, + geometry = XParseGeometry ((char *) SDATA (string), &x, &y, &width, &height); result = Qnil; @@ -3678,7 +3678,7 @@ Elsewhere we specify the window name for the window manager. */ { - char *str = (char *) XSTRING (Vx_resource_name)->data; + char *str = (char *) SDATA (Vx_resource_name); f->namebuf = (char *) xmalloc (strlen (str) + 1); strcpy (f->namebuf, str); } @@ -3752,9 +3752,9 @@ ? IconicState : NormalState)); - x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name) + x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name) ? f->icon_name - : f->name))->data); + : f->name))); #endif UNBLOCK_INPUT; @@ -3964,9 +3964,9 @@ { tem = Fquery_fontset (font, Qnil); if (STRINGP (tem)) - font = x_new_fontset (f, XSTRING (tem)->data); + font = x_new_fontset (f, SDATA (tem)); else - font = x_new_font (f, XSTRING (font)->data); + font = x_new_font (f, SDATA (font)); } /* Try out a font which we hope has bold and italic variations. */ if (! STRINGP (font)) @@ -4178,7 +4178,7 @@ CHECK_STRING (color); - if (mac_defined_color (f, XSTRING (color)->data, &foo, 0)) + if (mac_defined_color (f, SDATA (color), &foo, 0)) return Qt; else return Qnil; @@ -4194,7 +4194,7 @@ CHECK_STRING (color); - if (mac_defined_color (f, XSTRING (color)->data, &foo, 0)) + if (mac_defined_color (f, SDATA (color), &foo, 0)) { Lisp_Object rgb[3]; @@ -4515,10 +4515,10 @@ validate_x_resource_name (); dpyinfo = mac_term_init (name, (unsigned char *) 0, - (char *) XSTRING (Vx_resource_name)->data); + (char *) SDATA (Vx_resource_name)); if (dpyinfo == 0) - error ("Cannot connect to server %s", XSTRING (name)->data); + error ("Cannot connect to server %s", SDATA (name)); mac_in_use = 1; XSETFASTINT (Vwindow_system_version, 3); @@ -4548,7 +4548,7 @@ error ("Not using Mac OS"); if (! NILP (xrm_string)) - xrm_option = (unsigned char *) XSTRING (xrm_string)->data; + xrm_option = (unsigned char *) SDATA (xrm_string); else xrm_option = (unsigned char *) 0; @@ -4557,15 +4557,15 @@ /* This is what opens the connection and sets x_current_display. This also initializes many symbols, such as those used for input. */ dpyinfo = mac_term_init (display, xrm_option, - (char *) XSTRING (Vx_resource_name)->data); + (char *) SDATA (Vx_resource_name)); if (dpyinfo == 0) { if (!NILP (must_succeed)) fatal ("Cannot connect to server %s.\n", - XSTRING (display)->data); + SDATA (display)); else - error ("Cannot connect to server %s", XSTRING (display)->data); + error ("Cannot connect to server %s", SDATA (display)); } mac_in_use = 1; @@ -4842,7 +4842,7 @@ /* Find key in KEYWORDS. Error if not found. */ for (i = 0; i < nkeywords; ++i) - if (strcmp (keywords[i].name, XSTRING (SYMBOL_NAME (key))->data) == 0) + if (strcmp (keywords[i].name, SDATA (SYMBOL_NAME (key))) == 0) break; if (i == nkeywords) @@ -5152,7 +5152,7 @@ xassert (STRINGP (color_name)); - if (w32_defined_color (f, XSTRING (color_name)->data, &color, 1)) + if (w32_defined_color (f, SDATA (color_name), &color, 1)) { /* This isn't called frequently so we get away with simply reallocating the color vector to the needed size, here. */ @@ -5730,7 +5730,7 @@ if (STRINGP (elt)) { - if (XSTRING (elt)->size + if (SCHARS (elt) < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) return 0; } @@ -5745,7 +5745,7 @@ } else if (STRINGP (data)) { - if (XSTRING (data)->size + if (SCHARS (data) < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) return 0; } @@ -6026,7 +6026,7 @@ return 0; } - rc = xbm_read_bitmap_file_data (XSTRING (file)->data, &img->width, + rc = xbm_read_bitmap_file_data (SDATA (file), &img->width, &img->height, &data); if (rc) { @@ -6139,13 +6139,13 @@ { Lisp_Object line = XVECTOR (data)->contents[i]; if (STRINGP (line)) - bcopy (XSTRING (line)->data, p, nbytes); + bcopy (SDATA (line), p, nbytes); else bcopy (XBOOL_VECTOR (line)->data, p, nbytes); } } else if (STRINGP (data)) - bits = XSTRING (data)->data; + bits = SDATA (data); else bits = XBOOL_VECTOR (data)->data; @@ -6337,10 +6337,10 @@ { Lisp_Object name = XCAR (XCAR (tail)); Lisp_Object color = XCDR (XCAR (tail)); - xpm_syms[i].name = (char *) alloca (XSTRING (name)->size + 1); - strcpy (xpm_syms[i].name, XSTRING (name)->data); - xpm_syms[i].value = (char *) alloca (XSTRING (color)->size + 1); - strcpy (xpm_syms[i].value, XSTRING (color)->data); + xpm_syms[i].name = (char *) alloca (SCHARS (name) + 1); + strcpy (xpm_syms[i].name, SDATA (name)); + xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1); + strcpy (xpm_syms[i].value, SDATA (color)); } } @@ -6359,14 +6359,14 @@ } rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), - XSTRING (file)->data, &img->pixmap, &img->mask, + SDATA (file), &img->pixmap, &img->mask, &attrs); } else { Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); rc = XpmCreatePixmapFromBuffer (NULL, FRAME_W32_WINDOW (f), - XSTRING (buffer)->data, + SDATA (buffer), &img->pixmap, &img->mask, &attrs); } @@ -6998,8 +6998,8 @@ char *buf = NULL; struct stat st; - if (stat (XSTRING (file)->data, &st) == 0 - && (fp = fopen (XSTRING (file)->data, "r")) != NULL + if (stat (SDATA (file), &st) == 0 + && (fp = fopen (SDATA (file), "r")) != NULL && (buf = (char *) xmalloc (st.st_size), fread (buf, 1, st.st_size, fp) == st.st_size)) { @@ -7067,8 +7067,8 @@ { Lisp_Object data; data = image_spec_value (img->spec, QCdata, NULL); - p = XSTRING (data)->data; - end = p + STRING_BYTES (XSTRING (data)); + p = SDATA (data); + end = p + SBYTES (data); } /* Check magic number. */ @@ -7401,7 +7401,7 @@ } /* Open the image file. */ - fp = fopen (XSTRING (file)->data, "rb"); + fp = fopen (SDATA (file), "rb"); if (!fp) { image_error ("Cannot open image file `%s'", file, Qnil); @@ -7423,8 +7423,8 @@ else { /* Read from memory. */ - tbr.bytes = XSTRING (specified_data)->data; - tbr.len = STRING_BYTES (XSTRING (specified_data)); + tbr.bytes = SDATA (specified_data); + tbr.len = SBYTES (specified_data); tbr.index = 0; /* Check PNG signature. */ @@ -7936,7 +7936,7 @@ return 0; } - fp = fopen (XSTRING (file)->data, "r"); + fp = fopen (SDATA (file), "r"); if (fp == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -7986,8 +7986,8 @@ if (NILP (specified_data)) jpeg_stdio_src (&cinfo, fp); else - jpeg_memory_src (&cinfo, XSTRING (specified_data)->data, - STRING_BYTES (XSTRING (specified_data))); + jpeg_memory_src (&cinfo, SDATA (specified_data), + SBYTES (specified_data)); jpeg_read_header (&cinfo, TRUE); @@ -8295,7 +8295,7 @@ } /* Try to open the image file. */ - tiff = TIFFOpen (XSTRING (file)->data, "r"); + tiff = TIFFOpen (SDATA (file), "r"); if (tiff == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -8306,8 +8306,8 @@ else { /* Memory source! */ - memsrc.bytes = XSTRING (specified_data)->data; - memsrc.len = STRING_BYTES (XSTRING (specified_data)); + memsrc.bytes = SDATA (specified_data); + memsrc.len = SBYTES (specified_data); memsrc.index = 0; tiff = TIFFClientOpen ("memory_source", "r", &memsrc, @@ -8539,7 +8539,7 @@ } /* Open the GIF file. */ - gif = DGifOpenFileName (XSTRING (file)->data); + gif = DGifOpenFileName (SDATA (file)); if (gif == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -8551,8 +8551,8 @@ { /* Read from memory! */ current_gif_memory_src = &memsrc; - memsrc.bytes = XSTRING (specified_data)->data; - memsrc.len = STRING_BYTES (XSTRING (specified_data)); + memsrc.bytes = SDATA (specified_data); + memsrc.len = SBYTES (specified_data); memsrc.index = 0; gif = DGifOpen(&memsrc, gif_read_from_memory); @@ -8999,10 +8999,10 @@ CHECK_STRING (value); BLOCK_INPUT; - prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); + prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom, XA_STRING, 8, PropModeReplace, - XSTRING (value)->data, XSTRING (value)->size); + SDATA (value), SCHARS (value)); /* Make sure the property is set when we return. */ XFlush (FRAME_W32_DISPLAY (f)); @@ -9028,7 +9028,7 @@ CHECK_STRING (prop); BLOCK_INPUT; - prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); + prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom); /* Make sure the property is removed when we return. */ @@ -9062,7 +9062,7 @@ CHECK_STRING (prop); BLOCK_INPUT; - prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); + prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom, 0, 0, False, XA_STRING, &actual_type, &actual_format, &actual_size, @@ -9378,9 +9378,9 @@ { tem = Fquery_fontset (font, Qnil); if (STRINGP (tem)) - font = x_new_fontset (f, XSTRING (tem)->data); + font = x_new_fontset (f, SDATA (tem)); else - font = x_new_font (f, XSTRING (font)->data); + font = x_new_font (f, SDATA (font)); } /* Try out a font which we hope has bold and italic variations. */ @@ -9800,14 +9800,14 @@ /* Create the dialog with PROMPT as title, using DIR as initial directory and using "*" as pattern. */ dir = Fexpand_file_name (dir, Qnil); - strncpy (init_dir, XSTRING (dir)->data, MAX_PATH); + strncpy (init_dir, SDATA (dir), MAX_PATH); init_dir[MAX_PATH] = '\0'; unixtodos_filename (init_dir); if (STRINGP (default_filename)) { char *file_name_only; - char *full_path_name = XSTRING (default_filename)->data; + char *full_path_name = SDATA (default_filename); unixtodos_filename (full_path_name); @@ -9846,7 +9846,7 @@ file_details.lpstrFile = filename; file_details.nMaxFile = sizeof (filename); file_details.lpstrInitialDir = init_dir; - file_details.lpstrTitle = XSTRING (prompt)->data; + file_details.lpstrTitle = SDATA (prompt); file_details.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR; if (!NILP (mustmatch))
--- a/src/macmenu.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/macmenu.c Mon Jul 15 00:00:41 2002 +0000 @@ -541,7 +541,7 @@ enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; - if (!NILP (map) && XSTRING (item_string)->data[0] == '@') + if (!NILP (map) && SREF (item_string, 0) == '@') { if (!NILP (enabled)) /* An enabled separate pane. Remember this to handle it later. */ @@ -1223,7 +1223,7 @@ } #endif pane_string = (NILP (pane_name) - ? "" : (char *) XSTRING (pane_name)->data); + ? "" : (char *) SDATA (pane_name)); /* If there is just one top-level pane, put all its items directly under the top-level menu. */ if (menu_items_n_panes == 1) @@ -1287,9 +1287,9 @@ else save_wv->contents = wv; - wv->name = (char *) XSTRING (item_name)->data; + wv->name = (char *) SDATA (item_name); if (!NILP (descrip)) - wv->key = (char *) XSTRING (descrip)->data; + wv->key = (char *) SDATA (descrip); wv->value = 0; /* The EMACS_INT cast avoids a warning. There's no problem as long as pointers have enough bits to hold small integers. */ @@ -1470,7 +1470,7 @@ string = XVECTOR (items)->contents[i + 1]; if (NILP (string)) break; - wv->name = (char *) XSTRING (string)->data; + wv->name = (char *) SDATA (string); wv = wv->next; } @@ -1493,7 +1493,7 @@ break; wv = xmalloc_widget_value (); - wv->name = (char *) XSTRING (string)->data; + wv->name = (char *) SDATA (string); wv->value = 0; wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; @@ -1676,7 +1676,7 @@ } #endif pane_string = (NILP (pane_name) - ? "" : (char *) XSTRING (pane_name)->data); + ? "" : (char *) SDATA (pane_name)); /* If there is just one top-level pane, put all its items directly under the top-level menu. */ if (menu_items_n_panes == 1) @@ -1741,9 +1741,9 @@ prev_wv->next = wv; else save_wv->contents = wv; - wv->name = (char *) XSTRING (item_name)->data; + wv->name = (char *) SDATA (item_name); if (!NILP (descrip)) - wv->key = (char *) XSTRING (descrip)->data; + wv->key = (char *) SDATA (descrip); wv->value = 0; /* Use the contents index as call_data, since we are restricted to 16-bits. */ @@ -1787,7 +1787,7 @@ if (STRING_MULTIBYTE (title)) title = ENCODE_SYSTEM (title); #endif - wv_title->name = (char *) XSTRING (title)->data; + wv_title->name = (char *) SDATA (title); wv_title->enabled = TRUE; wv_title->title = TRUE; wv_title->button_type = BUTTON_TYPE_NONE; @@ -2047,7 +2047,7 @@ pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; pane_string = (NILP (pane_name) - ? "" : (char *) XSTRING (pane_name)->data); + ? "" : (char *) SDATA (pane_name)); prev_wv = xmalloc_widget_value (); prev_wv->value = pane_string; if (keymaps && !NILP (prefix)) @@ -2096,8 +2096,8 @@ prev_wv->next = wv; wv->name = (char *) button_names[nb_buttons]; if (!NILP (descrip)) - wv->key = (char *) XSTRING (descrip)->data; - wv->value = (char *) XSTRING (item_name)->data; + wv->key = (char *) SDATA (descrip); + wv->value = (char *) SDATA (item_name); wv->call_data = (void *) i; /* menu item is identified by its index in menu_items table */ wv->enabled = !NILP (enable);
--- a/src/macterm.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/macterm.c Mon Jul 15 00:00:41 2002 +0000 @@ -7005,9 +7005,9 @@ if (glyph < end && STRINGP (glyph->object) - && XSTRING (glyph->object)->intervals + && STRING_INTERVALS (glyph->object) && glyph->charpos >= 0 - && glyph->charpos < XSTRING (glyph->object)->size) + && glyph->charpos < SCHARS (glyph->object)) { /* If we're on a string with `help-echo' text property, arrange for the help to be displayed. This is done by @@ -7328,7 +7328,7 @@ if (NILP (b)) b = make_number (0); if (NILP (e)) - e = make_number (XSTRING (object)->size - 1); + e = make_number (SCHARS (object) - 1); fast_find_string_pos (w, XINT (b), object, &dpyinfo->mouse_face_beg_col, &dpyinfo->mouse_face_beg_row, @@ -7426,7 +7426,7 @@ /* Try text properties. */ if (STRINGP (object) && charpos >= 0 - && charpos < XSTRING (object)->size) + && charpos < SCHARS (object)) { help = Fget_text_property (make_number (charpos), Qhelp_echo, object); @@ -9469,7 +9469,7 @@ if (NILP (icon)) hicon = LoadIcon (hinst, EMACS_CLASS); else if (STRINGP (icon)) - hicon = LoadImage (NULL, (LPCTSTR) XSTRING (icon)->data, IMAGE_ICON, 0, 0, + hicon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_LOADFROMFILE); else if (SYMBOLP (icon)) { @@ -9606,7 +9606,7 @@ to do. */ return fontset_name (fontset); - result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data)); + result = x_new_font (f, (SDATA (fontset_ascii (fontset)))); if (!STRINGP (result)) /* Can't load ASCII font. */ @@ -10893,7 +10893,7 @@ } } - ptnstr = XSTRING (pattern)->data; + ptnstr = SDATA (pattern); GCPRO2 (pattern, newlist); @@ -11243,9 +11243,9 @@ for (tail = font_names; CONSP (tail); tail = XCDR (tail)) if (dpyinfo->font_table[i].name && (!strcmp (dpyinfo->font_table[i].name, - XSTRING (XCAR (tail))->data) + SDATA (XCAR (tail))) || !strcmp (dpyinfo->font_table[i].full_name, - XSTRING (XCAR (tail))->data))) + SDATA (XCAR (tail))))) return (dpyinfo->font_table + i); } @@ -11263,7 +11263,7 @@ a bug of not finding a font even if the font surely exists and is loadable by XLoadQueryFont. */ if (size > 0 && !NILP (font_names)) - fontname = (char *) XSTRING (XCAR (font_names))->data; + fontname = (char *) SDATA (XCAR (font_names)); font = (MacFontStruct *) XLoadQueryFont (FRAME_MAC_DISPLAY (f), fontname); if (!font) @@ -11457,7 +11457,7 @@ char *name1, *name2; { int seen_colon = 0; - unsigned char *system_name = XSTRING (Vsystem_name)->data; + unsigned char *system_name = SDATA (Vsystem_name); int system_name_length = strlen (system_name); int length_until_period = 0; @@ -12968,7 +12968,7 @@ char *name1, *name2; { int seen_colon = 0; - unsigned char *system_name = XSTRING (Vsystem_name)->data; + unsigned char *system_name = SDATA (Vsystem_name); int system_name_length = strlen (system_name); int length_until_period = 0; @@ -13026,11 +13026,11 @@ #if 0 dpyinfo->mac_id_name - = (char *) xmalloc (XSTRING (Vinvocation_name)->size - + XSTRING (Vsystem_name)->size + = (char *) xmalloc (SCHARS (Vinvocation_name) + + SCHARS (Vsystem_name) + 2); sprintf (dpyinfo->mac_id_name, "%s@%s", - XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data); + SDATA (Vinvocation_name), SDATA (Vsystem_name)); #else dpyinfo->mac_id_name = (char *) xmalloc (strlen ("Mac Display") + 1); strcpy (dpyinfo->mac_id_name, "Mac Display");
--- a/src/minibuf.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/minibuf.c Mon Jul 15 00:00:41 2002 +0000 @@ -233,21 +233,21 @@ GCPRO2 (val, defalt); - if (STRINGP (val) && XSTRING (val)->size == 0 + if (STRINGP (val) && SCHARS (val) == 0 && STRINGP (defalt)) val = defalt; expr_and_pos = Fread_from_string (val, Qnil, Qnil); pos = XINT (Fcdr (expr_and_pos)); - if (pos != XSTRING (val)->size) + if (pos != SCHARS (val)) { /* Ignore trailing whitespace; any other trailing junk is an error. */ int i; pos = string_char_to_byte (val, pos); - for (i = pos; i < STRING_BYTES (XSTRING (val)); i++) + for (i = pos; i < SBYTES (val); i++) { - int c = XSTRING (val)->data[i]; + int c = SREF (val, i); if (c != ' ' && c != '\t' && c != '\n') error ("Trailing garbage following expression"); } @@ -280,7 +280,7 @@ char *line, *s; Lisp_Object val; - fprintf (stdout, "%s", XSTRING (prompt)->data); + fprintf (stdout, "%s", SDATA (prompt)); fflush (stdout); val = Qnil; @@ -648,7 +648,7 @@ last_minibuf_string = val; /* Add the value to the appropriate history list unless it is empty. */ - if (XSTRING (val)->size != 0 + if (SCHARS (val) != 0 && SYMBOLP (Vminibuffer_history_variable)) { /* If the caller wanted to save the value read on a history list, @@ -868,9 +868,9 @@ /* Convert to distance from end of input. */ if (XINT (position) < 1) /* A number too small means the beginning of the string. */ - pos = - XSTRING (initial_contents)->size; + pos = - SCHARS (initial_contents); else - pos = XINT (position) - 1 - XSTRING (initial_contents)->size; + pos = XINT (position) - 1 - SCHARS (initial_contents); } } @@ -950,7 +950,7 @@ val = Fread_from_minibuffer (prompt, initial_input, Qnil, Qnil, history, default_value, inherit_input_method); - if (STRINGP (val) && XSTRING (val)->size == 0 && ! NILP (default_value)) + if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value)) val = default_value; return val; } @@ -1185,9 +1185,9 @@ /* Is this element a possible completion? */ if (STRINGP (eltstring) - && XSTRING (string)->size <= XSTRING (eltstring)->size + && SCHARS (string) <= SCHARS (eltstring) && (tem = Fcompare_strings (eltstring, make_number (0), - make_number (XSTRING (string)->size), + make_number (SCHARS (string)), string, make_number (0), Qnil, completion_ignore_case ?Qt : Qnil), EQ (Qt, tem))) @@ -1233,11 +1233,11 @@ { matchcount = 1; bestmatch = eltstring; - bestmatchsize = XSTRING (eltstring)->size; + bestmatchsize = SCHARS (eltstring); } else { - compare = min (bestmatchsize, XSTRING (eltstring)->size); + compare = min (bestmatchsize, SCHARS (eltstring)); tem = Fcompare_strings (bestmatch, make_number (0), make_number (compare), eltstring, make_number (0), @@ -1259,8 +1259,8 @@ use it as the best match rather than one that is not an exact match. This way, we get the case pattern of the actual match. */ - if ((matchsize == XSTRING (eltstring)->size - && matchsize < XSTRING (bestmatch)->size) + if ((matchsize == SCHARS (eltstring) + && matchsize < SCHARS (bestmatch)) || /* If there is more than one exact match ignoring case, and one of them is exact including case, @@ -1268,29 +1268,29 @@ /* If there is no exact match ignoring case, prefer a match that does not change the case of the input. */ - ((matchsize == XSTRING (eltstring)->size) + ((matchsize == SCHARS (eltstring)) == - (matchsize == XSTRING (bestmatch)->size) + (matchsize == SCHARS (bestmatch)) && (tem = Fcompare_strings (eltstring, make_number (0), - make_number (XSTRING (string)->size), + make_number (SCHARS (string)), string, make_number (0), Qnil, Qnil), EQ (Qt, tem)) && (tem = Fcompare_strings (bestmatch, make_number (0), - make_number (XSTRING (string)->size), + make_number (SCHARS (string)), string, make_number (0), Qnil, Qnil), ! EQ (Qt, tem)))) bestmatch = eltstring; } - if (bestmatchsize != XSTRING (eltstring)->size + if (bestmatchsize != SCHARS (eltstring) || bestmatchsize != matchsize) /* Don't count the same string multiple times. */ matchcount++; bestmatchsize = matchsize; - if (matchsize <= XSTRING (string)->size + if (matchsize <= SCHARS (string) && matchcount > 1) /* No need to look any further. */ break; @@ -1303,13 +1303,13 @@ /* If we are ignoring case, and there is no exact match, and no additional text was supplied, don't change the case of what the user typed. */ - if (completion_ignore_case && bestmatchsize == XSTRING (string)->size - && XSTRING (bestmatch)->size > bestmatchsize) + if (completion_ignore_case && bestmatchsize == SCHARS (string) + && SCHARS (bestmatch) > bestmatchsize) return minibuf_conform_representation (string, bestmatch); /* Return t if the supplied string is an exact match (counting case); it does not require any change to be made. */ - if (matchcount == 1 && bestmatchsize == XSTRING (string)->size + if (matchcount == 1 && bestmatchsize == SCHARS (string) && (tem = Fcompare_strings (bestmatch, make_number (0), make_number (bestmatchsize), string, make_number (0), @@ -1423,17 +1423,17 @@ /* Is this element a possible completion? */ if (STRINGP (eltstring) - && XSTRING (string)->size <= XSTRING (eltstring)->size + && SCHARS (string) <= SCHARS (eltstring) /* If HIDE_SPACES, reject alternatives that start with space unless the input starts with space. */ - && ((STRING_BYTES (XSTRING (string)) > 0 - && XSTRING (string)->data[0] == ' ') - || XSTRING (eltstring)->data[0] != ' ' + && ((SBYTES (string) > 0 + && SREF (string, 0) == ' ') + || SREF (eltstring, 0) != ' ' || NILP (hide_spaces)) && (tem = Fcompare_strings (eltstring, make_number (0), - make_number (XSTRING (string)->size), + make_number (SCHARS (string)), string, make_number (0), - make_number (XSTRING (string)->size), + make_number (SCHARS (string)), completion_ignore_case ? Qt : Qnil), EQ (Qt, tem))) { @@ -1553,7 +1553,7 @@ { CHECK_NUMBER (position); /* Convert to distance from end of input. */ - pos = XINT (position) - XSTRING (init)->size; + pos = XINT (position) - SCHARS (init); } } @@ -1579,7 +1579,7 @@ histvar, histpos, def, 0, !NILP (inherit_input_method)); - if (STRINGP (val) && XSTRING (val)->size == 0 && ! NILP (def)) + if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (def)) val = def; RETURN_UNGCPRO (unbind_to (count, val)); @@ -1613,9 +1613,9 @@ { /* Bypass intern-soft as that loses for nil. */ tem = oblookup (alist, - XSTRING (string)->data, - XSTRING (string)->size, - STRING_BYTES (XSTRING (string))); + SDATA (string), + SCHARS (string), + SBYTES (string)); if (!SYMBOLP (tem)) { if (STRING_MULTIBYTE (string)) @@ -1624,9 +1624,9 @@ string = Fstring_make_multibyte (string); tem = oblookup (Vminibuffer_completion_table, - XSTRING (string)->data, - XSTRING (string)->size, - STRING_BYTES (XSTRING (string))); + SDATA (string), + SCHARS (string), + SBYTES (string)); if (!SYMBOLP (tem)) return Qnil; } @@ -1716,7 +1716,7 @@ /* Some completion happened */ if (! NILP (Vminibuffer_completing_file_name) - && XSTRING (completion)->data[STRING_BYTES (XSTRING (completion)) - 1] == '/' + && SREF (completion, SBYTES (completion) - 1) == '/' && PT < ZV && FETCH_CHAR (PT_BYTE) == '/') { @@ -1963,9 +1963,9 @@ #if 0 /* How the below code used to look, for reference. */ tem = Fminibuffer_contents (); - b = XSTRING (tem)->data; - i = ZV - 1 - XSTRING (completion)->size; - p = XSTRING (completion)->data; + b = SDATA (tem); + i = ZV - 1 - SCHARS (completion); + p = SDATA (completion); if (i > 0 || 0 <= scmp (b, p, ZV - 1)) { @@ -1996,8 +1996,8 @@ Finsert (1, &tem); } } - buffer_nchars = XSTRING (tem)->size; /* # chars in what we completed. */ - completion_nchars = XSTRING (completion)->size; + buffer_nchars = SCHARS (tem); /* # chars in what we completed. */ + completion_nchars = SCHARS (completion); i = buffer_nchars - completion_nchars; if (i > 0 || @@ -2042,7 +2042,7 @@ /* If completion finds next char not unique, consider adding a space or a hyphen. */ - if (i == XSTRING (completion)->size) + if (i == SCHARS (completion)) { GCPRO1 (completion); tem = Ftry_completion (concat2 (minibuffer_completion_contents (), @@ -2072,9 +2072,9 @@ i gets index in string of where to stop completing. */ { int len, c; - int bytes = STRING_BYTES (XSTRING (completion)); - completion_string = XSTRING (completion)->data; - for (; i_byte < STRING_BYTES (XSTRING (completion)); i_byte += len, i++) + int bytes = SBYTES (completion); + completion_string = SDATA (completion); + for (; i_byte < SBYTES (completion); i_byte += len, i++) { c = STRING_CHAR_AND_LENGTH (completion_string + i_byte, bytes - i_byte, @@ -2100,7 +2100,7 @@ /* Otherwise insert in minibuffer the chars we got */ if (! NILP (Vminibuffer_completing_file_name) - && XSTRING (completion)->data[STRING_BYTES (XSTRING (completion)) - 1] == '/' + && SREF (completion, SBYTES (completion) - 1) == '/' && PT < ZV && FETCH_CHAR (PT_BYTE) == '/') { @@ -2163,16 +2163,16 @@ { tem = XCAR (elt); CHECK_STRING (tem); - length = XSTRING (tem)->size; + length = SCHARS (tem); tem = Fcar (XCDR (elt)); CHECK_STRING (tem); - length += XSTRING (tem)->size; + length += SCHARS (tem); } else { CHECK_STRING (elt); - length = XSTRING (elt)->size; + length = SCHARS (elt); } /* This does a bad job for narrower than usual windows. @@ -2400,7 +2400,7 @@ (string) Lisp_Object string; { - temp_echo_area_glyphs (XSTRING (string)->data); + temp_echo_area_glyphs (SDATA (string)); return Qnil; }
--- a/src/msdos.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/msdos.c Mon Jul 15 00:00:41 2002 +0000 @@ -1454,9 +1454,9 @@ end = glyph + row->used[TEXT_AREA]; if (glyph < end && STRINGP (glyph->object) - && XSTRING (glyph->object)->intervals + && STRING_INTERVALS (glyph->object) && glyph->charpos >= 0 - && glyph->charpos < XSTRING (glyph->object)->size) + && glyph->charpos < SCHARS (glyph->object)) { /* If we're on a string with `help-echo' text property, arrange for the help to be displayed. This is done by @@ -1738,7 +1738,7 @@ else if (NILP (help) && ((STRINGP (glyph->object) && glyph->charpos >= 0 - && glyph->charpos < XSTRING (glyph->object)->size) + && glyph->charpos < SCHARS (glyph->object)) || (BUFFERP (glyph->object) && glyph->charpos >= BEGV && glyph->charpos < ZV))) @@ -2454,7 +2454,7 @@ { x_set_title (f, val); if (termscript) - fprintf (termscript, "<TITLE: %s>\n", XSTRING (val)->data); + fprintf (termscript, "<TITLE: %s>\n", SDATA (val)); } else if (EQ (prop, Qcursor_type)) { @@ -4405,7 +4405,7 @@ return Qnil; tem = Fcopy_sequence (filename); - msdos_downcase_filename (XSTRING (tem)->data); + msdos_downcase_filename (SDATA (tem)); return tem; }
--- a/src/print.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/print.c Mon Jul 15 00:00:41 2002 +0000 @@ -290,7 +290,7 @@ print_unwind (saved_text) Lisp_Object saved_text; { - bcopy (XSTRING (saved_text)->data, print_buffer, XSTRING (saved_text)->size); + bcopy (SDATA (saved_text), print_buffer, SCHARS (saved_text)); return Qnil; } @@ -461,7 +461,7 @@ int chars; if (STRING_MULTIBYTE (string)) - chars = XSTRING (string)->size; + chars = SCHARS (string); else if (EQ (printcharfun, Qt) ? ! NILP (buffer_defaults.enable_multibyte_characters) : ! NILP (current_buffer->enable_multibyte_characters)) @@ -472,22 +472,22 @@ Lisp_Object newstr; int bytes; - chars = STRING_BYTES (XSTRING (string)); - bytes = parse_str_to_multibyte (XSTRING (string)->data, chars); + chars = SBYTES (string); + bytes = parse_str_to_multibyte (SDATA (string), chars); if (chars < bytes) { newstr = make_uninit_multibyte_string (chars, bytes); - bcopy (XSTRING (string)->data, XSTRING (newstr)->data, chars); - str_to_multibyte (XSTRING (newstr)->data, bytes, chars); + bcopy (SDATA (string), SDATA (newstr), chars); + str_to_multibyte (SDATA (newstr), bytes, chars); string = newstr; } } else - chars = STRING_BYTES (XSTRING (string)); + chars = SBYTES (string); /* strout is safe for output to a frame (echo area) or to print_buffer. */ - strout (XSTRING (string)->data, - chars, STRING_BYTES (XSTRING (string)), + strout (SDATA (string), + chars, SBYTES (string), printcharfun, STRING_MULTIBYTE (string)); } else @@ -495,24 +495,24 @@ /* Otherwise, string may be relocated by printing one char. So re-fetch the string address for each character. */ int i; - int size = XSTRING (string)->size; - int size_byte = STRING_BYTES (XSTRING (string)); + int size = SCHARS (string); + int size_byte = SBYTES (string); struct gcpro gcpro1; GCPRO1 (string); if (size == size_byte) for (i = 0; i < size; i++) - PRINTCHAR (XSTRING (string)->data[i]); + PRINTCHAR (SREF (string, i)); else for (i = 0; i < size_byte; i++) { /* Here, we must convert each multi-byte form to the corresponding character code before handing it to PRINTCHAR. */ int len; - int ch = STRING_CHAR_AND_LENGTH (XSTRING (string)->data + i, + int ch = STRING_CHAR_AND_LENGTH (SDATA (string) + i, size_byte - i, len); if (!CHAR_VALID_P (ch, 0)) { - ch = XSTRING (string)->data[i]; + ch = SREF (string, i); len = 1; } PRINTCHAR (ch); @@ -664,7 +664,7 @@ GCPRO1(args); name = Feval (Fcar (args)); CHECK_STRING (name); - temp_output_buffer_setup (XSTRING (name)->data); + temp_output_buffer_setup (SDATA (name)); buf = Vstandard_output; UNGCPRO; @@ -1074,7 +1074,7 @@ /* Check that the spec we have is fully valid. This means not only valid for printf, but meant for floats, and reasonable. */ - cp = XSTRING (Vfloat_output_format)->data; + cp = SDATA (Vfloat_output_format); if (cp[0] != '%') goto lose; @@ -1104,7 +1104,7 @@ if (cp[1] != 0) goto lose; - sprintf (buf, XSTRING (Vfloat_output_format)->data, data); + sprintf (buf, SDATA (Vfloat_output_format), data); } /* Make sure there is a decimal point with digit after, or an @@ -1243,7 +1243,7 @@ { case Lisp_String: /* A string may have text properties, which can be circular. */ - traverse_intervals_noorder (XSTRING (obj)->intervals, + traverse_intervals_noorder (STRING_INTERVALS (obj), print_preprocess_string, Qnil); break; @@ -1379,15 +1379,15 @@ GCPRO1 (obj); - if (!NULL_INTERVAL_P (XSTRING (obj)->intervals)) + if (!NULL_INTERVAL_P (STRING_INTERVALS (obj))) { PRINTCHAR ('#'); PRINTCHAR ('('); } PRINTCHAR ('\"'); - str = XSTRING (obj)->data; - size_byte = STRING_BYTES (XSTRING (obj)); + str = SDATA (obj); + size_byte = SBYTES (obj); for (i = 0, i_byte = 0; i_byte < size_byte;) { @@ -1467,9 +1467,9 @@ } PRINTCHAR ('\"'); - if (!NULL_INTERVAL_P (XSTRING (obj)->intervals)) + if (!NULL_INTERVAL_P (STRING_INTERVALS (obj))) { - traverse_intervals (XSTRING (obj)->intervals, + traverse_intervals (STRING_INTERVALS (obj), 0, print_interval, printcharfun); PRINTCHAR (')'); } @@ -1481,8 +1481,8 @@ case Lisp_Symbol: { register int confusing; - register unsigned char *p = XSTRING (SYMBOL_NAME (obj))->data; - register unsigned char *end = p + STRING_BYTES (XSTRING (SYMBOL_NAME (obj))); + register unsigned char *p = SDATA (SYMBOL_NAME (obj)); + register unsigned char *end = p + SBYTES (SYMBOL_NAME (obj)); register int c; int i, i_byte, size_byte; Lisp_Object name; @@ -1517,7 +1517,7 @@ PRINTCHAR (':'); } - size_byte = STRING_BYTES (XSTRING (name)); + size_byte = SBYTES (name); for (i = 0, i_byte = 0; i_byte < size_byte;) { @@ -1735,9 +1735,9 @@ { PRINTCHAR (' '); PRINTCHAR ('\''); - strout (XSTRING (SYMBOL_NAME (h->test))->data, -1, -1, printcharfun, 0); + strout (SDATA (SYMBOL_NAME (h->test)), -1, -1, printcharfun, 0); PRINTCHAR (' '); - strout (XSTRING (SYMBOL_NAME (h->weak))->data, -1, -1, printcharfun, 0); + strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun, 0); PRINTCHAR (' '); sprintf (buf, "%d/%d", XFASTINT (h->count), XVECTOR (h->next)->size);
--- a/src/process.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/process.c Mon Jul 15 00:00:41 2002 +0000 @@ -419,7 +419,7 @@ signame = "unknown"; string = build_string (signame); string2 = build_string (coredump ? " (core dumped)\n" : "\n"); - XSTRING (string)->data[0] = DOWNCASE (XSTRING (string)->data[0]); + SREF (string, 0) = DOWNCASE (SREF (string, 0)); return concat2 (string, string2); } else if (EQ (symbol, Qexit)) @@ -637,7 +637,7 @@ if (NILP (obj)) obj = Fget_buffer (name); if (NILP (obj)) - error ("Process %s does not exist", XSTRING (name)->data); + error ("Process %s does not exist", SDATA (name)); } else if (NILP (name)) obj = Fcurrent_buffer (); @@ -650,7 +650,7 @@ { proc = Fget_buffer_process (obj); if (NILP (proc)) - error ("Buffer %s has no process", XSTRING (XBUFFER (obj)->name)->data); + error ("Buffer %s has no process", SDATA (XBUFFER (obj)->name)); } else { @@ -1070,17 +1070,17 @@ if (!NILP (query_only) && !NILP (p->kill_without_query)) continue; if (STRINGP (p->name) - && ( i = XSTRING (p->name)->size, (i > w_proc))) + && ( i = SCHARS (p->name), (i > w_proc))) w_proc = i; if (!NILP (p->buffer)) { if (NILP (XBUFFER (p->buffer)->name) && w_buffer < 8) w_buffer = 8; /* (Killed) */ - else if ((i = XSTRING (XBUFFER (p->buffer)->name)->size, (i > w_buffer))) + else if ((i = SCHARS (XBUFFER (p->buffer)->name), (i > w_buffer))) w_buffer = i; } if (STRINGP (p->tty_name) - && (i = XSTRING (p->tty_name)->size, (i > w_tty))) + && (i = SCHARS (p->tty_name), (i > w_tty))) w_tty = i; } @@ -1206,7 +1206,7 @@ port = Fnumber_to_string (port); sprintf (tembuf, "(network %s server on %s)\n", (DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"), - XSTRING (port)->data); + SDATA (port)); insert_string (tembuf); } else if (NETCONN1_P (p)) @@ -1222,7 +1222,7 @@ } sprintf (tembuf, "(network %s connection to %s)\n", (DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"), - XSTRING (host)->data); + SDATA (host)); insert_string (tembuf); } else @@ -1400,21 +1400,21 @@ #ifdef VMS /* Make a one member argv with all args concatenated together separated by a blank. */ - len = STRING_BYTES (XSTRING (program)) + 2; + len = SBYTES (program) + 2; for (i = 3; i < nargs; i++) { tem = args[i]; CHECK_STRING (tem); - len += STRING_BYTES (XSTRING (tem)) + 1; /* count the blank */ + len += SBYTES (tem) + 1; /* count the blank */ } new_argv = (unsigned char *) alloca (len); - strcpy (new_argv, XSTRING (program)->data); + strcpy (new_argv, SDATA (program)); for (i = 3; i < nargs; i++) { tem = args[i]; CHECK_STRING (tem); strcat (new_argv, " "); - strcat (new_argv, XSTRING (tem)->data); + strcat (new_argv, SDATA (tem)); } /* Need to add code here to check for program existence on VMS */ @@ -1422,9 +1422,9 @@ new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *)); /* If program file name is not absolute, search our path for it */ - if (!IS_DIRECTORY_SEP (XSTRING (program)->data[0]) - && !(XSTRING (program)->size > 1 - && IS_DEVICE_SEP (XSTRING (program)->data[1]))) + if (!IS_DIRECTORY_SEP (SREF (program, 0)) + && !(SCHARS (program) > 1 + && IS_DEVICE_SEP (SREF (program, 1)))) { struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -1436,7 +1436,7 @@ report_file_error ("Searching for program", Fcons (program, Qnil)); tem = Fexpand_file_name (tem, Qnil); tem = ENCODE_FILE (tem); - new_argv[0] = XSTRING (tem)->data; + new_argv[0] = SDATA (tem); } else { @@ -1444,7 +1444,7 @@ error ("Specified program for new process is a directory"); tem = ENCODE_FILE (program); - new_argv[0] = XSTRING (tem)->data; + new_argv[0] = SDATA (tem); } /* Here we encode arguments by the coding system used for sending @@ -1459,7 +1459,7 @@ if (STRING_MULTIBYTE (tem)) tem = (code_convert_string_norecord (tem, XPROCESS (proc)->encode_coding_system, 1)); - new_argv[i - 2] = XSTRING (tem)->data; + new_argv[i - 2] = SDATA (tem); } new_argv[i - 2] = 0; #endif /* not VMS */ @@ -2092,7 +2092,7 @@ if (family == AF_LOCAL) { struct sockaddr_un *sockun = (struct sockaddr_un *) sa; - cp = XSTRING (address)->data; + cp = SDATA (address); for (i = 0; i < sizeof (sockun->sun_path) && *cp; i++) sockun->sun_path[i] = *cp++; } @@ -2232,9 +2232,9 @@ opt = XCAR (opt); } if (STRINGP (opt)) - name = (char *) XSTRING (opt)->data; + name = (char *) SDATA (opt); else if (SYMBOLP (opt)) - name = (char *) XSTRING (SYMBOL_NAME (opt))->data; + name = (char *) SDATA (SYMBOL_NAME (opt)); else { error ("Mal-formed option list"); return 0; @@ -2300,9 +2300,9 @@ if (NILP (val)) arg = ""; else if (STRINGP (val)) - arg = (char *) XSTRING (val)->data; + arg = (char *) SDATA (val); else if (XSYMBOL (val)) - arg = (char *) XSTRING (SYMBOL_NAME (val))->data; + arg = (char *) SDATA (SYMBOL_NAME (val)); else error ("Invalid argument to %s option", name); } @@ -2632,16 +2632,16 @@ { struct servent *svc_info; CHECK_STRING (service); - svc_info = getservbyname (XSTRING (service)->data, "tcp"); + svc_info = getservbyname (SDATA (service), "tcp"); if (svc_info == 0) - error ("Unknown service: %s", XSTRING (service)->data); + error ("Unknown service: %s", SDATA (service)); port = svc_info->s_port; } s = connect_server (0); if (s < 0) report_file_error ("error creating socket", Fcons (name, Qnil)); - send_command (s, C_PORT, 0, "%s:%d", XSTRING (host)->data, ntohs (port)); + send_command (s, C_PORT, 0, "%s:%d", SDATA (host), ntohs (port)); send_command (s, C_DUMB, 1, 0); #else /* not TERM */ @@ -2694,7 +2694,7 @@ CHECK_STRING (service); bzero (&address_un, sizeof address_un); address_un.sun_family = AF_LOCAL; - strncpy (address_un.sun_path, XSTRING (service)->data, sizeof address_un.sun_path); + strncpy (address_un.sun_path, SDATA (service), sizeof address_un.sun_path); ai.ai_addr = (struct sockaddr *) &address_un; ai.ai_addrlen = sizeof address_un; goto open_socket; @@ -2739,7 +2739,7 @@ else { CHECK_STRING (service); - portstring = XSTRING (service)->data; + portstring = SDATA (service); } immediate_quit = 1; @@ -2749,12 +2749,12 @@ hints.ai_family = NILP (Fplist_member (contact, QCfamily)) ? AF_UNSPEC : family; hints.ai_socktype = socktype; hints.ai_protocol = 0; - ret = getaddrinfo (XSTRING (host)->data, portstring, &hints, &res); + ret = getaddrinfo (SDATA (host), portstring, &hints, &res); if (ret) #ifdef HAVE_GAI_STRERROR - error ("%s/%s %s", XSTRING (host)->data, portstring, gai_strerror(ret)); + error ("%s/%s %s", SDATA (host), portstring, gai_strerror(ret)); #else - error ("%s/%s getaddrinfo error %d", XSTRING (host)->data, portstring, ret); + error ("%s/%s getaddrinfo error %d", SDATA (host), portstring, ret); #endif immediate_quit = 0; @@ -2773,10 +2773,10 @@ { struct servent *svc_info; CHECK_STRING (service); - svc_info = getservbyname (XSTRING (service)->data, + svc_info = getservbyname (SDATA (service), (socktype == SOCK_DGRAM ? "udp" : "tcp")); if (svc_info == 0) - error ("Unknown service: %s", XSTRING (service)->data); + error ("Unknown service: %s", SDATA (service)); port = svc_info->s_port; } @@ -2794,7 +2794,7 @@ as it may `hang' emacs for a very long time. */ immediate_quit = 1; QUIT; - host_info_ptr = gethostbyname (XSTRING (host)->data); + host_info_ptr = gethostbyname (SDATA (host)); immediate_quit = 0; if (host_info_ptr) @@ -2808,9 +2808,9 @@ /* Attempt to interpret host as numeric inet address */ { IN_ADDR numeric_addr; - numeric_addr = inet_addr ((char *) XSTRING (host)->data); + numeric_addr = inet_addr ((char *) SDATA (host)); if (NUMERIC_ADDR_ERROR) - error ("Unknown host \"%s\"", XSTRING (host)->data); + error ("Unknown host \"%s\"", SDATA (host)); bcopy ((char *)&numeric_addr, (char *) &address_in.sin_addr, sizeof (address_in.sin_addr)); @@ -4283,7 +4283,7 @@ the tail of decoding buffer) should be prepended to the new data read to decode all together. */ chars = (char *) alloca (nbytes + carryover); - bcopy (XSTRING (p->decoding_buf)->data, buf, carryover); + bcopy (SDATA (p->decoding_buf), buf, carryover); bcopy (vs->inputBuffer, chars + carryover, nbytes); } #else /* not VMS */ @@ -4301,7 +4301,7 @@ chars = (char *) alloca (carryover + readmax); if (carryover) /* See the comment above. */ - bcopy (XSTRING (p->decoding_buf)->data, chars, carryover); + bcopy (SDATA (p->decoding_buf), chars, carryover); #ifdef DATAGRAM_SOCKETS /* We have a working select, so proc_buffered_char is always -1. */ @@ -4414,11 +4414,11 @@ } carryover = nbytes - coding->consumed; - bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data, + bcopy (chars + coding->consumed, SDATA (p->decoding_buf), carryover); XSETINT (p->decoding_carryover, carryover); - nbytes = STRING_BYTES (XSTRING (text)); - nchars = XSTRING (text)->size; + nbytes = SBYTES (text); + nchars = SCHARS (text); if (nbytes > 0) internal_condition_case_1 (read_process_output_call, Fcons (outstream, @@ -4515,7 +4515,7 @@ } } carryover = nbytes - coding->consumed; - bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data, + bcopy (chars + coding->consumed, SDATA (p->decoding_buf), carryover); XSETINT (p->decoding_carryover, carryover); /* Adjust the multibyteness of TEXT to that of the buffer. */ @@ -4524,8 +4524,8 @@ text = (STRING_MULTIBYTE (text) ? Fstring_as_unibyte (text) : Fstring_as_multibyte (text)); - nbytes = STRING_BYTES (XSTRING (text)); - nchars = XSTRING (text)->size; + nbytes = SBYTES (text); + nchars = SCHARS (text); /* Insert before markers in case we are inserting where the buffer's mark is, and the user's next command is Meta-y. */ insert_from_string_before_markers (text, 0, 0, nchars, nbytes, 0); @@ -4633,10 +4633,10 @@ update_status (XPROCESS (proc)); if (! EQ (XPROCESS (proc)->status, Qrun)) error ("Process %s not running", - XSTRING (XPROCESS (proc)->name)->data); + SDATA (XPROCESS (proc)->name)); if (XINT (XPROCESS (proc)->outfd) < 0) error ("Output file descriptor of %s is closed", - XSTRING (XPROCESS (proc)->name)->data); + SDATA (XPROCESS (proc)->name)); coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)]; Vlast_coding_system_used = coding->symbol; @@ -4691,7 +4691,7 @@ } else if (STRINGP (object)) { - from_byte = buf - XSTRING (object)->data; + from_byte = buf - SDATA (object); from = string_byte_to_char (object, from_byte); to = string_byte_to_char (object, from_byte + len); } @@ -4704,19 +4704,19 @@ coding->composing = COMPOSITION_DISABLED; } - if (STRING_BYTES (XSTRING (XPROCESS (proc)->encoding_buf)) < require) + if (SBYTES (XPROCESS (proc)->encoding_buf) < require) XPROCESS (proc)->encoding_buf = make_uninit_string (require); if (from_byte >= 0) buf = (BUFFERP (object) ? BUF_BYTE_ADDRESS (XBUFFER (object), from_byte) - : XSTRING (object)->data + from_byte); + : SDATA (object) + from_byte); object = XPROCESS (proc)->encoding_buf; - encode_coding (coding, (char *) buf, XSTRING (object)->data, - len, STRING_BYTES (XSTRING (object))); + encode_coding (coding, (char *) buf, SDATA (object), + len, SBYTES (object)); len = coding->produced; - buf = XSTRING (object)->data; + buf = SDATA (object); if (temp_buf) xfree (temp_buf); } @@ -4849,7 +4849,7 @@ if (BUFFERP (object)) offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); else if (STRINGP (object)) - offset = buf - XSTRING (object)->data; + offset = buf - SDATA (object); XSETFASTINT (zero, 0); #ifdef EMACS_HAS_USECS @@ -4861,7 +4861,7 @@ if (BUFFERP (object)) buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); else if (STRINGP (object)) - buf = offset + XSTRING (object)->data; + buf = offset + SDATA (object); rv = 0; } @@ -4893,10 +4893,10 @@ deactivate_process (proc); #ifdef VMS error ("Error writing to process %s; closed it", - XSTRING (XPROCESS (proc)->name)->data); + SDATA (XPROCESS (proc)->name)); #else error ("SIGPIPE raised on process %s; closed it", - XSTRING (XPROCESS (proc)->name)->data); + SDATA (XPROCESS (proc)->name)); #endif } @@ -4946,8 +4946,8 @@ Lisp_Object proc; CHECK_STRING (string); proc = get_process (process); - send_process (proc, XSTRING (string)->data, - STRING_BYTES (XSTRING (string)), string); + send_process (proc, SDATA (string), + SBYTES (string), string); return Qnil; } @@ -4970,10 +4970,10 @@ if (!EQ (p->childp, Qt)) error ("Process %s is not a subprocess", - XSTRING (p->name)->data); + SDATA (p->name)); if (XINT (p->infd) < 0) error ("Process %s is not active", - XSTRING (p->name)->data); + SDATA (p->name)); #ifdef TIOCGPGRP if (!NILP (p->subtty)) @@ -5018,10 +5018,10 @@ if (!EQ (p->childp, Qt)) error ("Process %s is not a subprocess", - XSTRING (p->name)->data); + SDATA (p->name)); if (XINT (p->infd) < 0) error ("Process %s is not active", - XSTRING (p->name)->data); + SDATA (p->name)); if (NILP (p->pty_flag)) current_group = Qnil; @@ -5337,7 +5337,7 @@ unsigned char *name; CHECK_SYMBOL (sigcode); - name = XSTRING (SYMBOL_NAME (sigcode))->data; + name = SDATA (SYMBOL_NAME (sigcode)); if (0) ; @@ -5464,7 +5464,7 @@ if (! NILP (XPROCESS (proc)->raw_status_low)) update_status (XPROCESS (proc)); if (! EQ (XPROCESS (proc)->status, Qrun)) - error ("Process %s not running", XSTRING (XPROCESS (proc)->name)->data); + error ("Process %s not running", SDATA (XPROCESS (proc)->name)); if (CODING_REQUIRE_FLUSHING (coding)) { @@ -5946,9 +5946,9 @@ CHECK_PROCESS (proc); p = XPROCESS (proc); if (XINT (p->infd) < 0) - error ("Input file descriptor of %s closed", XSTRING (p->name)->data); + error ("Input file descriptor of %s closed", SDATA (p->name)); if (XINT (p->outfd) < 0) - error ("Output file descriptor of %s closed", XSTRING (p->name)->data); + error ("Output file descriptor of %s closed", SDATA (p->name)); p->decode_coding_system = Fcheck_coding_system (decoding); p->encode_coding_system = Fcheck_coding_system (encoding);
--- a/src/search.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/search.c Mon Jul 15 00:00:41 2002 +0000 @@ -128,16 +128,16 @@ if (multibyte == STRING_MULTIBYTE (pattern)) { - raw_pattern = (unsigned char *) XSTRING (pattern)->data; - raw_pattern_size = STRING_BYTES (XSTRING (pattern)); + raw_pattern = (unsigned char *) SDATA (pattern); + raw_pattern_size = SBYTES (pattern); } else if (multibyte) { - raw_pattern_size = count_size_as_multibyte (XSTRING (pattern)->data, - XSTRING (pattern)->size); + raw_pattern_size = count_size_as_multibyte (SDATA (pattern), + SCHARS (pattern)); raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1); - copy_text (XSTRING (pattern)->data, raw_pattern, - XSTRING (pattern)->size, 0, 1); + copy_text (SDATA (pattern), raw_pattern, + SCHARS (pattern), 0, 1); } else { @@ -147,10 +147,10 @@ by subtracting nonascii-insert-offset from each non-ASCII char, so that only the multibyte chars which really correspond to the chosen single-byte character set can possibly match. */ - raw_pattern_size = XSTRING (pattern)->size; + raw_pattern_size = SCHARS (pattern); raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1); - copy_text (XSTRING (pattern)->data, raw_pattern, - STRING_BYTES (XSTRING (pattern)), 1, 0); + copy_text (SDATA (pattern), raw_pattern, + SBYTES (pattern), 1, 0); } cp->regexp = Qnil; @@ -217,7 +217,7 @@ should never appear before a non-nil entry. */ if (NILP (cp->regexp)) goto compile_it; - if (XSTRING (cp->regexp)->size == XSTRING (pattern)->size + if (SCHARS (cp->regexp) == SCHARS (pattern) && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern) && !NILP (Fstring_equal (cp->regexp, pattern)) && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) @@ -372,7 +372,7 @@ pos = 0, pos_byte = 0; else { - int len = XSTRING (string)->size; + int len = SCHARS (string); CHECK_NUMBER (start); pos = XINT (start); @@ -391,9 +391,9 @@ immediate_quit = 1; re_match_object = string; - val = re_search (bufp, (char *) XSTRING (string)->data, - STRING_BYTES (XSTRING (string)), pos_byte, - STRING_BYTES (XSTRING (string)) - pos_byte, + val = re_search (bufp, (char *) SDATA (string), + SBYTES (string), pos_byte, + SBYTES (string) - pos_byte, &search_regs); immediate_quit = 0; last_thing_searched = Qt; @@ -456,9 +456,9 @@ immediate_quit = 1; re_match_object = string; - val = re_search (bufp, (char *) XSTRING (string)->data, - STRING_BYTES (XSTRING (string)), 0, - STRING_BYTES (XSTRING (string)), 0); + val = re_search (bufp, (char *) SDATA (string), + SBYTES (string), 0, + SBYTES (string), 0); immediate_quit = 0; return val; } @@ -939,8 +939,8 @@ trivial_regexp_p (regexp) Lisp_Object regexp; { - int len = STRING_BYTES (XSTRING (regexp)); - unsigned char *s = XSTRING (regexp)->data; + int len = SBYTES (regexp); + unsigned char *s = SDATA (regexp); while (--len >= 0) { switch (*s++) @@ -1011,8 +1011,8 @@ Lisp_Object inverse_trt; int posix; { - int len = XSTRING (string)->size; - int len_byte = STRING_BYTES (XSTRING (string)); + int len = SCHARS (string); + int len_byte = SBYTES (string); register int i; if (running_asynch_code) @@ -1136,7 +1136,7 @@ int raw_pattern_size_byte; unsigned char *patbuf; int multibyte = !NILP (current_buffer->enable_multibyte_characters); - unsigned char *base_pat = XSTRING (string)->data; + unsigned char *base_pat = SDATA (string); int charset_base = -1; int boyer_moore_ok = 1; @@ -1146,19 +1146,19 @@ if (multibyte == STRING_MULTIBYTE (string)) { - raw_pattern = (unsigned char *) XSTRING (string)->data; - raw_pattern_size = XSTRING (string)->size; - raw_pattern_size_byte = STRING_BYTES (XSTRING (string)); + raw_pattern = (unsigned char *) SDATA (string); + raw_pattern_size = SCHARS (string); + raw_pattern_size_byte = SBYTES (string); } else if (multibyte) { - raw_pattern_size = XSTRING (string)->size; + raw_pattern_size = SCHARS (string); raw_pattern_size_byte - = count_size_as_multibyte (XSTRING (string)->data, + = count_size_as_multibyte (SDATA (string), raw_pattern_size); raw_pattern = (unsigned char *) alloca (raw_pattern_size_byte + 1); - copy_text (XSTRING (string)->data, raw_pattern, - XSTRING (string)->size, 0, 1); + copy_text (SDATA (string), raw_pattern, + SCHARS (string), 0, 1); } else { @@ -1168,11 +1168,11 @@ by subtracting nonascii-insert-offset from each non-ASCII char, so that only the multibyte chars which really correspond to the chosen single-byte character set can possibly match. */ - raw_pattern_size = XSTRING (string)->size; - raw_pattern_size_byte = XSTRING (string)->size; + raw_pattern_size = SCHARS (string); + raw_pattern_size_byte = SCHARS (string); raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1); - copy_text (XSTRING (string)->data, raw_pattern, - STRING_BYTES (XSTRING (string)), 1, 0); + copy_text (SDATA (string), raw_pattern, + SBYTES (string), 1, 0); } /* Copy and optionally translate the pattern. */ @@ -1948,8 +1948,8 @@ int adjust; CHECK_STRING (string); - p = XSTRING (string)->data; - len = XSTRING (string)->size; + p = SDATA (string); + len = SCHARS (string); for (i = 0, i_byte = 0; i < len; ) { @@ -1975,12 +1975,12 @@ adjust = - punct_count + 5 * (word_count - 1) + 4; if (STRING_MULTIBYTE (string)) val = make_uninit_multibyte_string (len + adjust, - STRING_BYTES (XSTRING (string)) + SBYTES (string) + adjust); else val = make_uninit_string (len + adjust); - o = XSTRING (val)->data; + o = SDATA (val); *o++ = '\\'; *o++ = 'b'; prev_c = 0; @@ -1994,7 +1994,7 @@ if (SYNTAX (c) == Sword) { - bcopy (&XSTRING (string)->data[i_byte_orig], o, + bcopy (&SREF (string, i_byte_orig), o, i_byte - i_byte_orig); o += i_byte - i_byte_orig; } @@ -2242,7 +2242,7 @@ { if (search_regs.start[sub] < 0 || search_regs.start[sub] > search_regs.end[sub] - || search_regs.end[sub] > XSTRING (string)->size) + || search_regs.end[sub] > SCHARS (string)) args_out_of_range (make_number (search_regs.start[sub]), make_number (search_regs.end[sub])); } @@ -2342,7 +2342,7 @@ /* We build up the substituted string in ACCUM. */ Lisp_Object accum; Lisp_Object middle; - int length = STRING_BYTES (XSTRING (newtext)); + int length = SBYTES (newtext); accum = Qnil; @@ -2434,7 +2434,7 @@ perform substitution on the replacement string. */ if (NILP (literal)) { - int length = STRING_BYTES (XSTRING (newtext)); + int length = SBYTES (newtext); unsigned char *substed; int substed_alloc_size, substed_len; int buf_multibyte = !NILP (current_buffer->enable_multibyte_characters); @@ -2471,7 +2471,7 @@ else { /* Note that we don't have to increment POS. */ - c = XSTRING (newtext)->data[pos_byte++]; + c = SDATA (newtext)[pos_byte++]; if (buf_multibyte) c = unibyte_char_to_multibyte (c); } @@ -2493,7 +2493,7 @@ } else { - c = XSTRING (newtext)->data[pos_byte++]; + c = SREF (newtext, pos_byte++); if (buf_multibyte) c = unibyte_char_to_multibyte (c); } @@ -2558,7 +2558,7 @@ /* Replace the old text with the new in the cleanest possible way. */ replace_range (search_regs.start[sub], search_regs.end[sub], newtext, 1, 0, 1); - newpoint = search_regs.start[sub] + XSTRING (newtext)->size; + newpoint = search_regs.start[sub] + SCHARS (newtext); if (case_action == all_caps) Fupcase_region (make_number (search_regs.start[sub]), @@ -2849,12 +2849,12 @@ CHECK_STRING (string); - temp = (unsigned char *) alloca (STRING_BYTES (XSTRING (string)) * 2); + temp = (unsigned char *) alloca (SBYTES (string) * 2); /* Now copy the data into the new string, inserting escapes. */ - in = XSTRING (string)->data; - end = in + STRING_BYTES (XSTRING (string)); + in = SDATA (string); + end = in + SBYTES (string); out = temp; for (; in != end; in++) @@ -2868,7 +2868,7 @@ } return make_specified_string (temp, - XSTRING (string)->size + backslashes_added, + SCHARS (string) + backslashes_added, out - temp, STRING_MULTIBYTE (string)); }
--- a/src/sound.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/sound.c Mon Jul 15 00:00:41 2002 +0000 @@ -433,8 +433,8 @@ else { s.data = attrs[SOUND_DATA]; - s.header_size = min (MAX_SOUND_HEADER_BYTES, STRING_BYTES (XSTRING (s.data))); - bcopy (XSTRING (s.data)->data, s.header, s.header_size); + s.header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (s.data)); + bcopy (SDATA (s.data), s.header, s.header_size); } /* Find out the type of sound. Give up if we can't tell. */ @@ -443,9 +443,9 @@ /* Set up a device. */ if (STRINGP (attrs[SOUND_DEVICE])) { - int len = XSTRING (attrs[SOUND_DEVICE])->size; + int len = SCHARS (attrs[SOUND_DEVICE]); sd.file = (char *) alloca (len + 1); - strcpy (sd.file, XSTRING (attrs[SOUND_DEVICE])->data); + strcpy (sd.file, SDATA (attrs[SOUND_DEVICE])); } if (INTEGERP (attrs[SOUND_VOLUME])) @@ -624,8 +624,8 @@ files I found so far. If someone feels inclined to implement the whole RIFF-WAVE spec, please do. */ if (STRINGP (s->data)) - sd->write (sd, XSTRING (s->data)->data + sizeof *header, - STRING_BYTES (XSTRING (s->data)) - sizeof *header); + sd->write (sd, SDATA (s->data) + sizeof *header, + SBYTES (s->data) - sizeof *header); else { char *buffer; @@ -712,8 +712,8 @@ sd->configure (sd); if (STRINGP (s->data)) - sd->write (sd, XSTRING (s->data)->data + header->data_offset, - STRING_BYTES (XSTRING (s->data)) - header->data_offset); + sd->write (sd, SDATA (s->data) + header->data_offset, + SBYTES (s->data) - header->data_offset); else { int blksize = 2048;
--- a/src/sunfns.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/sunfns.c Mon Jul 15 00:00:41 2002 +0000 @@ -240,13 +240,13 @@ CHECK_NUMBER (X_Hot); CHECK_NUMBER (Y_Hot); CHECK_STRING (Data); - if (XSTRING(Data)->size != 32) return(Qnil); + if (SCHARS (Data) != 32) return(Qnil); /* * Setup the new cursor */ NewCursor.cur_xhot = X_Hot; NewCursor.cur_yhot = Y_Hot; - cp = XSTRING(Data)->data; + cp = SDATA (Data); p = CursorData; i = 16; while(--i >= 0) @@ -267,7 +267,7 @@ struct selection *sel; FILE *file; { - fwrite (XSTRING (Current_Selection)->data, sizeof (char), + fwrite (SDATA (Current_Selection), sizeof (char), sel->sel_items, file); } @@ -330,7 +330,7 @@ CHECK_GFX (Qnil); selection.sel_type = SELTYPE_CHAR; - selection.sel_items = XSTRING (str)->size; + selection.sel_items = SCHARS (str); selection.sel_itembytes = 1; selection.sel_pubflags = 1; selection_set(&selection, sel_write, sel_clear, win_fd); @@ -371,10 +371,10 @@ if (VECTORP (Value)) { submenu = sun_menu_create (Value); menu_item = menu_create_item - (MENU_RELEASE, MENU_PULLRIGHT_ITEM, XSTRING(String)->data, submenu, 0); + (MENU_RELEASE, MENU_PULLRIGHT_ITEM, SDATA (String), submenu, 0); } else { menu_item = menu_create_item - (MENU_RELEASE, MENU_STRING_ITEM, XSTRING(String)->data, Value, 0); + (MENU_RELEASE, MENU_STRING_ITEM, SDATA (String), Value, 0); } return menu_item; }
--- a/src/syntax.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/syntax.c Mon Jul 15 00:00:41 2002 +0000 @@ -908,7 +908,7 @@ CHECK_STRING (string); - p = XSTRING (string)->data; + p = SDATA (string); code = (enum syntaxcode) syntax_spec_code[*p++]; if (((int) code & 0377) == 0377) error ("invalid syntax description letter: %c", p[-1]); @@ -920,7 +920,7 @@ { int len; int character = (STRING_CHAR_AND_LENGTH - (p, STRING_BYTES (XSTRING (string)) - 1, len)); + (p, SBYTES (string) - 1, len)); XSETINT (match, character); if (XFASTINT (match) == ' ') match = Qnil; @@ -1369,10 +1369,10 @@ int len; CHECK_STRING (string); - char_ranges = (int *) alloca (XSTRING (string)->size * (sizeof (int)) * 2); + char_ranges = (int *) alloca (SCHARS (string) * (sizeof (int)) * 2); string_multibyte = STRING_MULTIBYTE (string); - str = XSTRING (string)->data; - size_byte = STRING_BYTES (XSTRING (string)); + str = SDATA (string); + size_byte = SBYTES (string); /* Adjust the multibyteness of the string to that of the buffer. */ if (multibyte != string_multibyte) @@ -1380,14 +1380,14 @@ int nbytes; if (multibyte) - nbytes = count_size_as_multibyte (XSTRING (string)->data, - XSTRING (string)->size); + nbytes = count_size_as_multibyte (SDATA (string), + SCHARS (string)); else - nbytes = XSTRING (string)->size; + nbytes = SCHARS (string); if (nbytes != size_byte) { str = (unsigned char *) alloca (nbytes); - copy_text (XSTRING (string)->data, str, size_byte, + copy_text (SDATA (string), str, size_byte, string_multibyte, multibyte); size_byte = nbytes; } @@ -1409,7 +1409,7 @@ i_byte = 0; if (i_byte < size_byte - && XSTRING (string)->data[0] == '^') + && SREF (string, 0) == '^') { negate = 1; i_byte++; }
--- a/src/syntax.h Sun Jul 14 23:54:05 2002 +0000 +++ b/src/syntax.h Mon Jul 15 00:00:41 2002 +0000 @@ -330,7 +330,7 @@ else \ { \ gl_state.b_property = 0; \ - gl_state.e_property = 1 + XSTRING (gl_state.object)->size; \ + gl_state.e_property = 1 + SCHARS (gl_state.object); \ gl_state.offset = 0; \ } \ gl_state.use_global = 0; \
--- a/src/sysdep.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/sysdep.c Mon Jul 15 00:00:41 2002 +0000 @@ -795,9 +795,9 @@ goto xyzzy; dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil); - str = (unsigned char *) alloca (XSTRING (dir)->size + 2); - len = XSTRING (dir)->size; - bcopy (XSTRING (dir)->data, str, len); + str = (unsigned char *) alloca (SCHARS (dir) + 2); + len = SCHARS (dir); + bcopy (SDATA (dir), str, len); if (str[len - 1] != '/') str[len++] = '/'; str[len] = 0; xyzzy: @@ -2465,7 +2465,7 @@ #endif /* BSD4_1 */ { unsigned char *p; - for (p = XSTRING (Vsystem_name)->data; *p; p++) + for (p = SDATA (Vsystem_name); *p; p++) if (*p == ' ' || *p == '\t') *p = '-'; }
--- a/src/textprop.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/textprop.c Mon Jul 15 00:00:41 2002 +0000 @@ -776,7 +776,7 @@ if (NILP (position)) { if (NILP (limit)) - position = make_number (XSTRING (object)->size); + position = make_number (SCHARS (object)); else position = limit; } @@ -842,7 +842,7 @@ if (NILP (position)) { if (NILP (limit)) - position = make_number (XSTRING (object)->size); + position = make_number (SCHARS (object)); else position = limit; } @@ -935,7 +935,7 @@ if (NULL_INTERVAL_P (next)) XSETFASTINT (position, (STRINGP (object) - ? XSTRING (object)->size + ? SCHARS (object) : BUF_ZV (XBUFFER (object)))); else XSETFASTINT (position, next->position); @@ -955,7 +955,7 @@ return limit; if (NILP (limit)) XSETFASTINT (limit, (STRINGP (object) - ? XSTRING (object)->size + ? SCHARS (object) : BUF_ZV (XBUFFER (object)))); if (!(next->position < XFASTINT (limit))) return limit; @@ -1035,7 +1035,7 @@ return limit; if (NILP (limit)) XSETFASTINT (limit, (STRINGP (object) - ? XSTRING (object)->size + ? SCHARS (object) : BUF_ZV (XBUFFER (object)))); if (!(next->position < XFASTINT (limit))) return limit; @@ -1306,12 +1306,12 @@ get rid of its intervals. */ if (NILP (properties) && STRINGP (object) && XFASTINT (start) == 0 - && XFASTINT (end) == XSTRING (object)->size) + && XFASTINT (end) == SCHARS (object)) { - if (! XSTRING (object)->intervals) + if (! STRING_INTERVALS (object)) return Qt; - XSTRING (object)->intervals = 0; + STRING_INTERVALS (object) = 0; return Qt; }
--- a/src/undo.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/undo.c Mon Jul 15 00:00:41 2002 +0000 @@ -142,7 +142,7 @@ if (EQ (current_buffer->undo_list, Qt)) return; - if (PT == beg + XSTRING (string)->size) + if (PT == beg + SCHARS (string)) { XSETINT (sbeg, -beg); record_point (PT); @@ -334,7 +334,7 @@ size_so_far += sizeof (struct Lisp_Cons); if (STRINGP (XCAR (elt))) size_so_far += (sizeof (struct Lisp_String) - 1 - + XSTRING (XCAR (elt))->size); + + SCHARS (XCAR (elt))); } /* Advance to next element. */ @@ -369,7 +369,7 @@ size_so_far += sizeof (struct Lisp_Cons); if (STRINGP (XCAR (elt))) size_so_far += (sizeof (struct Lisp_String) - 1 - + XSTRING (XCAR (elt))->size); + + SCHARS (XCAR (elt))); } /* Advance to next element. */
--- a/src/w16select.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/w16select.c Mon Jul 15 00:00:41 2002 +0000 @@ -501,12 +501,12 @@ BLOCK_INPUT; - nbytes = STRING_BYTES (XSTRING (string)); - src = XSTRING (string)->data; + nbytes = SBYTES (string); + src = SDATA (string); /* Since we are now handling multilingual text, we must consider encoding text for the clipboard. */ - charset_info = find_charset_in_text (src, XSTRING (string)->size, nbytes, + charset_info = find_charset_in_text (src, SCHARS (string), nbytes, NULL, Qnil); if (charset_info == 0) @@ -531,8 +531,8 @@ && !NILP (Ffboundp (coding.pre_write_conversion))) { string = run_pre_post_conversion_on_str (string, &coding, 1); - src = XSTRING (string)->data; - nbytes = STRING_BYTES (XSTRING (string)); + src = SDATA (string); + nbytes = SBYTES (string); } coding.src_multibyte = 1; coding.dst_multibyte = 0;
--- a/src/w32.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/w32.c Mon Jul 15 00:00:41 2002 +0000 @@ -3581,8 +3581,8 @@ if (fd < 0) { Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil); - char *init_file_name = XSTRING (init_file)->data; - char *load_path = XSTRING (load_path_print)->data; + char *init_file_name = SDATA (init_file); + char *load_path = SDATA (load_path_print); char *buffer = alloca (1024); sprintf (buffer,
--- a/src/w32fns.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/w32fns.c Mon Jul 15 00:00:41 2002 +0000 @@ -571,7 +571,7 @@ { if (dpyinfo->bitmaps[id].refcount && dpyinfo->bitmaps[id].file - && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data)) + && !strcmp (dpyinfo->bitmaps[id].file, (char *) SDATA (file))) { ++dpyinfo->bitmaps[id].refcount; return id + 1; @@ -584,7 +584,7 @@ return -1; emacs_close (fd); - filename = (char *) XSTRING (found)->data; + filename = (char *) SDATA (found); hinst = LoadLibraryEx (filename, NULL, LOAD_LIBRARY_AS_DATAFILE); @@ -600,11 +600,11 @@ id = x_allocate_bitmap_record (f); dpyinfo->bitmaps[id - 1].pixmap = bitmap; dpyinfo->bitmaps[id - 1].refcount = 1; - dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (XSTRING (file)->size + 1); + dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (SCHARS (file) + 1); dpyinfo->bitmaps[id - 1].depth = 1; dpyinfo->bitmaps[id - 1].height = height; dpyinfo->bitmaps[id - 1].width = width; - strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data); + strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file)); return id; #endif /* TODO */ @@ -1216,7 +1216,7 @@ CHECK_STRING (filename); abspath = Fexpand_file_name (filename, Qnil); - fp = fopen (XSTRING (filename)->data, "rt"); + fp = fopen (SDATA (filename), "rt"); if (fp) { char buf[512]; @@ -1556,7 +1556,7 @@ tem = Fcar (elt); - if (lstrcmpi (XSTRING (tem)->data, colorname) == 0) + if (lstrcmpi (SDATA (tem), colorname) == 0) { ret = XUINT (Fcdr (elt)); break; @@ -1986,9 +1986,9 @@ CHECK_STRING (arg); - if (strcmp (XSTRING (arg)->data, "black") == 0) + if (strcmp (SDATA (arg), "black") == 0) return BLACK_PIX_DEFAULT (f); - else if (strcmp (XSTRING (arg)->data, "white") == 0) + else if (strcmp (SDATA (arg), "white") == 0) return WHITE_PIX_DEFAULT (f); if ((FRAME_W32_DISPLAY_INFO (f)->n_planes * FRAME_W32_DISPLAY_INFO (f)->n_cbits) == 1) @@ -1996,7 +1996,7 @@ /* w32_defined_color is responsible for coping with failures by looking for a near-miss. */ - if (w32_defined_color (f, XSTRING (arg)->data, &cdef, 1)) + if (w32_defined_color (f, SDATA (arg), &cdef, 1)) return cdef.pixel; /* defined_color failed; return an ultimate default. */ @@ -2476,11 +2476,11 @@ BLOCK_INPUT; result = x_text_icon (f, - (char *) XSTRING ((!NILP (f->icon_name) - ? f->icon_name - : !NILP (f->title) - ? f->title - : f->name))->data); + (char *) SDATA ((!NILP (f->icon_name) + ? f->icon_name + : !NILP (f->title) + ? f->title + : f->name))); if (result) { @@ -2522,12 +2522,12 @@ BLOCK_INPUT; result = (STRINGP (fontset_name) - ? x_new_fontset (f, XSTRING (fontset_name)->data) - : x_new_font (f, XSTRING (arg)->data)); + ? x_new_fontset (f, SDATA (fontset_name)) + : x_new_font (f, SDATA (arg))); UNBLOCK_INPUT; if (EQ (result, Qnil)) - error ("Font `%s' is not defined", XSTRING (arg)->data); + error ("Font `%s' is not defined", SDATA (arg)); else if (EQ (result, Qt)) error ("The characters of the given font have varying widths"); else if (STRINGP (result)) @@ -2812,7 +2812,7 @@ /* Check for no change needed in this very common case before we do any consing. */ if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name, - XSTRING (f->name)->data)) + SDATA (f->name))) return; name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name); } @@ -2836,7 +2836,7 @@ name = ENCODE_SYSTEM (name); BLOCK_INPUT; - SetWindowText(FRAME_W32_WINDOW (f), XSTRING (name)->data); + SetWindowText(FRAME_W32_WINDOW (f), SDATA (name)); UNBLOCK_INPUT; } } @@ -2896,7 +2896,7 @@ name = ENCODE_SYSTEM (name); BLOCK_INPUT; - SetWindowText(FRAME_W32_WINDOW (f), XSTRING (name)->data); + SetWindowText(FRAME_W32_WINDOW (f), SDATA (name)); UNBLOCK_INPUT; } } @@ -3002,10 +3002,10 @@ if (STRINGP (Vx_resource_name)) { - unsigned char *p = XSTRING (Vx_resource_name)->data; + unsigned char *p = SDATA (Vx_resource_name); int i; - len = STRING_BYTES (XSTRING (Vx_resource_name)); + len = SBYTES (Vx_resource_name); /* Only letters, digits, - and _ are valid in resource names. Count the valid characters and count the invalid ones. */ @@ -3044,12 +3044,12 @@ for (i = 0; i < len; i++) { - int c = XSTRING (new)->data[i]; + int c = SREF (new, i); if (! ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '_')) - XSTRING (new)->data[i] = '_'; + SREF (new, i) = '_'; } } @@ -3087,37 +3087,37 @@ /* Allocate space for the components, the dots which separate them, and the final '\0'. Make them big enough for the worst case. */ - name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) + name_key = (char *) alloca (SBYTES (Vx_resource_name) + (STRINGP (component) - ? STRING_BYTES (XSTRING (component)) : 0) - + STRING_BYTES (XSTRING (attribute)) + ? SBYTES (component) : 0) + + SBYTES (attribute) + 3); class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) - + STRING_BYTES (XSTRING (class)) + + SBYTES (class) + (STRINGP (subclass) - ? STRING_BYTES (XSTRING (subclass)) : 0) + ? SBYTES (subclass) : 0) + 3); /* Start with emacs.FRAMENAME for the name (the specific one) and with `Emacs' for the class key (the general one). */ - strcpy (name_key, XSTRING (Vx_resource_name)->data); + strcpy (name_key, SDATA (Vx_resource_name)); strcpy (class_key, EMACS_CLASS); strcat (class_key, "."); - strcat (class_key, XSTRING (class)->data); + strcat (class_key, SDATA (class)); if (!NILP (component)) { strcat (class_key, "."); - strcat (class_key, XSTRING (subclass)->data); + strcat (class_key, SDATA (subclass)); strcat (name_key, "."); - strcat (name_key, XSTRING (component)->data); + strcat (name_key, SDATA (component)); } strcat (name_key, "."); - strcat (name_key, XSTRING (attribute)->data); + strcat (name_key, SDATA (attribute)); value = x_get_string_resource (Qnil, name_key, class_key); @@ -3140,13 +3140,13 @@ /* Allocate space for the components, the dots which separate them, and the final '\0'. */ - name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name)) + name_key = (char *) alloca (SBYTES (Vinvocation_name) + strlen (attribute) + 2); class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) + strlen (class) + 2); sprintf (name_key, "%s.%s", - XSTRING (Vinvocation_name)->data, + SDATA (Vinvocation_name), attribute); sprintf (class_key, "%s.%s", EMACS_CLASS, class); @@ -3201,15 +3201,15 @@ switch (type) { case RES_TYPE_NUMBER: - return make_number (atoi (XSTRING (tem)->data)); + return make_number (atoi (SDATA (tem))); case RES_TYPE_FLOAT: - return make_float (atof (XSTRING (tem)->data)); + return make_float (atof (SDATA (tem))); case RES_TYPE_BOOLEAN: tem = Fdowncase (tem); - if (!strcmp (XSTRING (tem)->data, "on") - || !strcmp (XSTRING (tem)->data, "true")) + if (!strcmp (SDATA (tem), "on") + || !strcmp (SDATA (tem), "true")) return Qt; else return Qnil; @@ -3223,11 +3223,11 @@ { Lisp_Object lower; lower = Fdowncase (tem); - if (!strcmp (XSTRING (lower)->data, "on") - || !strcmp (XSTRING (lower)->data, "true")) + if (!strcmp (SDATA (lower), "on") + || !strcmp (SDATA (lower), "true")) return Qt; - else if (!strcmp (XSTRING (lower)->data, "off") - || !strcmp (XSTRING (lower)->data, "false")) + else if (!strcmp (SDATA (lower), "off") + || !strcmp (SDATA (lower), "false")) return Qnil; else return Fintern (tem, Qnil); @@ -3284,7 +3284,7 @@ CHECK_STRING (string); - geometry = XParseGeometry ((char *) XSTRING (string)->data, + geometry = XParseGeometry ((char *) SDATA (string), &x, &y, &width, &height); result = Qnil; @@ -5342,7 +5342,7 @@ Elsewhere we specify the window name for the window manager. */ { - char *str = (char *) XSTRING (Vx_resource_name)->data; + char *str = (char *) SDATA (Vx_resource_name); f->namebuf = (char *) xmalloc (strlen (str) + 1); strcpy (f->namebuf, str); } @@ -5409,9 +5409,9 @@ ? IconicState : NormalState)); - x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name) + x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name) ? f->icon_name - : f->name))->data); + : f->name))); #endif UNBLOCK_INPUT; @@ -5621,9 +5621,9 @@ { tem = Fquery_fontset (font, Qnil); if (STRINGP (tem)) - font = x_new_fontset (f, XSTRING (tem)->data); + font = x_new_fontset (f, SDATA (tem)); else - font = x_new_font (f, XSTRING (font)->data); + font = x_new_font (f, SDATA (font)); } /* Try out a font which we hope has bold and italic variations. */ if (!STRINGP (font)) @@ -5912,12 +5912,12 @@ for (tail = font_names; CONSP (tail); tail = XCDR (tail)) if (dpyinfo->font_table[i].name && (!strcmp (dpyinfo->font_table[i].name, - XSTRING (XCAR (tail))->data) + SDATA (XCAR (tail))) || !strcmp (dpyinfo->font_table[i].full_name, - XSTRING (XCAR (tail))->data))) + SDATA (XCAR (tail))))) return (dpyinfo->font_table + i); - fontname = (char *) XSTRING (XCAR (font_names))->data; + fontname = (char *) SDATA (XCAR (font_names)); } else if (w32_strict_fontnames) { @@ -6125,9 +6125,9 @@ char *bdf_name, *bdf_file; Lisp_Object bdf_pair; - bdf_name = XSTRING (XCAR (bdf_fonts))->data; + bdf_name = SDATA (XCAR (bdf_fonts)); bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist); - bdf_file = XSTRING (XCDR (bdf_pair))->data; + bdf_file = SDATA (XCDR (bdf_pair)); retval = w32_load_bdf_font (f, bdf_name, size, bdf_file); @@ -6413,7 +6413,7 @@ || !SYMBOLP (XCAR (XCDR (this_entry)))) continue; - x_charset = XSTRING (XCAR (this_entry))->data; + x_charset = SDATA (XCAR (this_entry)); w32_charset = XCAR (XCDR (this_entry)); codepage = XCDR (XCDR (this_entry)); @@ -7196,7 +7196,7 @@ if (!NILP (lpef->pattern)) { - charset = xlfd_charset_of_font (XSTRING(lpef->pattern)->data); + charset = xlfd_charset_of_font (SDATA (lpef->pattern)); /* We already checked charsets above, but DEFAULT_CHARSET slipped through. So only allow exact matches for DEFAULT_CHARSET. */ @@ -7216,7 +7216,7 @@ for ( ; CONSP (charset_list); charset_list = Fcdr (charset_list)) { Lisp_Object this_charset = Fcar (charset_list); - charset = XSTRING (this_charset)->data; + charset = SDATA (this_charset); /* List bold and italic variations if w32-enable-synthesized-fonts is non-nil and this is a plain font. */ @@ -7261,7 +7261,7 @@ return; if (NILP (lpef->pattern) - || w32_font_match (buf, XSTRING (lpef->pattern)->data)) + || w32_font_match (buf, SDATA (lpef->pattern))) { /* Check if we already listed this font. This may happen if w32_enable_synthesized_fonts is non-nil, and there are real @@ -7335,15 +7335,15 @@ int n_fonts = 0; list = Vw32_bdf_filename_alist; - ptnstr = XSTRING (pattern)->data; + ptnstr = SDATA (pattern); for ( ; CONSP (list); list = XCDR (list)) { tem = XCAR (list); if (CONSP (tem)) - fontname = XSTRING (XCAR (tem))->data; + fontname = SDATA (XCAR (tem)); else if (STRINGP (tem)) - fontname = XSTRING (tem)->data; + fontname = SDATA (tem); else continue; @@ -7395,7 +7395,7 @@ /* Avoid expensive EnumFontFamilies functions if we are not going to be able to output one of these anyway. */ - codepage = w32_codepage_for_font (XSTRING (tpat)->data); + codepage = w32_codepage_for_font (SDATA (tpat)); if (codepage != CP_8BIT && codepage != CP_UNICODE && codepage != CP_DEFAULT && codepage != CP_UNKNOWN && !IsValidCodePage(codepage)) @@ -7422,7 +7422,7 @@ /* Use EnumFontFamiliesEx where it is available, as it knows about character sets. Fall back to EnumFontFamilies for older versions of NT that don't support the 'Ex function. */ - x_to_w32_font (XSTRING (tpat)->data, &ef.logfont); + x_to_w32_font (SDATA (tpat), &ef.logfont); { LOGFONT font_match_pattern; HMODULE gdi32 = GetModuleHandle ("gdi32.dll"); @@ -7492,7 +7492,7 @@ HDC hdc; HANDLE oldobj; - if (!x_to_w32_font (XSTRING (XCAR (tem))->data, &lf)) + if (!x_to_w32_font (SDATA (XCAR (tem)), &lf)) continue; BLOCK_INPUT; @@ -7639,7 +7639,7 @@ for ( ; CONSP(filelist); filelist = XCDR (filelist)) { Lisp_Object filename = XCAR (filelist); - if (w32_BDF_to_x_font (XSTRING (filename)->data, fontname, 100)) + if (w32_BDF_to_x_font (SDATA (filename), fontname, 100)) store_in_alist (&list, build_string (fontname), filename); } return list; @@ -7684,7 +7684,7 @@ CHECK_STRING (color); - if (w32_defined_color (f, XSTRING (color)->data, &foo, 0)) + if (w32_defined_color (f, SDATA (color), &foo, 0)) return Qt; else return Qnil; @@ -7700,7 +7700,7 @@ CHECK_STRING (color); - if (w32_defined_color (f, XSTRING (color)->data, &foo, 0)) + if (w32_defined_color (f, SDATA (color), &foo, 0)) { Lisp_Object rgb[3]; @@ -8031,10 +8031,10 @@ validate_x_resource_name (); dpyinfo = w32_term_init (name, (unsigned char *)0, - (char *) XSTRING (Vx_resource_name)->data); + (char *) SDATA (Vx_resource_name)); if (dpyinfo == 0) - error ("Cannot connect to server %s", XSTRING (name)->data); + error ("Cannot connect to server %s", SDATA (name)); w32_in_use = 1; XSETFASTINT (Vwindow_system_version, 3); @@ -8089,7 +8089,7 @@ Vw32_color_map = Fw32_default_color_map (); if (! NILP (xrm_string)) - xrm_option = (unsigned char *) XSTRING (xrm_string)->data; + xrm_option = (unsigned char *) SDATA (xrm_string); else xrm_option = (unsigned char *) 0; @@ -8098,7 +8098,7 @@ { char basename[ MAX_PATH ], *str; - strcpy (basename, XSTRING (Vinvocation_name)->data); + strcpy (basename, SDATA (Vinvocation_name)); str = strrchr (basename, '.'); if (str) *str = 0; Vinvocation_name = build_string (basename); @@ -8110,15 +8110,15 @@ /* This is what opens the connection and sets x_current_display. This also initializes many symbols, such as those used for input. */ dpyinfo = w32_term_init (display, xrm_option, - (char *) XSTRING (Vx_resource_name)->data); + (char *) SDATA (Vx_resource_name)); if (dpyinfo == 0) { if (!NILP (must_succeed)) fatal ("Cannot connect to server %s.\n", - XSTRING (display)->data); + SDATA (display)); else - error ("Cannot connect to server %s", XSTRING (display)->data); + error ("Cannot connect to server %s", SDATA (display)); } w32_in_use = 1; @@ -8402,7 +8402,7 @@ /* Find key in KEYWORDS. Error if not found. */ for (i = 0; i < nkeywords; ++i) - if (strcmp (keywords[i].name, XSTRING (SYMBOL_NAME (key))->data) == 0) + if (strcmp (keywords[i].name, SDATA (SYMBOL_NAME (key))) == 0) break; if (i == nkeywords) @@ -8916,7 +8916,7 @@ xassert (STRINGP (color_name)); - if (w32_defined_color (f, XSTRING (color_name)->data, &color, 1)) + if (w32_defined_color (f, SDATA (color_name), &color, 1)) { /* This isn't called frequently so we get away with simply reallocating the color vector to the needed size, here. */ @@ -9694,7 +9694,7 @@ if (STRINGP (elt)) { - if (XSTRING (elt)->size + if (SCHARS (elt) < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) return 0; } @@ -9709,7 +9709,7 @@ } else if (STRINGP (data)) { - if (XSTRING (data)->size + if (SCHARS (data) < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) return 0; } @@ -10073,9 +10073,9 @@ { int w, h; return (STRINGP (data) - && xbm_read_bitmap_data (XSTRING (data)->data, - (XSTRING (data)->data - + STRING_BYTES (XSTRING (data))), + && xbm_read_bitmap_data (SDATA (data), + (SDATA (data) + + SBYTES (data)), &w, &h, NULL)); } @@ -10111,7 +10111,7 @@ return 0; } - contents = slurp_file (XSTRING (file)->data, &size); + contents = slurp_file (SDATA (file), &size); if (contents == NULL) { image_error ("Error loading XBM image `%s'", img->spec, Qnil); @@ -10161,9 +10161,9 @@ background); if (in_memory_file_p) - success_p = xbm_load_image (f, img, XSTRING (data)->data, - (XSTRING (data)->data - + STRING_BYTES (XSTRING (data)))); + success_p = xbm_load_image (f, img, SDATA (data), + (SDATA (data) + + SBYTES (data))); else { if (VECTORP (data)) @@ -10177,13 +10177,13 @@ { Lisp_Object line = XVECTOR (data)->contents[i]; if (STRINGP (line)) - bcopy (XSTRING (line)->data, p, nbytes); + bcopy (SDATA (line), p, nbytes); else bcopy (XBOOL_VECTOR (line)->data, p, nbytes); } } else if (STRINGP (data)) - bits = XSTRING (data)->data; + bits = SDATA (data); else bits = XBOOL_VECTOR (data)->data; @@ -10372,10 +10372,10 @@ { Lisp_Object name = XCAR (XCAR (tail)); Lisp_Object color = XCDR (XCAR (tail)); - xpm_syms[i].name = (char *) alloca (XSTRING (name)->size + 1); - strcpy (xpm_syms[i].name, XSTRING (name)->data); - xpm_syms[i].value = (char *) alloca (XSTRING (color)->size + 1); - strcpy (xpm_syms[i].value, XSTRING (color)->data); + xpm_syms[i].name = (char *) alloca (SCHARS (name) + 1); + strcpy (xpm_syms[i].name, SDATA (name)); + xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1); + strcpy (xpm_syms[i].value, SDATA (color)); } } @@ -10394,14 +10394,14 @@ } rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), - XSTRING (file)->data, &img->pixmap, &img->mask, + SDATA (file), &img->pixmap, &img->mask, &attrs); } else { Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); rc = XpmCreatePixmapFromBuffer (NULL, FRAME_W32_WINDOW (f), - XSTRING (buffer)->data, + SDATA (buffer), &img->pixmap, &img->mask, &attrs); } @@ -11218,8 +11218,8 @@ char *buf = NULL; struct stat st; - if (stat (XSTRING (file)->data, &st) == 0 - && (fp = fopen (XSTRING (file)->data, "r")) != NULL + if (stat (SDATA (file), &st) == 0 + && (fp = fopen (SDATA (file), "r")) != NULL && (buf = (char *) xmalloc (st.st_size), fread (buf, 1, st.st_size, fp) == st.st_size)) { @@ -11272,7 +11272,7 @@ return 0; } - contents = slurp_file (XSTRING (file)->data, &size); + contents = slurp_file (SDATA (file), &size); if (contents == NULL) { image_error ("Error reading `%s'", file, Qnil); @@ -11287,8 +11287,8 @@ { Lisp_Object data; data = image_spec_value (img->spec, QCdata, NULL); - p = XSTRING (data)->data; - end = p + STRING_BYTES (XSTRING (data)); + p = SDATA (data); + end = p + SBYTES (data); } /* Check magic number. */ @@ -11644,7 +11644,7 @@ } /* Open the image file. */ - fp = fopen (XSTRING (file)->data, "rb"); + fp = fopen (SDATA (file), "rb"); if (!fp) { image_error ("Cannot open image file `%s'", file, Qnil); @@ -11666,8 +11666,8 @@ else { /* Read from memory. */ - tbr.bytes = XSTRING (specified_data)->data; - tbr.len = STRING_BYTES (XSTRING (specified_data)); + tbr.bytes = SDATA (specified_data); + tbr.len = SBYTES (specified_data); tbr.index = 0; /* Check PNG signature. */ @@ -11793,7 +11793,7 @@ /* The user specified `:background', use that. */ { COLORREF color; - if (w32_defined_color (f, XSTRING (specified_bg)->data, &color, 0)) + if (w32_defined_color (f, SDATA (specified_bg), &color, 0)) { png_color_16 user_bg; @@ -12213,7 +12213,7 @@ return 0; } - fp = fopen (XSTRING (file)->data, "r"); + fp = fopen (SDATA (file), "r"); if (fp == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -12260,8 +12260,8 @@ if (NILP (specified_data)) jpeg_stdio_src (&cinfo, fp); else - jpeg_memory_src (&cinfo, XSTRING (specified_data)->data, - STRING_BYTES (XSTRING (specified_data))); + jpeg_memory_src (&cinfo, SDATA (specified_data), + SBYTES (specified_data)); jpeg_read_header (&cinfo, TRUE); @@ -12604,7 +12604,7 @@ } /* Try to open the image file. */ - tiff = TIFFOpen (XSTRING (file)->data, "r"); + tiff = TIFFOpen (SDATA (file), "r"); if (tiff == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -12615,8 +12615,8 @@ else { /* Memory source! */ - memsrc.bytes = XSTRING (specified_data)->data; - memsrc.len = STRING_BYTES (XSTRING (specified_data)); + memsrc.bytes = SDATA (specified_data); + memsrc.len = SBYTES (specified_data); memsrc.index = 0; tiff = TIFFClientOpen ("memory_source", "r", &memsrc, @@ -12852,7 +12852,7 @@ } /* Open the GIF file. */ - gif = DGifOpenFileName (XSTRING (file)->data); + gif = DGifOpenFileName (SDATA (file)); if (gif == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -12864,8 +12864,8 @@ { /* Read from memory! */ current_gif_memory_src = &memsrc; - memsrc.bytes = XSTRING (specified_data)->data; - memsrc.len = STRING_BYTES (XSTRING (specified_data)); + memsrc.bytes = SDATA (specified_data); + memsrc.len = SBYTES (specified_data); memsrc.index = 0; gif = DGifOpen(&memsrc, gif_read_from_memory); @@ -13323,10 +13323,10 @@ CHECK_STRING (value); BLOCK_INPUT; - prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); + prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom, XA_STRING, 8, PropModeReplace, - XSTRING (value)->data, XSTRING (value)->size); + SDATA (value), SCHARS (value)); /* Make sure the property is set when we return. */ XFlush (FRAME_W32_DISPLAY (f)); @@ -13352,7 +13352,7 @@ CHECK_STRING (prop); BLOCK_INPUT; - prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); + prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom); /* Make sure the property is removed when we return. */ @@ -13386,7 +13386,7 @@ CHECK_STRING (prop); BLOCK_INPUT; - prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); + prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom, 0, 0, False, XA_STRING, &actual_type, &actual_format, &actual_size, @@ -13753,9 +13753,9 @@ { tem = Fquery_fontset (font, Qnil); if (STRINGP (tem)) - font = x_new_fontset (f, XSTRING (tem)->data); + font = x_new_fontset (f, SDATA (tem)); else - font = x_new_font (f, XSTRING (font)->data); + font = x_new_font (f, SDATA (font)); } /* Try out a font which we hope has bold and italic variations. */ @@ -14313,14 +14313,14 @@ /* Create the dialog with PROMPT as title, using DIR as initial directory and using "*" as pattern. */ dir = Fexpand_file_name (dir, Qnil); - strncpy (init_dir, XSTRING (dir)->data, MAX_PATH); + strncpy (init_dir, SDATA (dir), MAX_PATH); init_dir[MAX_PATH] = '\0'; unixtodos_filename (init_dir); if (STRINGP (default_filename)) { char *file_name_only; - char *full_path_name = XSTRING (default_filename)->data; + char *full_path_name = SDATA (default_filename); unixtodos_filename (full_path_name); @@ -14354,7 +14354,7 @@ file_details.lpstrFile = filename; file_details.nMaxFile = sizeof (filename); file_details.lpstrInitialDir = init_dir; - file_details.lpstrTitle = XSTRING (prompt)->data; + file_details.lpstrTitle = SDATA (prompt); file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_ENABLEHOOK); if (!NILP (mustmatch)) @@ -14507,11 +14507,11 @@ document = ENCODE_FILE (document); if ((int) ShellExecute (NULL, (STRINGP (operation) ? - XSTRING (operation)->data : NULL), - XSTRING (document)->data, + SDATA (operation) : NULL), + SDATA (document), (STRINGP (parameters) ? - XSTRING (parameters)->data : NULL), - XSTRING (current_dir)->data, + SDATA (parameters) : NULL), + SDATA (current_dir), (INTEGERP (show_flag) ? XINT (show_flag) : SW_SHOWDEFAULT)) > 32) @@ -14573,7 +14573,7 @@ c = Fcar (c); if (!SYMBOLP (c)) abort (); - vk_code = lookup_vk_code (XSTRING (SYMBOL_NAME (c))->data); + vk_code = lookup_vk_code (SDATA (SYMBOL_NAME (c))); } else if (INTEGERP (c)) { @@ -14777,7 +14777,7 @@ /* On Windows, we may need to specify the root directory of the volume holding FILENAME. */ char rootname[MAX_PATH]; - char *name = XSTRING (encoded)->data; + char *name = SDATA (encoded); /* find the root name of the volume if given */ if (isalpha (name[0]) && name[1] == ':')
--- a/src/w32menu.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/w32menu.c Mon Jul 15 00:00:41 2002 +0000 @@ -518,7 +518,7 @@ enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; - if (!NILP (map) && XSTRING (item_string)->data[0] == '@') + if (!NILP (map) && SREF (item_string, 0) == '@') { if (!NILP (enabled)) /* An enabled separate pane. Remember this to handle it later. */ @@ -1201,7 +1201,7 @@ } #endif pane_string = (NILP (pane_name) - ? "" : (char *) XSTRING (pane_name)->data); + ? "" : (char *) SDATA (pane_name)); /* If there is just one top-level pane, put all its items directly under the top-level menu. */ if (menu_items_n_panes == 1) @@ -1265,9 +1265,9 @@ else save_wv->contents = wv; - wv->name = (char *) XSTRING (item_name)->data; + wv->name = (char *) SDATA (item_name); if (!NILP (descrip)) - wv->key = (char *) XSTRING (descrip)->data; + wv->key = (char *) SDATA (descrip); wv->value = 0; /* The EMACS_INT cast avoids a warning. There's no problem as long as pointers have enough bits to hold small integers. */ @@ -1448,7 +1448,7 @@ string = XVECTOR (items)->contents[i + 1]; if (NILP (string)) break; - wv->name = (char *) XSTRING (string)->data; + wv->name = (char *) SDATA (string); wv = wv->next; } @@ -1471,7 +1471,7 @@ break; wv = xmalloc_widget_value (); - wv->name = (char *) XSTRING (string)->data; + wv->name = (char *) SDATA (string); wv->value = 0; wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; @@ -1662,7 +1662,7 @@ } #endif pane_string = (NILP (pane_name) - ? "" : (char *) XSTRING (pane_name)->data); + ? "" : (char *) SDATA (pane_name)); /* If there is just one top-level pane, put all its items directly under the top-level menu. */ if (menu_items_n_panes == 1) @@ -1727,9 +1727,9 @@ prev_wv->next = wv; else save_wv->contents = wv; - wv->name = (char *) XSTRING (item_name)->data; + wv->name = (char *) SDATA (item_name); if (!NILP (descrip)) - wv->key = (char *) XSTRING (descrip)->data; + wv->key = (char *) SDATA (descrip); wv->value = 0; /* Use the contents index as call_data, since we are restricted to 16-bits. */ @@ -1773,7 +1773,7 @@ if (STRING_MULTIBYTE (title)) title = ENCODE_SYSTEM (title); #endif - wv_title->name = (char *) XSTRING (title)->data; + wv_title->name = (char *) SDATA (title); wv_title->enabled = TRUE; wv_title->title = TRUE; wv_title->button_type = BUTTON_TYPE_NONE; @@ -1906,7 +1906,7 @@ pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; pane_string = (NILP (pane_name) - ? "" : (char *) XSTRING (pane_name)->data); + ? "" : (char *) SDATA (pane_name)); prev_wv = xmalloc_widget_value (); prev_wv->value = pane_string; if (keymaps && !NILP (prefix)) @@ -1955,8 +1955,8 @@ prev_wv->next = wv; wv->name = (char *) button_names[nb_buttons]; if (!NILP (descrip)) - wv->key = (char *) XSTRING (descrip)->data; - wv->value = (char *) XSTRING (item_name)->data; + wv->key = (char *) SDATA (descrip); + wv->value = (char *) SDATA (item_name); wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; wv->enabled = !NILP (enable); wv->help = Qnil;
--- a/src/w32proc.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/w32proc.c Mon Jul 15 00:00:41 2002 +0000 @@ -760,7 +760,7 @@ } /* make sure argv[0] and cmdname are both in DOS format */ - cmdname = XSTRING (program)->data; + cmdname = SDATA (program); unixtodos_filename (cmdname); argv[0] = cmdname; @@ -784,7 +784,7 @@ strcpy (cmdname, egetenv ("CMDPROXY")); else { - strcpy (cmdname, XSTRING (Vinvocation_directory)->data); + strcpy (cmdname, SDATA (Vinvocation_directory)); strcat (cmdname, "cmdproxy.exe"); } unixtodos_filename (cmdname); @@ -1723,7 +1723,7 @@ filename = Fexpand_file_name (filename, Qnil); /* luckily, this returns the short version of each element in the path. */ - if (GetShortPathName (XSTRING (filename)->data, shortname, MAX_PATH) == 0) + if (GetShortPathName (SDATA (filename), shortname, MAX_PATH) == 0) return Qnil; CORRECT_DIR_SEPS (shortname); @@ -1747,7 +1747,7 @@ /* first expand it. */ filename = Fexpand_file_name (filename, Qnil); - if (!w32_get_long_filename (XSTRING (filename)->data, longname, MAX_PATH)) + if (!w32_get_long_filename (SDATA (filename), longname, MAX_PATH)) return Qnil; CORRECT_DIR_SEPS (longname);
--- a/src/w32select.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/w32select.c Mon Jul 15 00:00:41 2002 +0000 @@ -125,8 +125,8 @@ BLOCK_INPUT; - nbytes = STRING_BYTES (XSTRING (string)) + 1; - src = XSTRING (string)->data; + nbytes = SBYTES (string) + 1; + src = SDATA (string); dst = src; /* We need to know how many lines there are, since we need CRLF line @@ -141,7 +141,7 @@ { /* Since we are now handling multilingual text, we must consider encoding text for the clipboard. */ - int charset_info = find_charset_in_text (src, XSTRING (string)->size, + int charset_info = find_charset_in_text (src, SCHARS (string), nbytes, NULL, Qnil); if (charset_info == 0) @@ -202,8 +202,8 @@ && !NILP (Ffboundp (coding.pre_write_conversion))) { string = run_pre_post_conversion_on_str (string, &coding, 1); - src = XSTRING (string)->data; - nbytes = STRING_BYTES (XSTRING (string)); + src = SDATA (string); + nbytes = SBYTES (string); } coding.src_multibyte = 1; coding.dst_multibyte = 0; @@ -368,7 +368,7 @@ /* Convert CRLF line endings (the standard CF_TEXT clipboard format) to LF endings as used internally by Emacs. */ - dst = XSTRING (ret)->data; + dst = SDATA (ret); while (1) { unsigned char *next;
--- a/src/w32term.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/w32term.c Mon Jul 15 00:00:41 2002 +0000 @@ -6508,9 +6508,9 @@ if (glyph < end && STRINGP (glyph->object) - && XSTRING (glyph->object)->intervals + && STRING_INTERVALS (glyph->object) && glyph->charpos >= 0 - && glyph->charpos < XSTRING (glyph->object)->size) + && glyph->charpos < SCHARS (glyph->object)) { /* If we're on a string with `help-echo' text property, arrange for the help to be displayed. This is done by @@ -6829,7 +6829,7 @@ if (NILP (b)) b = make_number (0); if (NILP (e)) - e = make_number (XSTRING (object)->size - 1); + e = make_number (SCHARS (object) - 1); fast_find_string_pos (w, XINT (b), object, &dpyinfo->mouse_face_beg_col, &dpyinfo->mouse_face_beg_row, @@ -6927,7 +6927,7 @@ /* Try text properties. */ if (STRINGP (object) && charpos >= 0 - && charpos < XSTRING (object)->size) + && charpos < SCHARS (object)) { help = Fget_text_property (make_number (charpos), Qhelp_echo, object); @@ -8619,7 +8619,7 @@ /* We may get paint messages even though the client area is clipped - these are not expose events. */ DebPrint (("clipped frame %p (%s) got WM_PAINT - ignored\n", f, - XSTRING (f->name)->data)); + SDATA (f->name))); } else if (f->async_visible != 1) { @@ -8628,7 +8628,7 @@ f->async_iconified = 0; SET_FRAME_GARBAGED (f); DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f, - XSTRING (f->name)->data)); + SDATA (f->name))); /* WM_PAINT serves as MapNotify as well, so report visibility changes properly. */ @@ -9308,7 +9308,7 @@ if (!FRAME_OBSCURED_P (f)) { DebPrint (("frame %p (%s) obscured\n", f, - XSTRING (f->name)->data)); + SDATA (f->name))); } } else @@ -9320,7 +9320,7 @@ { SET_FRAME_GARBAGED (f); DebPrint (("obscured frame %p (%s) found to be visible\n", f, - XSTRING (f->name)->data)); + SDATA (f->name))); /* Force a redisplay sooner or later. */ record_asynch_buffer_change (); @@ -9991,7 +9991,7 @@ if (NILP (icon)) hicon = LoadIcon (hinst, EMACS_CLASS); else if (STRINGP (icon)) - hicon = LoadImage (NULL, (LPCTSTR) XSTRING (icon)->data, IMAGE_ICON, 0, 0, + hicon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_LOADFROMFILE); else if (SYMBOLP (icon)) { @@ -10121,7 +10121,7 @@ to do. */ return fontset_name (fontset); - result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data)); + result = x_new_font (f, (SDATA (fontset_ascii (fontset)))); if (!STRINGP (result)) /* Can't load ASCII font. */ @@ -11047,11 +11047,11 @@ dpyinfo->name_list_element = XCAR (w32_display_name_list); dpyinfo->w32_id_name - = (char *) xmalloc (XSTRING (Vinvocation_name)->size - + XSTRING (Vsystem_name)->size + = (char *) xmalloc (SCHARS (Vinvocation_name) + + SCHARS (Vsystem_name) + 2); sprintf (dpyinfo->w32_id_name, "%s@%s", - XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data); + SDATA (Vinvocation_name), SDATA (Vsystem_name)); /* Default Console mode values - overridden when running in GUI mode with values obtained from system metrics. */
--- a/src/window.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/window.c Mon Jul 15 00:00:41 2002 +0000 @@ -2747,7 +2747,7 @@ { if (!NILP (w->dedicated) && !EQ (tem, buffer)) error ("Window is dedicated to `%s'", - XSTRING (XBUFFER (tem)->name)->data); + SDATA (XBUFFER (tem)->name)); unshow_buffer (w); }
--- a/src/xdisp.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/xdisp.c Mon Jul 15 00:00:41 2002 +0000 @@ -3698,7 +3698,7 @@ it->stop_charpos = 0; xassert (STRINGP (it->string)); it->end_charpos = SCHARS (it->string); - it->multibyte_p = SMBP (it->string); + it->multibyte_p = STRING_MULTIBYTE (it->string); it->method = next_element_from_string; } else @@ -6102,9 +6102,9 @@ message = Fformat (2, args); if (log) - message3 (message, SBYTES (message), SMBP (message)); + message3 (message, SBYTES (message), STRING_MULTIBYTE (message)); else - message3_nolog (message, SBYTES (message), SMBP (message)); + message3_nolog (message, SBYTES (message), STRING_MULTIBYTE (message)); UNGCPRO; @@ -6824,7 +6824,7 @@ xassert (CONSP (Vmessage_stack)); msg = XCAR (Vmessage_stack); if (STRINGP (msg)) - message3_nolog (msg, SBYTES (msg), SMBP (msg)); + message3_nolog (msg, SBYTES (msg), STRING_MULTIBYTE (msg)); else message3_nolog (msg, 0, 0); }
--- a/src/xfaces.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/xfaces.c Mon Jul 15 00:00:41 2002 +0000 @@ -290,7 +290,7 @@ /* Make a copy of the contents of Lisp string S on the stack using alloca. Value is a pointer to the copy. */ -#define LSTRDUPA(S) STRDUPA (XSTRING ((S))->data) +#define LSTRDUPA(S) STRDUPA (SDATA ((S))) /* Size of hash table of realized faces in face caches (should be a prime number). */ @@ -1146,7 +1146,7 @@ { int bytes_per_row = ((XFASTINT (width) + BITS_PER_CHAR - 1) / BITS_PER_CHAR); - if (STRING_BYTES (XSTRING (data)) >= bytes_per_row * XINT (height)) + if (SBYTES (data) >= bytes_per_row * XINT (height)) pixmap_p = 1; } } @@ -1190,7 +1190,7 @@ h = XINT (Fcar (Fcdr (name))); bits = Fcar (Fcdr (Fcdr (name))); - bitmap_id = x_create_bitmap_from_data (f, XSTRING (bits)->data, + bitmap_id = x_create_bitmap_from_data (f, SDATA (bits), w, h); } else @@ -1569,7 +1569,7 @@ CHECK_FRAME (frame); CHECK_STRING (color); f = XFRAME (frame); - return face_color_gray_p (f, XSTRING (color)->data) ? Qt : Qnil; + return face_color_gray_p (f, SDATA (color)) ? Qt : Qnil; } @@ -1587,7 +1587,7 @@ CHECK_FRAME (frame); CHECK_STRING (color); f = XFRAME (frame); - if (face_color_supported_p (f, XSTRING (color)->data, !NILP (background_p))) + if (face_color_supported_p (f, SDATA (color), !NILP (background_p))) return Qt; return Qnil; } @@ -1621,7 +1621,7 @@ /* if the color map is full, defined_color will return a best match to the values in an existing cell. */ - if (!defined_color (f, XSTRING (name)->data, &color, 1)) + if (!defined_color (f, SDATA (name), &color, 1)) { add_to_log ("Unable to load color \"%s\"", name, Qnil); @@ -1701,7 +1701,7 @@ face_color_supported_p is smart enough to know that grays are "supported" as background because we are supposed to use stipple for them. */ - if (!face_color_supported_p (f, XSTRING (bg)->data, 0) + if (!face_color_supported_p (f, SDATA (bg), 0) && !NILP (Fbitmap_spec_p (Vface_default_stipple))) { x_destroy_bitmap (f, face->stipple); @@ -2476,7 +2476,7 @@ for (tem = lfonts; CONSP (tem) && n < nfonts; tem = XCDR (tem)) { Lisp_Object elt, tail; - char *name = XSTRING (XCAR (tem))->data; + char *name = SDATA (XCAR (tem)); /* Ignore fonts matching a pattern from face-ignored-fonts. */ for (tail = Vface_ignored_fonts; CONSP (tail); tail = XCDR (tail)) @@ -2520,7 +2520,7 @@ Lisp_Object entry = XCAR (list); if (CONSP (entry) && STRINGP (XCAR (entry)) - && strcmp (XSTRING (XCAR (entry))->data, pattern) == 0) + && strcmp (SDATA (XCAR (entry)), pattern) == 0) break; list = XCDR (list); } @@ -2536,8 +2536,8 @@ STRINGP (name)) /* Ignore patterns equal to PATTERN because we tried that already with no success. */ - && (strcmp (XSTRING (name)->data, pattern) == 0 - || (n = x_face_list_fonts (f, XSTRING (name)->data, + && (strcmp (SDATA (name), pattern) == 0 + || (n = x_face_list_fonts (f, SDATA (name), fonts, nfonts, 0), n == 0))) patterns = XCDR (patterns); @@ -2647,8 +2647,8 @@ if (NILP (pattern)) { - family_str = (NILP (family) ? "*" : (char *) XSTRING (family)->data); - registry_str = (NILP (registry) ? "*" : (char *) XSTRING (registry)->data); + family_str = (NILP (family) ? "*" : (char *) SDATA (family)); + registry_str = (NILP (registry) ? "*" : (char *) SDATA (registry)); pattern_str = (char *) alloca (strlen (family_str) + strlen (registry_str) @@ -2666,7 +2666,7 @@ } } else - pattern_str = (char *) XSTRING (pattern)->data; + pattern_str = (char *) SDATA (pattern); return sorted_font_list (f, pattern_str, cmp_font_names, fonts); } @@ -3087,7 +3087,7 @@ Lisp_Object aliased; if (STRINGP (face_name)) - face_name = intern (XSTRING (face_name)->data); + face_name = intern (SDATA (face_name)); while (SYMBOLP (face_name)) { @@ -3210,13 +3210,13 @@ int pt; int have_xlfd_p; int fontset; - char *font_name = XSTRING (fontname)->data; + char *font_name = SDATA (fontname); struct font_info *font_info; /* If FONTNAME is actually a fontset name, get ASCII font name of it. */ fontset = fs_query_fontset (fontname, 0); if (fontset >= 0) - font_name = XSTRING (fontset_ascii (fontset))->data; + font_name = SDATA (fontset_ascii (fontset)); /* Check if FONT_NAME is surely available on the system. Usually FONT_NAME is already cached for the frame F and FS_LOAD_FONT @@ -3522,7 +3522,7 @@ add_to_log ("Invalid face color", color_name, Qnil); } else if (SYMBOLP (first) - && *XSTRING (SYMBOL_NAME (first))->data == ':') + && *SDATA (SYMBOL_NAME (first)) == ':') { /* Assume this is the property list form. */ while (CONSP (prop) && CONSP (XCDR (prop))) @@ -3904,7 +3904,7 @@ if (!UNSPECIFIEDP (value)) { CHECK_STRING (value); - if (XSTRING (value)->size == 0) + if (SCHARS (value) == 0) signal_error ("Invalid face family", value); } old_value = LFACE_FAMILY (lface); @@ -3964,7 +3964,7 @@ && !EQ (value, Qnil)) /* Underline color. */ || (STRINGP (value) - && XSTRING (value)->size == 0)) + && SCHARS (value) == 0)) signal_error ("Invalid face underline", value); old_value = LFACE_UNDERLINE (lface); @@ -3978,7 +3978,7 @@ && !EQ (value, Qnil)) /* Overline color. */ || (STRINGP (value) - && XSTRING (value)->size == 0)) + && SCHARS (value) == 0)) signal_error ("Invalid face overline", value); old_value = LFACE_OVERLINE (lface); @@ -3992,7 +3992,7 @@ && !EQ (value, Qnil)) /* Strike-through color. */ || (STRINGP (value) - && XSTRING (value)->size == 0)) + && SCHARS (value) == 0)) signal_error ("Invalid face strike-through", value); old_value = LFACE_STRIKE_THROUGH (lface); @@ -4014,7 +4014,7 @@ else if (INTEGERP (value)) valid_p = XINT (value) != 0; else if (STRINGP (value)) - valid_p = XSTRING (value)->size > 0; + valid_p = SCHARS (value) > 0; else if (CONSP (value)) { Lisp_Object tem; @@ -4038,7 +4038,7 @@ } else if (EQ (k, QCcolor)) { - if (!STRINGP (v) || XSTRING (v)->size == 0) + if (!STRINGP (v) || SCHARS (v) == 0) break; } else if (EQ (k, QCstyle)) @@ -4081,7 +4081,7 @@ on the frame (display) whether the color will be valid when the face is realized. */ CHECK_STRING (value); - if (XSTRING (value)->size == 0) + if (SCHARS (value) == 0) signal_error ("Empty foreground color value", value); } old_value = LFACE_FOREGROUND (lface); @@ -4095,7 +4095,7 @@ on the frame (display) whether the color will be valid when the face is realized. */ CHECK_STRING (value); - if (XSTRING (value)->size == 0) + if (SCHARS (value) == 0) signal_error ("Empty background color value", value); } old_value = LFACE_BACKGROUND (lface); @@ -4445,13 +4445,13 @@ xassert (STRINGP (value)); - if (xstricmp (XSTRING (value)->data, "on") == 0 - || xstricmp (XSTRING (value)->data, "true") == 0) + if (xstricmp (SDATA (value), "on") == 0 + || xstricmp (SDATA (value), "true") == 0) result = Qt; - else if (xstricmp (XSTRING (value)->data, "off") == 0 - || xstricmp (XSTRING (value)->data, "false") == 0) + else if (xstricmp (SDATA (value), "off") == 0 + || xstricmp (SDATA (value), "false") == 0) result = Qnil; - else if (xstricmp (XSTRING (value)->data, "unspecified") == 0) + else if (xstricmp (SDATA (value), "unspecified") == 0) result = Qunspecified; else if (signal_p) signal_error ("Invalid face attribute value from X resource", value); @@ -4471,7 +4471,7 @@ CHECK_SYMBOL (attr); CHECK_STRING (value); - if (xstricmp (XSTRING (value)->data, "unspecified") == 0) + if (xstricmp (SDATA (value), "unspecified") == 0) value = Qunspecified; else if (EQ (attr, QCheight)) { @@ -4482,7 +4482,7 @@ else if (EQ (attr, QCbold) || EQ (attr, QCitalic)) value = face_boolean_x_resource_value (value, 1); else if (EQ (attr, QCweight) || EQ (attr, QCslant) || EQ (attr, QCwidth)) - value = intern (XSTRING (value)->data); + value = intern (SDATA (value)); else if (EQ (attr, QCreverse_video) || EQ (attr, QCinverse_video)) value = face_boolean_x_resource_value (value, 1); else if (EQ (attr, QCunderline) @@ -4528,7 +4528,7 @@ char line[512]; Lisp_Object lface = lface_from_face_name (f, Qmenu, 1); struct face *face = FACE_FROM_ID (f, MENU_FACE_ID); - char *myname = XSTRING (Vx_resource_name)->data; + char *myname = SDATA (Vx_resource_name); int changed_p = 0; #ifdef USE_MOTIF const char *popup_path = "popup_menu"; @@ -4540,10 +4540,10 @@ { sprintf (line, "%s.%s*foreground: %s", myname, popup_path, - XSTRING (LFACE_FOREGROUND (lface))->data); + SDATA (LFACE_FOREGROUND (lface))); XrmPutLineResource (&rdb, line); sprintf (line, "%s.pane.menubar*foreground: %s", - myname, XSTRING (LFACE_FOREGROUND (lface))->data); + myname, SDATA (LFACE_FOREGROUND (lface))); XrmPutLineResource (&rdb, line); changed_p = 1; } @@ -4552,10 +4552,10 @@ { sprintf (line, "%s.%s*background: %s", myname, popup_path, - XSTRING (LFACE_BACKGROUND (lface))->data); + SDATA (LFACE_BACKGROUND (lface))); XrmPutLineResource (&rdb, line); sprintf (line, "%s.pane.menubar*background: %s", - myname, XSTRING (LFACE_BACKGROUND (lface))->data); + myname, SDATA (LFACE_BACKGROUND (lface))); XrmPutLineResource (&rdb, line); changed_p = 1; } @@ -4837,10 +4837,10 @@ switch (XTYPE (a)) { case Lisp_String: - equal_p = ((STRING_BYTES (XSTRING (a)) - == STRING_BYTES (XSTRING (b))) - && bcmp (XSTRING (a)->data, XSTRING (b)->data, - STRING_BYTES (XSTRING (a))) == 0); + equal_p = ((SBYTES (a) + == SBYTES (b)) + && bcmp (SDATA (a), SDATA (b), + SBYTES (a)) == 0); break; case Lisp_Int: @@ -4942,7 +4942,7 @@ unsigned char *s; unsigned hash = 0; xassert (STRINGP (string)); - for (s = XSTRING (string)->data; *s; ++s) + for (s = SDATA (string); *s; ++s) hash = (hash << 1) ^ tolower (*s); return hash; } @@ -4975,8 +4975,8 @@ { xassert (lface_fully_specified_p (lface1) && lface_fully_specified_p (lface2)); - return (xstricmp (XSTRING (lface1[LFACE_FAMILY_INDEX])->data, - XSTRING (lface2[LFACE_FAMILY_INDEX])->data) == 0 + return (xstricmp (SDATA (lface1[LFACE_FAMILY_INDEX]), + SDATA (lface2[LFACE_FAMILY_INDEX])) == 0 && EQ (lface1[LFACE_HEIGHT_INDEX], lface2[LFACE_HEIGHT_INDEX]) && EQ (lface1[LFACE_SWIDTH_INDEX], lface2[LFACE_SWIDTH_INDEX]) && EQ (lface1[LFACE_AVGWIDTH_INDEX], lface2[LFACE_AVGWIDTH_INDEX]) @@ -4985,8 +4985,8 @@ && (EQ (lface1[LFACE_FONT_INDEX], lface2[LFACE_FONT_INDEX]) || (STRINGP (lface1[LFACE_FONT_INDEX]) && STRINGP (lface2[LFACE_FONT_INDEX]) - && xstricmp (XSTRING (lface1[LFACE_FONT_INDEX])->data, - XSTRING (lface2[LFACE_FONT_INDEX])->data)))); + && xstricmp (SDATA (lface1[LFACE_FONT_INDEX]), + SDATA (lface2[LFACE_FONT_INDEX]))))); } @@ -5141,11 +5141,11 @@ if ((CONSP (color1) && !parse_rgb_list (color1, &cdef1)) || !STRINGP (color1) - || !defined_color (f, XSTRING (color1)->data, &cdef1, 0)) + || !defined_color (f, SDATA (color1), &cdef1, 0)) signal_error ("Invalid color", color1); if ((CONSP (color2) && !parse_rgb_list (color2, &cdef2)) || !STRINGP (color2) - || !defined_color (f, XSTRING (color2)->data, &cdef2, 0)) + || !defined_color (f, SDATA (color2), &cdef2, 0)) signal_error ("Invalid color", color2); return make_number (color_distance (&cdef1, &cdef2)); @@ -6347,7 +6347,7 @@ if the family is -etl-fixed, e.g. The following widens the choices and fixes that problem. */ if (nfonts == 0 && STRINGP (face_family) && STRINGP (registry) - && xstricmp (XSTRING (registry)->data, "mac-roman") == 0) + && xstricmp (SDATA (registry), "mac-roman") == 0) nfonts = try_alternative_families (f, face_family, Qnil, fonts); #endif @@ -6421,7 +6421,7 @@ /* If what we got is a name pattern, return it. */ if (STRINGP (pattern)) - return xstrdup (XSTRING (pattern)->data); + return xstrdup (SDATA (pattern)); /* Get a list of fonts matching that pattern and choose the best match for the specified face attributes from it. */ @@ -6927,7 +6927,7 @@ color = face->lface[idx]; if (STRINGP (color) - && XSTRING (color)->size + && SCHARS (color) && CONSP (Vtty_defined_color_alist) && (def = assq_no_quit (color, call1 (Qtty_color_alist, frame)), CONSP (def))) @@ -7277,7 +7277,7 @@ Limit is the maximum position up to which to check for property changes in Fnext_single_property_change. Strings are usually short, so set the limit to the end of the string. */ - XSETFASTINT (limit, XSTRING (string)->size); + XSETFASTINT (limit, SCHARS (string)); end = Fnext_single_property_change (position, prop_name, string, limit); if (INTEGERP (end)) *endptr = XFASTINT (end); @@ -7345,13 +7345,13 @@ #endif fprintf (stderr, "foreground: 0x%lx (%s)\n", face->foreground, - XSTRING (face->lface[LFACE_FOREGROUND_INDEX])->data); + SDATA (face->lface[LFACE_FOREGROUND_INDEX])); fprintf (stderr, "background: 0x%lx (%s)\n", face->background, - XSTRING (face->lface[LFACE_BACKGROUND_INDEX])->data); + SDATA (face->lface[LFACE_BACKGROUND_INDEX])); fprintf (stderr, "font_name: %s (%s)\n", face->font_name, - XSTRING (face->lface[LFACE_FAMILY_INDEX])->data); + SDATA (face->lface[LFACE_FAMILY_INDEX])); #ifdef HAVE_X_WINDOWS fprintf (stderr, "font = %p\n", face->font); #endif @@ -7359,7 +7359,7 @@ fprintf (stderr, "fontset: %d\n", face->fontset); fprintf (stderr, "underline: %d (%s)\n", face->underline_p, - XSTRING (Fsymbol_name (face->lface[LFACE_UNDERLINE_INDEX]))->data); + SDATA (Fsymbol_name (face->lface[LFACE_UNDERLINE_INDEX]))); fprintf (stderr, "hash: %d\n", face->hash); fprintf (stderr, "charset: %d\n", face->charset); }
--- a/src/xfns.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/xfns.c Mon Jul 15 00:00:41 2002 +0000 @@ -636,7 +636,7 @@ { if (dpyinfo->bitmaps[id].refcount && dpyinfo->bitmaps[id].file - && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data)) + && !strcmp (dpyinfo->bitmaps[id].file, (char *) SDATA (file))) { ++dpyinfo->bitmaps[id].refcount; return id + 1; @@ -649,7 +649,7 @@ return -1; emacs_close (fd); - filename = (char *) XSTRING (found)->data; + filename = (char *) SDATA (found); result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), filename, &width, &height, &bitmap, &xhot, &yhot); @@ -660,11 +660,11 @@ dpyinfo->bitmaps[id - 1].pixmap = bitmap; dpyinfo->bitmaps[id - 1].refcount = 1; dpyinfo->bitmaps[id - 1].file - = (char *) xmalloc (STRING_BYTES (XSTRING (file)) + 1); + = (char *) xmalloc (SBYTES (file) + 1); dpyinfo->bitmaps[id - 1].depth = 1; dpyinfo->bitmaps[id - 1].height = height; dpyinfo->bitmaps[id - 1].width = width; - strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data); + strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file)); return id; } @@ -1385,9 +1385,9 @@ #if 0 /* Don't do this. It's wrong when we're not using the default colormap, it makes freeing difficult, and it's probably not an important optimization. */ - if (strcmp (XSTRING (color_name)->data, "black") == 0) + if (strcmp (SDATA (color_name), "black") == 0) return BLACK_PIX_DEFAULT (f); - else if (strcmp (XSTRING (color_name)->data, "white") == 0) + else if (strcmp (SDATA (color_name), "white") == 0) return WHITE_PIX_DEFAULT (f); #endif @@ -1397,7 +1397,7 @@ /* x_defined_color is responsible for coping with failures by looking for a near-miss. */ - if (x_defined_color (f, XSTRING (color_name)->data, &cdef, 1)) + if (x_defined_color (f, SDATA (color_name), &cdef, 1)) return cdef.pixel; Fsignal (Qerror, Fcons (build_string ("Undefined color"), @@ -1914,9 +1914,9 @@ BLOCK_INPUT; if (NILP (arg)) result = x_text_icon (f, - (char *) XSTRING ((!NILP (f->icon_name) + (char *) SDATA ((!NILP (f->icon_name) ? f->icon_name - : f->name))->data); + : f->name))); else result = x_bitmap_icon (f, arg); @@ -1968,11 +1968,11 @@ BLOCK_INPUT; result = x_text_icon (f, - (char *) XSTRING ((!NILP (f->icon_name) - ? f->icon_name - : !NILP (f->title) - ? f->title - : f->name))->data); + (char *) SDATA ((!NILP (f->icon_name) + ? f->icon_name + : !NILP (f->title) + ? f->title + : f->name))); if (result) { @@ -2000,12 +2000,12 @@ BLOCK_INPUT; result = (STRINGP (fontset_name) - ? x_new_fontset (f, XSTRING (fontset_name)->data) - : x_new_font (f, XSTRING (arg)->data)); + ? x_new_fontset (f, SDATA (fontset_name)) + : x_new_font (f, SDATA (arg))); UNBLOCK_INPUT; if (EQ (result, Qnil)) - error ("Font `%s' is not defined", XSTRING (arg)->data); + error ("Font `%s' is not defined", SDATA (arg)); else if (EQ (result, Qt)) error ("The characters of the given font have varying widths"); else if (STRINGP (result)) @@ -2375,9 +2375,9 @@ int *text_bytes, *stringp; int selectionp; { - unsigned char *str = XSTRING (string)->data; - int chars = XSTRING (string)->size; - int bytes = STRING_BYTES (XSTRING (string)); + unsigned char *str = SDATA (string); + int chars = SCHARS (string); + int bytes = SBYTES (string); int charset_info; int bufsize; unsigned char *buf; @@ -2399,9 +2399,9 @@ && !NILP (Ffboundp (coding.pre_write_conversion))) { string = run_pre_post_conversion_on_str (string, &coding, 1); - str = XSTRING (string)->data; - chars = XSTRING (string)->size; - bytes = STRING_BYTES (XSTRING (string)); + str = SDATA (string); + chars = SCHARS (string); + bytes = SBYTES (string); } coding.src_multibyte = 1; coding.dst_multibyte = 0; @@ -2458,7 +2458,7 @@ /* Check for no change needed in this very common case before we do any consing. */ if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name, - XSTRING (f->name)->data)) + SDATA (f->name))) return; name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name); } @@ -2517,16 +2517,16 @@ XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon); #endif /* not USE_X_TOOLKIT */ if (!NILP (f->icon_name) - && icon.value != XSTRING (f->icon_name)->data) + && icon.value != SDATA (f->icon_name)) xfree (icon.value); - if (text.value != XSTRING (name)->data) + if (text.value != SDATA (name)) xfree (text.value); } #else /* not HAVE_X11R4 */ XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - XSTRING (name)->data); + SDATA (name)); XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - XSTRING (name)->data); + SDATA (name)); #endif /* not HAVE_X11R4 */ UNBLOCK_INPUT; } @@ -2624,16 +2624,16 @@ XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon); #endif /* not USE_X_TOOLKIT */ if (!NILP (f->icon_name) - && icon.value != XSTRING (f->icon_name)->data) + && icon.value != SDATA (f->icon_name)) xfree (icon.value); - if (text.value != XSTRING (name)->data) + if (text.value != SDATA (name)) xfree (text.value); } #else /* not HAVE_X11R4 */ XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - XSTRING (name)->data); + SDATA (name)); XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - XSTRING (name)->data); + SDATA (name)); #endif /* not HAVE_X11R4 */ UNBLOCK_INPUT; } @@ -2758,10 +2758,10 @@ if (STRINGP (Vx_resource_name)) { - unsigned char *p = XSTRING (Vx_resource_name)->data; + unsigned char *p = SDATA (Vx_resource_name); int i; - len = STRING_BYTES (XSTRING (Vx_resource_name)); + len = SBYTES (Vx_resource_name); /* Only letters, digits, - and _ are valid in resource names. Count the valid characters and count the invalid ones. */ @@ -2800,12 +2800,12 @@ for (i = 0; i < len; i++) { - int c = XSTRING (new)->data[i]; + int c = SREF (new, i); if (! ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '_')) - XSTRING (new)->data[i] = '_'; + SREF (new, i) = '_'; } } @@ -2845,37 +2845,37 @@ /* Allocate space for the components, the dots which separate them, and the final '\0'. Make them big enough for the worst case. */ - name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) + name_key = (char *) alloca (SBYTES (Vx_resource_name) + (STRINGP (component) - ? STRING_BYTES (XSTRING (component)) : 0) - + STRING_BYTES (XSTRING (attribute)) + ? SBYTES (component) : 0) + + SBYTES (attribute) + 3); - class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class)) - + STRING_BYTES (XSTRING (class)) + class_key = (char *) alloca (SBYTES (Vx_resource_class) + + SBYTES (class) + (STRINGP (subclass) - ? STRING_BYTES (XSTRING (subclass)) : 0) + ? SBYTES (subclass) : 0) + 3); /* Start with emacs.FRAMENAME for the name (the specific one) and with `Emacs' for the class key (the general one). */ - strcpy (name_key, XSTRING (Vx_resource_name)->data); - strcpy (class_key, XSTRING (Vx_resource_class)->data); + strcpy (name_key, SDATA (Vx_resource_name)); + strcpy (class_key, SDATA (Vx_resource_class)); strcat (class_key, "."); - strcat (class_key, XSTRING (class)->data); + strcat (class_key, SDATA (class)); if (!NILP (component)) { strcat (class_key, "."); - strcat (class_key, XSTRING (subclass)->data); + strcat (class_key, SDATA (subclass)); strcat (name_key, "."); - strcat (name_key, XSTRING (component)->data); + strcat (name_key, SDATA (component)); } strcat (name_key, "."); - strcat (name_key, XSTRING (attribute)->data); + strcat (name_key, SDATA (attribute)); value = x_get_string_resource (check_x_display_info (Qnil)->xrdb, name_key, class_key); @@ -2911,37 +2911,37 @@ /* Allocate space for the components, the dots which separate them, and the final '\0'. Make them big enough for the worst case. */ - name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) + name_key = (char *) alloca (SBYTES (Vx_resource_name) + (STRINGP (component) - ? STRING_BYTES (XSTRING (component)) : 0) - + STRING_BYTES (XSTRING (attribute)) + ? SBYTES (component) : 0) + + SBYTES (attribute) + 3); - class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class)) - + STRING_BYTES (XSTRING (class)) + class_key = (char *) alloca (SBYTES (Vx_resource_class) + + SBYTES (class) + (STRINGP (subclass) - ? STRING_BYTES (XSTRING (subclass)) : 0) + ? SBYTES (subclass) : 0) + 3); /* Start with emacs.FRAMENAME for the name (the specific one) and with `Emacs' for the class key (the general one). */ - strcpy (name_key, XSTRING (Vx_resource_name)->data); - strcpy (class_key, XSTRING (Vx_resource_class)->data); + strcpy (name_key, SDATA (Vx_resource_name)); + strcpy (class_key, SDATA (Vx_resource_class)); strcat (class_key, "."); - strcat (class_key, XSTRING (class)->data); + strcat (class_key, SDATA (class)); if (!NILP (component)) { strcat (class_key, "."); - strcat (class_key, XSTRING (subclass)->data); + strcat (class_key, SDATA (subclass)); strcat (name_key, "."); - strcat (name_key, XSTRING (component)->data); + strcat (name_key, SDATA (component)); } strcat (name_key, "."); - strcat (name_key, XSTRING (attribute)->data); + strcat (name_key, SDATA (attribute)); value = x_get_string_resource (dpyinfo->xrdb, name_key, class_key); @@ -2963,13 +2963,13 @@ /* Allocate space for the components, the dots which separate them, and the final '\0'. */ - name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name)) + name_key = (char *) alloca (SBYTES (Vinvocation_name) + strlen (attribute) + 2); class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) + strlen (class) + 2); sprintf (name_key, "%s.%s", - XSTRING (Vinvocation_name)->data, + SDATA (Vinvocation_name), attribute); sprintf (class_key, "%s.%s", EMACS_CLASS, class); @@ -3027,15 +3027,15 @@ switch (type) { case RES_TYPE_NUMBER: - return make_number (atoi (XSTRING (tem)->data)); + return make_number (atoi (SDATA (tem))); case RES_TYPE_FLOAT: - return make_float (atof (XSTRING (tem)->data)); + return make_float (atof (SDATA (tem))); case RES_TYPE_BOOLEAN: tem = Fdowncase (tem); - if (!strcmp (XSTRING (tem)->data, "on") - || !strcmp (XSTRING (tem)->data, "true")) + if (!strcmp (SDATA (tem), "on") + || !strcmp (SDATA (tem), "true")) return Qt; else return Qnil; @@ -3049,11 +3049,11 @@ { Lisp_Object lower; lower = Fdowncase (tem); - if (!strcmp (XSTRING (lower)->data, "on") - || !strcmp (XSTRING (lower)->data, "true")) + if (!strcmp (SDATA (lower), "on") + || !strcmp (SDATA (lower), "true")) return Qt; - else if (!strcmp (XSTRING (lower)->data, "off") - || !strcmp (XSTRING (lower)->data, "false")) + else if (!strcmp (SDATA (lower), "off") + || !strcmp (SDATA (lower), "false")) return Qnil; else return Fintern (tem, Qnil); @@ -3186,7 +3186,7 @@ CHECK_STRING (string); - geometry = XParseGeometry ((char *) XSTRING (string)->data, + geometry = XParseGeometry ((char *) SDATA (string), &x, &y, &width, &height); #if 0 @@ -3559,7 +3559,7 @@ { /* Determine the base fontname from the ASCII font name of FONTSET. */ - char *ascii_font = (char *) XSTRING (fontset_ascii (fontset))->data; + char *ascii_font = (char *) SDATA (fontset_ascii (fontset)); char *p = ascii_font; int i; @@ -3780,7 +3780,7 @@ Elsewhere we specify the window name for the window manager. */ { - char *str = (char *) XSTRING (Vx_resource_name)->data; + char *str = (char *) SDATA (Vx_resource_name); f->namebuf = (char *) xmalloc (strlen (str) + 1); strcpy (f->namebuf, str); } @@ -3913,8 +3913,8 @@ validate_x_resource_name (); - class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data; - class_hints.res_class = (char *) XSTRING (Vx_resource_class)->data; + class_hints.res_name = (char *) SDATA (Vx_resource_name); + class_hints.res_class = (char *) SDATA (Vx_resource_class); XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints); #ifdef HAVE_X_I18N @@ -4041,8 +4041,8 @@ validate_x_resource_name (); - class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data; - class_hints.res_class = (char *) XSTRING (Vx_resource_class)->data; + class_hints.res_name = (char *) SDATA (Vx_resource_name); + class_hints.res_class = (char *) SDATA (Vx_resource_class); XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints); /* The menubar is part of the ordinary display; @@ -4129,9 +4129,9 @@ ? IconicState : NormalState)); - x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name) + x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name) ? f->icon_name - : f->name))->data); + : f->name))); UNBLOCK_INPUT; } @@ -4464,9 +4464,9 @@ { tem = Fquery_fontset (font, Qnil); if (STRINGP (tem)) - font = x_new_fontset (f, XSTRING (tem)->data); + font = x_new_fontset (f, SDATA (tem)); else - font = x_new_font (f, XSTRING (font)->data); + font = x_new_font (f, SDATA (font)); } /* Try out a font which we hope has bold and italic variations. */ @@ -4780,7 +4780,7 @@ CHECK_STRING (color); - if (x_defined_color (f, XSTRING (color)->data, &foo, 0)) + if (x_defined_color (f, SDATA (color), &foo, 0)) return Qt; else return Qnil; @@ -4796,7 +4796,7 @@ CHECK_STRING (color); - if (x_defined_color (f, XSTRING (color)->data, &foo, 0)) + if (x_defined_color (f, SDATA (color), &foo, 0)) { Lisp_Object rgb[3]; @@ -5207,12 +5207,12 @@ /* VALUE should be of the form CLASS-DEPTH, where CLASS is one of `PseudoColor', `TrueColor' etc. and DEPTH is the color depth, a decimal number. NAME is compared with case ignored. */ - char *s = (char *) alloca (STRING_BYTES (XSTRING (value)) + 1); + char *s = (char *) alloca (SBYTES (value) + 1); char *dash; int i, class = -1; XVisualInfo vinfo; - strcpy (s, XSTRING (value)->data); + strcpy (s, SDATA (value)); dash = index (s, '-'); if (dash) { @@ -5236,7 +5236,7 @@ if (class == -1 || !XMatchVisualInfo (dpy, XScreenNumberOfScreen (screen), dpyinfo->n_planes, class, &vinfo)) - fatal ("Invalid visual specification `%s'", XSTRING (value)->data); + fatal ("Invalid visual specification `%s'", SDATA (value)); dpyinfo->visual = vinfo.visual; } @@ -5295,10 +5295,10 @@ validate_x_resource_name (); dpyinfo = x_term_init (name, (char *)0, - (char *) XSTRING (Vx_resource_name)->data); + (char *) SDATA (Vx_resource_name)); if (dpyinfo == 0) - error ("Cannot connect to X server %s", XSTRING (name)->data); + error ("Cannot connect to X server %s", SDATA (name)); x_in_use = 1; XSETFASTINT (Vwindow_system_version, 11); @@ -5328,7 +5328,7 @@ error ("Not using X Windows"); if (! NILP (xrm_string)) - xrm_option = (unsigned char *) XSTRING (xrm_string)->data; + xrm_option = (unsigned char *) SDATA (xrm_string); else xrm_option = (unsigned char *) 0; @@ -5337,7 +5337,7 @@ /* This is what opens the connection and sets x_current_display. This also initializes many symbols, such as those used for input. */ dpyinfo = x_term_init (display, xrm_option, - (char *) XSTRING (Vx_resource_name)->data); + (char *) SDATA (Vx_resource_name)); if (dpyinfo == 0) { @@ -5346,9 +5346,9 @@ Check the DISPLAY environment variable or use `-d'.\n\ Also use the `xhost' program to verify that it is set to permit\n\ connections from your machine.\n", - XSTRING (display)->data); + SDATA (display)); else - error ("Cannot connect to X server %s", XSTRING (display)->data); + error ("Cannot connect to X server %s", SDATA (display)); } x_in_use = 1; @@ -5662,7 +5662,7 @@ /* Find key in KEYWORDS. Error if not found. */ for (i = 0; i < nkeywords; ++i) - if (strcmp (keywords[i].name, XSTRING (SYMBOL_NAME (key))->data) == 0) + if (strcmp (keywords[i].name, SDATA (SYMBOL_NAME (key))) == 0) break; if (i == nkeywords) @@ -6142,7 +6142,7 @@ xassert (STRINGP (color_name)); - if (x_defined_color (f, XSTRING (color_name)->data, &color, 1)) + if (x_defined_color (f, SDATA (color_name), &color, 1)) { /* This isn't called frequently so we get away with simply reallocating the color vector to the needed size, here. */ @@ -6880,7 +6880,7 @@ if (STRINGP (elt)) { - if (XSTRING (elt)->size + if (SCHARS (elt) < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) return 0; } @@ -6895,7 +6895,7 @@ } else if (STRINGP (data)) { - if (XSTRING (data)->size + if (SCHARS (data) < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) return 0; } @@ -7225,9 +7225,9 @@ { int w, h; return (STRINGP (data) - && xbm_read_bitmap_data (XSTRING (data)->data, - (XSTRING (data)->data - + STRING_BYTES (XSTRING (data))), + && xbm_read_bitmap_data (SDATA (data), + (SDATA (data) + + SBYTES (data)), &w, &h, NULL)); } @@ -7263,7 +7263,7 @@ return 0; } - contents = slurp_file (XSTRING (file)->data, &size); + contents = slurp_file (SDATA (file), &size); if (contents == NULL) { image_error ("Error loading XBM image `%s'", img->spec, Qnil); @@ -7313,9 +7313,9 @@ background); if (in_memory_file_p) - success_p = xbm_load_image (f, img, XSTRING (data)->data, - (XSTRING (data)->data - + STRING_BYTES (XSTRING (data)))); + success_p = xbm_load_image (f, img, SDATA (data), + (SDATA (data) + + SBYTES (data))); else { if (VECTORP (data)) @@ -7329,13 +7329,13 @@ { Lisp_Object line = XVECTOR (data)->contents[i]; if (STRINGP (line)) - bcopy (XSTRING (line)->data, p, nbytes); + bcopy (SDATA (line), p, nbytes); else bcopy (XBOOL_VECTOR (line)->data, p, nbytes); } } else if (STRINGP (data)) - bits = XSTRING (data)->data; + bits = SDATA (data); else bits = XBOOL_VECTOR (data)->data; @@ -7737,10 +7737,10 @@ { Lisp_Object name = XCAR (XCAR (tail)); Lisp_Object color = XCDR (XCAR (tail)); - xpm_syms[i].name = (char *) alloca (XSTRING (name)->size + 1); - strcpy (xpm_syms[i].name, XSTRING (name)->data); - xpm_syms[i].value = (char *) alloca (XSTRING (color)->size + 1); - strcpy (xpm_syms[i].value, XSTRING (color)->data); + xpm_syms[i].name = (char *) alloca (SCHARS (name) + 1); + strcpy (xpm_syms[i].name, SDATA (name)); + xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1); + strcpy (xpm_syms[i].value, SDATA (color)); } } @@ -7761,14 +7761,14 @@ } rc = XpmReadFileToPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - XSTRING (file)->data, &img->pixmap, &img->mask, + SDATA (file), &img->pixmap, &img->mask, &attrs); } else { Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); rc = XpmCreatePixmapFromBuffer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - XSTRING (buffer)->data, + SDATA (buffer), &img->pixmap, &img->mask, &attrs); } @@ -8568,7 +8568,7 @@ return 0; } - contents = slurp_file (XSTRING (file)->data, &size); + contents = slurp_file (SDATA (file), &size); if (contents == NULL) { image_error ("Error reading `%s'", file, Qnil); @@ -8583,8 +8583,8 @@ { Lisp_Object data; data = image_spec_value (img->spec, QCdata, NULL); - p = XSTRING (data)->data; - end = p + STRING_BYTES (XSTRING (data)); + p = SDATA (data); + end = p + SBYTES (data); } /* Check magic number. */ @@ -8933,7 +8933,7 @@ } /* Open the image file. */ - fp = fopen (XSTRING (file)->data, "rb"); + fp = fopen (SDATA (file), "rb"); if (!fp) { image_error ("Cannot open image file `%s'", file, Qnil); @@ -8955,8 +8955,8 @@ else { /* Read from memory. */ - tbr.bytes = XSTRING (specified_data)->data; - tbr.len = STRING_BYTES (XSTRING (specified_data)); + tbr.bytes = SDATA (specified_data); + tbr.len = SBYTES (specified_data); tbr.index = 0; /* Check PNG signature. */ @@ -9079,7 +9079,7 @@ /* The user specified `:background', use that. */ { XColor color; - if (x_defined_color (f, XSTRING (specified_bg)->data, &color, 0)) + if (x_defined_color (f, SDATA (specified_bg), &color, 0)) { png_color_16 user_bg; @@ -9499,7 +9499,7 @@ return 0; } - fp = fopen (XSTRING (file)->data, "r"); + fp = fopen (SDATA (file), "r"); if (fp == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -9546,8 +9546,8 @@ if (NILP (specified_data)) jpeg_stdio_src (&cinfo, (FILE *) fp); else - jpeg_memory_src (&cinfo, XSTRING (specified_data)->data, - STRING_BYTES (XSTRING (specified_data))); + jpeg_memory_src (&cinfo, SDATA (specified_data), + SBYTES (specified_data)); jpeg_read_header (&cinfo, TRUE); @@ -9893,7 +9893,7 @@ } /* Try to open the image file. */ - tiff = TIFFOpen (XSTRING (file)->data, "r"); + tiff = TIFFOpen (SDATA (file), "r"); if (tiff == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -9904,8 +9904,8 @@ else { /* Memory source! */ - memsrc.bytes = XSTRING (specified_data)->data; - memsrc.len = STRING_BYTES (XSTRING (specified_data)); + memsrc.bytes = SDATA (specified_data); + memsrc.len = SBYTES (specified_data); memsrc.index = 0; tiff = TIFFClientOpen ("memory_source", "r", &memsrc, @@ -10142,7 +10142,7 @@ } /* Open the GIF file. */ - gif = DGifOpenFileName (XSTRING (file)->data); + gif = DGifOpenFileName (SDATA (file)); if (gif == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -10154,8 +10154,8 @@ { /* Read from memory! */ current_gif_memory_src = &memsrc; - memsrc.bytes = XSTRING (specified_data)->data; - memsrc.len = STRING_BYTES (XSTRING (specified_data)); + memsrc.bytes = SDATA (specified_data); + memsrc.len = SBYTES (specified_data); memsrc.index = 0; gif = DGifOpen(&memsrc, gif_read_from_memory); @@ -10605,10 +10605,10 @@ CHECK_STRING (value); BLOCK_INPUT; - prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False); + prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False); XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom, XA_STRING, 8, PropModeReplace, - XSTRING (value)->data, XSTRING (value)->size); + SDATA (value), SCHARS (value)); /* Make sure the property is set when we return. */ XFlush (FRAME_X_DISPLAY (f)); @@ -10630,7 +10630,7 @@ CHECK_STRING (prop); BLOCK_INPUT; - prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False); + prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False); XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom); /* Make sure the property is removed when we return. */ @@ -10661,7 +10661,7 @@ CHECK_STRING (prop); BLOCK_INPUT; - prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False); + prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False); rc = XGetWindowProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom, 0, 0, False, XA_STRING, &actual_type, &actual_format, &actual_size, @@ -11054,9 +11054,9 @@ { tem = Fquery_fontset (font, Qnil); if (STRINGP (tem)) - font = x_new_fontset (f, XSTRING (tem)->data); + font = x_new_fontset (f, SDATA (tem)); else - font = x_new_font (f, XSTRING (font)->data); + font = x_new_font (f, SDATA (font)); } /* Try out a font which we hope has bold and italic variations. */ @@ -11620,10 +11620,10 @@ /* Create the dialog with PROMPT as title, using DIR as initial directory and using "*" as pattern. */ dir = Fexpand_file_name (dir, Qnil); - dir_xmstring = XmStringCreateLocalized (XSTRING (dir)->data); + dir_xmstring = XmStringCreateLocalized (SDATA (dir)); pattern_xmstring = XmStringCreateLocalized ("*"); - XtSetArg (al[ac], XmNtitle, XSTRING (prompt)->data); ++ac; + XtSetArg (al[ac], XmNtitle, SDATA (prompt)); ++ac; XtSetArg (al[ac], XmNdirectory, dir_xmstring); ++ac; XtSetArg (al[ac], XmNpattern, pattern_xmstring); ++ac; XtSetArg (al[ac], XmNresizePolicy, XmRESIZE_GROW); ++ac; @@ -11674,7 +11674,7 @@ int item_pos; default_xmstring - = XmStringCreateLocalized (XSTRING (default_filename)->data); + = XmStringCreateLocalized (SDATA (default_filename)); if (!XmListItemExists (list, default_xmstring)) {
--- a/src/xmenu.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/xmenu.c Mon Jul 15 00:00:41 2002 +0000 @@ -505,7 +505,7 @@ enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; - if (!NILP (map) && XSTRING (item_string)->data[0] == '@') + if (!NILP (map) && SREF (item_string, 0) == '@') { if (!NILP (enabled)) /* An enabled separate pane. Remember this to handle it later. */ @@ -551,8 +551,8 @@ index++; /* Skip a left, right divider. */ else { - if (!submenu && XSTRING (tem)->data[0] != '\0' - && XSTRING (tem)->data[0] != '-') + if (!submenu && SREF (tem, 0) != '\0' + && SREF (tem, 0) != '-') XVECTOR (menu_items)->contents[index + MENU_ITEMS_ITEM_NAME] = concat2 (build_string (" "), tem); index += MENU_ITEMS_ITEM_LENGTH; @@ -568,8 +568,8 @@ prefix = build_string (NILP (selected) ? "( ) " : "(*) "); } /* Not a button. If we have earlier buttons, then we need a prefix. */ - else if (!*notbuttons_ptr && XSTRING (item_string)->data[0] != '\0' - && XSTRING (item_string)->data[0] != '-') + else if (!*notbuttons_ptr && SREF (item_string, 0) != '\0' + && SREF (item_string, 0) != '-') prefix = build_string (" "); if (!NILP (prefix)) @@ -1453,7 +1453,7 @@ } #endif pane_string = (NILP (pane_name) - ? "" : (char *) XSTRING (pane_name)->data); + ? "" : (char *) SDATA (pane_name)); /* If there is just one top-level pane, put all its items directly under the top-level menu. */ if (menu_items_n_panes == 1) @@ -1517,9 +1517,9 @@ else save_wv->contents = wv; - wv->name = (char *) XSTRING (item_name)->data; + wv->name = (char *) SDATA (item_name); if (!NILP (descrip)) - wv->key = (char *) XSTRING (descrip)->data; + wv->key = (char *) SDATA (descrip); wv->value = 0; /* The EMACS_INT cast avoids a warning. There's no problem as long as pointers have enough bits to hold small integers. */ @@ -1753,7 +1753,7 @@ string = XVECTOR (items)->contents[i + 1]; if (NILP (string)) break; - wv->name = (char *) XSTRING (string)->data; + wv->name = (char *) SDATA (string); wv = wv->next; } @@ -1776,7 +1776,7 @@ break; wv = xmalloc_widget_value (); - wv->name = (char *) XSTRING (string)->data; + wv->name = (char *) SDATA (string); wv->value = 0; wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; @@ -2051,7 +2051,7 @@ } #endif pane_string = (NILP (pane_name) - ? "" : (char *) XSTRING (pane_name)->data); + ? "" : (char *) SDATA (pane_name)); /* If there is just one top-level pane, put all its items directly under the top-level menu. */ if (menu_items_n_panes == 1) @@ -2116,9 +2116,9 @@ prev_wv->next = wv; else save_wv->contents = wv; - wv->name = (char *) XSTRING (item_name)->data; + wv->name = (char *) SDATA (item_name); if (!NILP (descrip)) - wv->key = (char *) XSTRING (descrip)->data; + wv->key = (char *) SDATA (descrip); wv->value = 0; /* If this item has a null value, make the call_data null so that it won't display a box @@ -2169,7 +2169,7 @@ title = ENCODE_SYSTEM (title); #endif - wv_title->name = (char *) XSTRING (title)->data; + wv_title->name = (char *) SDATA (title); wv_title->enabled = TRUE; wv_title->button_type = BUTTON_TYPE_NONE; wv_title->next = wv_sep1; @@ -2370,7 +2370,7 @@ pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; pane_string = (NILP (pane_name) - ? "" : (char *) XSTRING (pane_name)->data); + ? "" : (char *) SDATA (pane_name)); prev_wv = xmalloc_widget_value (); prev_wv->value = pane_string; if (keymaps && !NILP (prefix)) @@ -2417,8 +2417,8 @@ prev_wv->next = wv; wv->name = (char *) button_names[nb_buttons]; if (!NILP (descrip)) - wv->key = (char *) XSTRING (descrip)->data; - wv->value = (char *) XSTRING (item_name)->data; + wv->key = (char *) SDATA (descrip); + wv->value = (char *) SDATA (item_name); wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; wv->enabled = !NILP (enable); wv->help = Qnil; @@ -2656,7 +2656,7 @@ pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; pane_string = (NILP (pane_name) - ? "" : (char *) XSTRING (pane_name)->data); + ? "" : (char *) SDATA (pane_name)); if (keymaps && !NILP (prefix)) pane_string++; @@ -2683,7 +2683,7 @@ j++; continue; } - width = STRING_BYTES (XSTRING (item)); + width = SBYTES (item); if (width > maxwidth) maxwidth = width; @@ -2706,34 +2706,34 @@ descrip = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY]; help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP]; - help_string = STRINGP (help) ? XSTRING (help)->data : NULL; + help_string = STRINGP (help) ? SDATA (help) : NULL; if (!NILP (descrip)) { - int gap = maxwidth - STRING_BYTES (XSTRING (item_name)); + int gap = maxwidth - SBYTES (item_name); #ifdef C_ALLOCA Lisp_Object spacer; spacer = Fmake_string (make_number (gap), make_number (' ')); item_name = concat2 (item_name, spacer); item_name = concat2 (item_name, descrip); - item_data = XSTRING (item_name)->data; + item_data = SDATA (item_name); #else /* if alloca is fast, use that to make the space, to reduce gc needs. */ item_data = (unsigned char *) alloca (maxwidth - + STRING_BYTES (XSTRING (descrip)) + 1); - bcopy (XSTRING (item_name)->data, item_data, - STRING_BYTES (XSTRING (item_name))); - for (j = XSTRING (item_name)->size; j < maxwidth; j++) + + SBYTES (descrip) + 1); + bcopy (SDATA (item_name), item_data, + SBYTES (item_name)); + for (j = SCHARS (item_name); j < maxwidth; j++) item_data[j] = ' '; - bcopy (XSTRING (descrip)->data, item_data + j, - STRING_BYTES (XSTRING (descrip))); - item_data[j + STRING_BYTES (XSTRING (descrip))] = 0; + bcopy (SDATA (descrip), item_data + j, + SBYTES (descrip)); + item_data[j + SBYTES (descrip)] = 0; #endif } else - item_data = XSTRING (item_name)->data; + item_data = SDATA (item_name); if (XMenuAddSelection (FRAME_X_DISPLAY (f), menu, lpane, 0, item_data,
--- a/src/xselect.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/xselect.c Mon Jul 15 00:00:41 2002 +0000 @@ -200,9 +200,9 @@ #endif if (!SYMBOLP (sym)) abort (); - TRACE1 (" XInternAtom %s", (char *) XSTRING (SYMBOL_NAME (sym))->data); + TRACE1 (" XInternAtom %s", (char *) SDATA (SYMBOL_NAME (sym))); BLOCK_INPUT; - val = XInternAtom (display, (char *) XSTRING (SYMBOL_NAME (sym))->data, False); + val = XInternAtom (display, (char *) SDATA (SYMBOL_NAME (sym)), False); UNBLOCK_INPUT; return val; } @@ -1272,7 +1272,7 @@ if (NILP (XCAR (reading_selection_reply))) error ("Timed out waiting for reply from selection owner"); if (EQ (XCAR (reading_selection_reply), Qlambda)) - error ("No `%s' selection", XSTRING (SYMBOL_NAME (selection_symbol))->data); + error ("No `%s' selection", SDATA (SYMBOL_NAME (selection_symbol))); /* Otherwise, the selection is waiting for us on the requested property. */ return @@ -1662,7 +1662,7 @@ str = run_pre_post_conversion_on_str (str, &coding, 0); Vlast_coding_system_used = coding.symbol; } - compose_chars_in_text (0, XSTRING (str)->size, str); + compose_chars_in_text (0, SCHARS (str), str); return str; } /* Convert a single atom to a Lisp_Symbol. Convert a set of atoms to @@ -1778,7 +1778,7 @@ Lisp_Object unibyte_string; unibyte_string = string_make_unibyte (obj); - *data_ret = XSTRING (unibyte_string)->data; + *data_ret = SDATA (unibyte_string); *nofree_ret = 1; *size_ret = SBYTES (unibyte_string); } @@ -1786,7 +1786,7 @@ { *data_ret = x_encode_text (obj, Vnext_selection_coding_system, 1, (int *) size_ret, &stringp); - *nofree_ret = (*data_ret == XSTRING (obj)->data); + *nofree_ret = (*data_ret == SDATA (obj)); } if (NILP (type)) type = (stringp ? QSTRING : QCOMPOUND_TEXT); @@ -2277,8 +2277,8 @@ CHECK_STRING (string); buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf), display, buffer); - data = (unsigned char *) XSTRING (string)->data; - bytes = STRING_BYTES (XSTRING (string)); + data = (unsigned char *) SDATA (string); + bytes = SBYTES (string); bytes_remaining = bytes; if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized)
--- a/src/xsmfns.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/xsmfns.c Mon Jul 15 00:00:41 2002 +0000 @@ -216,8 +216,8 @@ props[props_idx]->type = SmARRAY8; props[props_idx]->num_vals = 1; props[props_idx]->vals = &values[val_idx++]; - props[props_idx]->vals[0].length = strlen (XSTRING (Vinvocation_name)->data); - props[props_idx]->vals[0].value = XSTRING (Vinvocation_name)->data; + props[props_idx]->vals[0].length = strlen (SDATA (Vinvocation_name)); + props[props_idx]->vals[0].value = SDATA (Vinvocation_name); ++props_idx; /* How to restart Emacs (i.e.: /path/to/emacs --smid=xxxx). */ @@ -244,8 +244,8 @@ props[props_idx]->type = SmARRAY8; props[props_idx]->num_vals = 1; props[props_idx]->vals = &values[val_idx++]; - props[props_idx]->vals[0].length = strlen (XSTRING (Vuser_login_name)->data); - props[props_idx]->vals[0].value = XSTRING (Vuser_login_name)->data; + props[props_idx]->vals[0].length = strlen (SDATA (Vuser_login_name)); + props[props_idx]->vals[0].value = SDATA (Vuser_login_name); ++props_idx; /* The current directory property, not mandatory */ @@ -407,12 +407,12 @@ /* Check if we where started by the session manager. If so, we will have a previous id. */ if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) - previous_id = XSTRING (Vx_session_previous_id)->data; + previous_id = SDATA (Vx_session_previous_id); /* Construct the path to the Emacs program. */ if (! EQ (Vinvocation_directory, Qnil)) - name_len += strlen (XSTRING (Vinvocation_directory)->data); - name_len += strlen (XSTRING (Vinvocation_name)->data); + name_len += strlen (SDATA (Vinvocation_directory)); + name_len += strlen (SDATA (Vinvocation_name)); /* This malloc will not be freed, but it is only done once, and hopefully not very large */ @@ -420,8 +420,8 @@ emacs_program[0] = '\0'; if (! EQ (Vinvocation_directory, Qnil)) - strcpy (emacs_program, XSTRING (Vinvocation_directory)->data); - strcat (emacs_program, XSTRING (Vinvocation_name)->data); + strcpy (emacs_program, SDATA (Vinvocation_directory)); + strcat (emacs_program, SDATA (Vinvocation_name)); /* The SM protocol says all callbacks are mandatory, so set up all here and in the mask passed to SmcOpenConnection */
--- a/src/xterm.c Sun Jul 14 23:54:05 2002 +0000 +++ b/src/xterm.c Mon Jul 15 00:00:41 2002 +0000 @@ -7269,7 +7269,7 @@ if (NILP (b)) b = make_number (0); if (NILP (e)) - e = make_number (XSTRING (object)->size - 1); + e = make_number (SCHARS (object) - 1); fast_find_string_pos (w, XINT (b), object, &dpyinfo->mouse_face_beg_col, &dpyinfo->mouse_face_beg_row, @@ -7367,7 +7367,7 @@ /* Try text properties. */ if (STRINGP (object) && charpos >= 0 - && charpos < XSTRING (object)->size) + && charpos < SCHARS (object)) { help = Fget_text_property (make_number (charpos), Qhelp_echo, object); @@ -12099,7 +12099,7 @@ XErrorEvent *error; { XGetErrorText (display, error->error_code, - XSTRING (x_error_message_string)->data, + SDATA (x_error_message_string), X_ERROR_MESSAGE_SIZE); } @@ -12131,7 +12131,7 @@ record_unwind_protect (x_catch_errors_unwind, x_error_message_string); x_error_message_string = make_uninit_string (X_ERROR_MESSAGE_SIZE); - XSTRING (x_error_message_string)->data[0] = 0; + SREF (x_error_message_string, 0) = 0; return count; } @@ -12158,8 +12158,8 @@ /* Make sure to catch any errors incurred so far. */ XSync (dpy, False); - if (XSTRING (x_error_message_string)->data[0]) - error (format, XSTRING (x_error_message_string)->data); + if (SREF (x_error_message_string, 0)) + error (format, SDATA (x_error_message_string)); } /* Nonzero if we had any X protocol errors @@ -12172,7 +12172,7 @@ /* Make sure to catch any errors incurred so far. */ XSync (dpy, False); - return XSTRING (x_error_message_string)->data[0] != 0; + return SREF (x_error_message_string, 0) != 0; } /* Forget about any errors we have had, since we did x_catch_errors on DPY. */ @@ -12181,7 +12181,7 @@ x_clear_errors (dpy) Display *dpy; { - XSTRING (x_error_message_string)->data[0] = 0; + SREF (x_error_message_string, 0) = 0; } /* Stop catching X protocol errors and let them make Emacs die. @@ -12481,7 +12481,7 @@ to do. */ return fontset_name (fontset); - result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data)); + result = x_new_font (f, (SDATA (fontset_ascii (fontset)))); if (!STRINGP (result)) /* Can't load ASCII font. */ @@ -12493,7 +12493,7 @@ #ifdef HAVE_X_I18N if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea))) - xic_set_xfontset (f, XSTRING (fontset_ascii (fontset))->data); + xic_set_xfontset (f, SDATA (fontset_ascii (fontset))); #endif return build_string (fontsetname); @@ -14093,7 +14093,7 @@ XFontStruct *font; unsigned long value; - font = XLoadQueryFont (dpy, XSTRING (pattern)->data); + font = XLoadQueryFont (dpy, SDATA (pattern)); if (x_had_errors_p (dpy)) { /* This error is perhaps due to insufficient memory on X @@ -14136,7 +14136,7 @@ { /* We try at least 10 fonts because XListFonts will return auto-scaled fonts at the head. */ - names = XListFonts (dpy, XSTRING (pattern)->data, max (maxnames, 10), + names = XListFonts (dpy, SDATA (pattern), max (maxnames, 10), &num_fonts); if (x_had_errors_p (dpy)) { @@ -14237,7 +14237,7 @@ BLOCK_INPUT; count = x_catch_errors (dpy); thisinfo = XLoadQueryFont (dpy, - XSTRING (XCAR (tem))->data); + SDATA (XCAR (tem))); if (x_had_errors_p (dpy)) { /* This error is perhaps due to insufficient memory on X @@ -14417,9 +14417,9 @@ for (tail = font_names; CONSP (tail); tail = XCDR (tail)) if (dpyinfo->font_table[i].name && (!strcmp (dpyinfo->font_table[i].name, - XSTRING (XCAR (tail))->data) + SDATA (XCAR (tail))) || !strcmp (dpyinfo->font_table[i].full_name, - XSTRING (XCAR (tail))->data))) + SDATA (XCAR (tail))))) return (dpyinfo->font_table + i); } @@ -14437,7 +14437,7 @@ a bug of not finding a font even if the font surely exists and is loadable by XLoadQueryFont. */ if (size > 0 && !NILP (font_names)) - fontname = (char *) XSTRING (XCAR (font_names))->data; + fontname = (char *) SDATA (XCAR (font_names)); BLOCK_INPUT; count = x_catch_errors (FRAME_X_DISPLAY (f)); @@ -14689,7 +14689,7 @@ char *name1, *name2; { int seen_colon = 0; - unsigned char *system_name = XSTRING (Vsystem_name)->data; + unsigned char *system_name = SDATA (Vsystem_name); int system_name_length = strlen (system_name); int length_until_period = 0; @@ -14771,7 +14771,7 @@ argv[argc++] = xrm_option; } stop_polling (); - dpy = XtOpenDisplay (Xt_app_con, XSTRING (display_name)->data, + dpy = XtOpenDisplay (Xt_app_con, SDATA (display_name), resource_name, EMACS_CLASS, emacs_options, XtNumber (emacs_options), &argc, argv); @@ -14787,7 +14787,7 @@ #ifdef HAVE_X11R5 XSetLocaleModifiers (""); #endif - dpy = XOpenDisplay (XSTRING (display_name)->data); + dpy = XOpenDisplay (SDATA (display_name)); #endif /* not USE_X_TOOLKIT */ /* Detect failure. */ @@ -14809,8 +14809,8 @@ for (share = x_display_list, tail = x_display_name_list; share; share = share->next, tail = XCDR (tail)) - if (same_x_server (XSTRING (XCAR (XCAR (tail)))->data, - XSTRING (display_name)->data)) + if (same_x_server (SDATA (XCAR (XCAR (tail))), + SDATA (display_name))) break; if (share) dpyinfo->kboard = share->kboard; @@ -14856,11 +14856,11 @@ #endif /* ! 0 */ dpyinfo->x_id_name - = (char *) xmalloc (STRING_BYTES (XSTRING (Vinvocation_name)) - + STRING_BYTES (XSTRING (Vsystem_name)) + = (char *) xmalloc (SBYTES (Vinvocation_name) + + SBYTES (Vsystem_name) + 2); sprintf (dpyinfo->x_id_name, "%s@%s", - XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data); + SDATA (Vinvocation_name), SDATA (Vsystem_name)); /* Figure out which modifier bits mean what. */ x_find_modifier_meanings (dpyinfo); @@ -14923,8 +14923,8 @@ build_string ("PrivateColormap"), Qnil, Qnil); if (STRINGP (value) - && (!strcmp (XSTRING (value)->data, "true") - || !strcmp (XSTRING (value)->data, "on"))) + && (!strcmp (SDATA (value), "true") + || !strcmp (SDATA (value), "on"))) dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap); } } @@ -15084,8 +15084,8 @@ build_string ("Synchronous"), Qnil, Qnil); if (STRINGP (value) - && (!strcmp (XSTRING (value)->data, "true") - || !strcmp (XSTRING (value)->data, "on"))) + && (!strcmp (SDATA (value), "true") + || !strcmp (SDATA (value), "on"))) XSynchronize (dpyinfo->display, True); }