# HG changeset patch # User Richard M. Stallman # Date 890463974 0 # Node ID 50929073a0ba8385eb525eec19af973b204ea7f6 # Parent e82a4a4fa12a6f9fbc6781e90a6610e4ead139ae Use STRING_BYTES and SET_STRING_BYTES. diff -r e82a4a4fa12a -r 50929073a0ba src/abbrev.c --- a/src/abbrev.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/abbrev.c Sat Mar 21 07:06:14 1998 +0000 @@ -324,7 +324,7 @@ del_range_both (wordstart, wordstart_byte, wordend, wordend_byte, 1); insert_from_string (expansion, 0, 0, XSTRING (expansion)->size, - XSTRING (expansion)->size_byte, 1); + STRING_BYTES (XSTRING (expansion)), 1); SET_PT (PT + whitecnt); if (uccount && !lccount) @@ -390,11 +390,11 @@ if (!STRINGP (val)) error ("value of abbrev-symbol must be a string"); zv_before = ZV; - del_range_byte (PT_BYTE, PT_BYTE + XSTRING (val)->size_byte, 1); + del_range_byte (PT_BYTE, PT_BYTE + STRING_BYTES (XSTRING (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, - XSTRING (Vlast_abbrev_text)->size_byte, 0); + STRING_BYTES (XSTRING (Vlast_abbrev_text)), 0); Vlast_abbrev_text = Qnil; /* Total number of characters deleted. */ adjust = ZV - zv_before; diff -r e82a4a4fa12a -r 50929073a0ba src/alloc.c --- a/src/alloc.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/alloc.c Sat Mar 21 07:06:14 1998 +0000 @@ -1376,7 +1376,7 @@ string_chars_consed += fullsize; XSTRING (val)->size = length; - XSTRING (val)->size_byte = length_byte; + SET_STRING_BYTES (XSTRING (val), length_byte); XSTRING (val)->data[length_byte] = 0; INITIALIZE_INTERVAL (XSTRING (val), NULL_INTERVAL); @@ -1442,7 +1442,7 @@ error ("Pure Lisp storage exhausted"); XSETSTRING (new, PUREBEG + pureptr); XSTRING (new)->size = length; - XSTRING (new)->size_byte = length_byte; + SET_STRING_BYTES (XSTRING (new), length_byte); bcopy (data, XSTRING (new)->data, length_byte); XSTRING (new)->data[length_byte] = 0; @@ -1548,7 +1548,7 @@ #endif /* LISP_FLOAT_TYPE */ else if (STRINGP (obj)) return make_pure_string (XSTRING (obj)->data, XSTRING (obj)->size, - XSTRING (obj)->size_byte); + STRING_BYTES (XSTRING (obj))); else if (COMPILEDP (obj) || VECTORP (obj)) { register struct Lisp_Vector *vec; @@ -2646,7 +2646,7 @@ register struct Lisp_String *newaddr; register EMACS_INT size = nextstr->size; - EMACS_INT size_byte = nextstr->size_byte; + EMACS_INT size_byte = STRING_BYTES (nextstr); /* NEXTSTR is the old address of the next string. Just skip it if it isn't marked. */ diff -r e82a4a4fa12a -r 50929073a0ba src/buffer.c --- a/src/buffer.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/buffer.c Sat Mar 21 07:06:14 1998 +0000 @@ -2364,9 +2364,9 @@ nbytes = XSTRING (str)->size; else if (! STRING_MULTIBYTE (str)) nbytes = count_size_as_multibyte (XSTRING (str)->data, - XSTRING (str)->size_byte); + STRING_BYTES (XSTRING (str))); else - nbytes = XSTRING (str)->size_byte; + nbytes = STRING_BYTES (XSTRING (str)); ssl->bytes += nbytes; @@ -2376,9 +2376,9 @@ nbytes = XSTRING (str2)->size; else if (! STRING_MULTIBYTE (str2)) nbytes = count_size_as_multibyte (XSTRING (str2)->data, - XSTRING (str2)->size_byte); + STRING_BYTES (XSTRING (str2))); else - nbytes = XSTRING (str2)->size_byte; + nbytes = STRING_BYTES (XSTRING (str2)); ssl->bytes += nbytes; } @@ -2490,7 +2490,8 @@ { int nbytes; tem = overlay_tails.buf[i].string; - nbytes = copy_text (XSTRING (tem)->data, p, XSTRING (tem)->size_byte, + nbytes = copy_text (XSTRING (tem)->data, p, + STRING_BYTES (XSTRING (tem)), STRING_MULTIBYTE (tem), multibyte); p += nbytes; } @@ -2498,14 +2499,15 @@ { int nbytes; tem = overlay_heads.buf[i].string; - nbytes = copy_text (XSTRING (tem)->data, p, XSTRING (tem)->size_byte, + nbytes = copy_text (XSTRING (tem)->data, p, + STRING_BYTES (XSTRING (tem)), STRING_MULTIBYTE (tem), multibyte); p += nbytes; tem = overlay_heads.buf[i].string2; if (STRINGP (tem)) { nbytes = copy_text (XSTRING (tem)->data, p, - XSTRING (tem)->size_byte, + STRING_BYTES (XSTRING (tem)), STRING_MULTIBYTE (tem), multibyte); p += nbytes; } diff -r e82a4a4fa12a -r 50929073a0ba src/bytecode.c --- a/src/bytecode.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/bytecode.c Sat Mar 21 07:06:14 1998 +0000 @@ -306,7 +306,7 @@ /* Cached address of beginning of string, valid if BYTESTR equals STRING_SAVED. */ register unsigned char *strbeg; - int bytestr_length = XSTRING (bytestr)->size_byte; + int bytestr_length = STRING_BYTES (XSTRING (bytestr)); CHECK_STRING (bytestr, 0); if (!VECTORP (vector)) diff -r e82a4a4fa12a -r 50929073a0ba src/callint.c --- a/src/callint.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/callint.c Sat Mar 21 07:06:14 1998 +0000 @@ -288,8 +288,9 @@ { /* Make a copy of string so that if a GC relocates specs, `string' will still be valid. */ - string = (unsigned char *) alloca (XSTRING (specs)->size_byte + 1); - bcopy (XSTRING (specs)->data, string, XSTRING (specs)->size_byte + 1); + string = (unsigned char *) alloca (STRING_BYTES (XSTRING (specs)) + 1); + bcopy (XSTRING (specs)->data, string, + STRING_BYTES (XSTRING (specs)) + 1); } else if (string == 0) { diff -r e82a4a4fa12a -r 50929073a0ba src/callproc.c --- a/src/callproc.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/callproc.c Sat Mar 21 07:06:14 1998 +0000 @@ -445,7 +445,7 @@ for (i = 4; i < nargs; i++) { int size = encoding_buffer_size (&argument_coding, - XSTRING (args[i])->size_byte); + STRING_BYTES (XSTRING (args[i]))); unsigned char *dummy1 = (unsigned char *) alloca (size); int dummy; @@ -454,7 +454,7 @@ encode_coding (&argument_coding, XSTRING (args[i])->data, new_argv[i - 3], - XSTRING (args[i])->size_byte, + STRING_BYTES (XSTRING (args[i])), size); new_argv[i - 3][argument_coding.produced] = 0; } @@ -837,9 +837,9 @@ strcat (tempfile, "detmp.XXX"); #endif #else /* not DOS_NT */ - char *tempfile = (char *) alloca (XSTRING (Vtemp_file_name_pattern)->size_byte + 1); + char *tempfile = (char *) alloca (STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile, - XSTRING (Vtemp_file_name_pattern)->size_byte + 1); + STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); #endif /* not DOS_NT */ mktemp (tempfile); @@ -977,7 +977,7 @@ register char *temp; register int i; - i = XSTRING (current_dir)->size_byte; + i = STRING_BYTES (XSTRING (current_dir)); pwd_var = (char *) alloca (i + 6); temp = pwd_var + 4; bcopy ("PWD=", pwd_var, 4); @@ -1172,7 +1172,7 @@ entry = XCONS (scan)->car; if (STRINGP (entry) - && XSTRING (entry)->size_byte > varlen + && STRING_BYTES (XSTRING (entry)) > varlen && XSTRING (entry)->data[varlen] == '=' #ifdef WINDOWSNT /* NT environment variables are case insensitive. */ @@ -1183,7 +1183,7 @@ ) { *value = (char *) XSTRING (entry)->data + (varlen + 1); - *valuelen = XSTRING (entry)->size_byte - (varlen + 1); + *valuelen = STRING_BYTES (XSTRING (entry)) - (varlen + 1); return 1; } } @@ -1202,7 +1202,7 @@ int valuelen; CHECK_STRING (var, 0); - if (getenv_internal (XSTRING (var)->data, XSTRING (var)->size_byte, + if (getenv_internal (XSTRING (var)->data, STRING_BYTES (XSTRING (var)), &value, &valuelen)) return make_string (value, valuelen); else diff -r e82a4a4fa12a -r 50929073a0ba src/casefiddle.c --- a/src/casefiddle.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/casefiddle.c Sat Mar 21 07:06:14 1998 +0000 @@ -63,7 +63,7 @@ int multibyte = STRING_MULTIBYTE (obj); obj = Fcopy_sequence (obj); - len = XSTRING (obj)->size_byte; + len = STRING_BYTES (XSTRING (obj)); /* Scan all single-byte characters from start of string. */ for (i = 0; i < len;) diff -r e82a4a4fa12a -r 50929073a0ba src/category.c --- a/src/category.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/category.c Sat Mar 21 07:06:14 1998 +0000 @@ -492,7 +492,7 @@ mnemonics = Fcategory_set_mnemonics (value); insert_from_string (mnemonics, 0, 0, XSTRING (mnemonics)->size, - XSTRING (mnemonics)->size_byte, 0); + STRING_BYTES (XSTRING (mnemonics)), 0); insert_string ("\n"); return; } @@ -526,7 +526,7 @@ insert_char (i + 32); insert (": ", 2); insert_from_string (elt, 0, 0, XSTRING (elt)->size, - XSTRING (elt)->size_byte, 0); + STRING_BYTES (XSTRING (elt)), 0); insert ("\n", 1); } } diff -r e82a4a4fa12a -r 50929073a0ba src/ccl.c --- a/src/ccl.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/ccl.c Sat Mar 21 07:06:14 1998 +0000 @@ -1568,13 +1568,13 @@ if (ccl.ic < i && i < ccl.size) ccl.ic = i; } - outbufsize = XSTRING (str)->size_byte * ccl.buf_magnification + 256; + outbufsize = STRING_BYTES (XSTRING (str)) * ccl.buf_magnification + 256; outbuf = (char *) xmalloc (outbufsize); if (!outbuf) error ("Not enough memory"); ccl.last_block = NILP (contin); produced = ccl_driver (&ccl, XSTRING (str)->data, outbuf, - XSTRING (str)->size_byte, outbufsize, (int *)0); + STRING_BYTES (XSTRING (str)), outbufsize, (int *)0); for (i = 0; i < 8; i++) XSET (XVECTOR (status)->contents[i], Lisp_Int, ccl.reg[i]); XSETINT (XVECTOR (status)->contents[8], ccl.ic); diff -r e82a4a4fa12a -r 50929073a0ba src/charset.c --- a/src/charset.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/charset.c Sat Mar 21 07:06:14 1998 +0000 @@ -747,7 +747,7 @@ return Qnil; bzero (charsets, (MAX_CHARSET + 1) * sizeof (int)); - find_charset_in_str (XSTRING (str)->data, XSTRING (str)->size_byte, + find_charset_in_str (XSTRING (str)->data, STRING_BYTES (XSTRING (str)), charsets, table); val = Qnil; for (i = MAX_CHARSET; i >= 0; i--) @@ -1029,7 +1029,8 @@ Lisp_Object val; CHECK_STRING (str, 0); - XSETFASTINT (val, strwidth (XSTRING (str)->data, XSTRING (str)->size_byte)); + XSETFASTINT (val, strwidth (XSTRING (str)->data, + STRING_BYTES (XSTRING (str)))); return val; } @@ -1519,7 +1520,7 @@ buf[0] = LEADING_CODE_COMPOSITION; p = XSTRING (str)->data; - pend = p + XSTRING (str)->size_byte; + pend = p + STRING_BYTES (XSTRING (str)); i = 1; while (p < pend) { diff -r e82a4a4fa12a -r 50929073a0ba src/coding.c --- a/src/coding.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/coding.c Sat Mar 21 07:06:14 1998 +0000 @@ -4283,7 +4283,8 @@ { int len; char *buf; - int from = 0, to = XSTRING (str)->size, to_byte = XSTRING (str)->size_byte; + int from = 0, to = XSTRING (str)->size; + int to_byte = STRING_BYTES (XSTRING (str)); struct gcpro gcpro1; Lisp_Object saved_coding_symbol = Qnil; int result; @@ -4359,7 +4360,7 @@ len = encoding_buffer_size (coding, to_byte - from); else len = decoding_buffer_size (coding, to_byte - from); - len += from + XSTRING (str)->size_byte - to_byte; + len += from + STRING_BYTES (XSTRING (str)) - to_byte; GCPRO1 (str); buf = get_conversion_buffer (len); UNGCPRO; @@ -4381,9 +4382,9 @@ } bcopy (XSTRING (str)->data + to_byte, buf + from + coding->produced, - XSTRING (str)->size_byte - to_byte); - - len = from + XSTRING (str)->size_byte - to_byte; + STRING_BYTES (XSTRING (str)) - to_byte); + + len = from + STRING_BYTES (XSTRING (str)) - to_byte; if (encodep) str = make_unibyte_string (buf, len + coding->produced); else @@ -4565,7 +4566,7 @@ CHECK_STRING (string, 0); return detect_coding_system (XSTRING (string)->data, - XSTRING (string)->size_byte, + STRING_BYTES (XSTRING (string)), !NILP (highest)); } diff -r e82a4a4fa12a -r 50929073a0ba src/data.c --- a/src/data.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/data.c Sat Mar 21 07:06:14 1998 +0000 @@ -1648,7 +1648,7 @@ idxval_byte = string_char_to_byte (array, idxval); c = STRING_CHAR (&XSTRING (array)->data[idxval_byte], - XSTRING (array)->size_byte - idxval_byte); + STRING_BYTES (XSTRING (array)) - idxval_byte); return make_number (c); } else if (BOOL_VECTOR_P (array)) @@ -1847,7 +1847,7 @@ p = &XSTRING (array)->data[idxval_byte]; actual_len - = MULTIBYTE_FORM_LENGTH (p, XSTRING (array)->size_byte - idxval_byte); + = MULTIBYTE_FORM_LENGTH (p, STRING_BYTES (XSTRING (array)) - idxval_byte); new_len = Fchar_bytes (newelt); if (actual_len != XINT (new_len)) error ("Attempt to change byte length of a string"); diff -r e82a4a4fa12a -r 50929073a0ba src/dispnew.c --- a/src/dispnew.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/dispnew.c Sat Mar 21 07:06:14 1998 +0000 @@ -2251,11 +2251,12 @@ { /* ??? Perhaps we should do something special for multibyte strings here. */ CHECK_STRING (string, 0); - fwrite (XSTRING (string)->data, 1, XSTRING (string)->size_byte, stdout); + fwrite (XSTRING (string)->data, 1, STRING_BYTES (XSTRING (string)), stdout); fflush (stdout); if (termscript) { - fwrite (XSTRING (string)->data, 1, XSTRING (string)->size_byte, termscript); + fwrite (XSTRING (string)->data, 1, STRING_BYTES (XSTRING (string)), + termscript); fflush (termscript); } return Qnil; diff -r e82a4a4fa12a -r 50929073a0ba src/doc.c --- a/src/doc.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/doc.c Sat Mar 21 07:06:14 1998 +0000 @@ -562,11 +562,11 @@ if (NILP (keymap)) keymap = Voverriding_local_map; - bsize = XSTRING (string)->size_byte; + bsize = STRING_BYTES (XSTRING (string)); bufp = buf = (unsigned char *) xmalloc (bsize); strp = (unsigned char *) XSTRING (string)->data; - while (strp < XSTRING (string)->data + XSTRING (string)->size_byte) + while (strp < XSTRING (string)->data + STRING_BYTES (XSTRING (string))) { if (strp[0] == '\\' && strp[1] == '=') { @@ -577,7 +577,7 @@ if (multibyte) { int len; - int maxlen = XSTRING (string)->data + XSTRING (string)->size_byte - strp; + int maxlen = XSTRING (string)->data + STRING_BYTES (XSTRING (string)) - strp; STRING_CHAR_AND_LENGTH (strp, maxlen, len); if (len == 1) @@ -600,7 +600,7 @@ start = strp; while ((strp - (unsigned char *) XSTRING (string)->data - < XSTRING (string)->size_byte) + < STRING_BYTES (XSTRING (string))) && *strp != ']') strp++; length_byte = strp - start; @@ -685,7 +685,7 @@ insert_string ("\nUses keymap \""); insert_from_string (name, 0, 0, XSTRING (name)->size, - XSTRING (name)->size_byte, 1); + STRING_BYTES (XSTRING (name)), 1); insert_string ("\", which is not currently defined.\n"); if (start[-1] == '<') keymap = Qnil; } @@ -700,7 +700,7 @@ subst_string: start = XSTRING (tem)->data; length = XSTRING (tem)->size; - length_byte = XSTRING (tem)->size_byte; + length_byte = STRING_BYTES (XSTRING (tem)); subst: new = (unsigned char *) xrealloc (buf, bsize += length_byte); bufp += new - buf; @@ -716,7 +716,7 @@ else { int len; - int maxlen = XSTRING (string)->data + XSTRING (string)->size_byte - strp; + int maxlen = XSTRING (string)->data + STRING_BYTES (XSTRING (string)) - strp; STRING_CHAR_AND_LENGTH (strp, maxlen, len); if (len == 1) diff -r e82a4a4fa12a -r 50929073a0ba src/fileio.c --- a/src/fileio.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/fileio.c Sat Mar 21 07:06:14 1998 +0000 @@ -375,7 +375,7 @@ #ifdef DOS_NT beg = strcpy (alloca (strlen (beg) + 1), beg); #endif - p = beg + XSTRING (filename)->size_byte; + p = beg + STRING_BYTES (XSTRING (filename)); while (p != beg && !IS_DIRECTORY_SEP (p[-1]) #ifdef VMS @@ -432,7 +432,7 @@ return call2 (handler, Qfile_name_nondirectory, filename); beg = XSTRING (filename)->data; - end = p = beg + XSTRING (filename)->size_byte; + end = p = beg + STRING_BYTES (XSTRING (filename)); while (p != beg && !IS_DIRECTORY_SEP (p[-1]) #ifdef VMS @@ -585,7 +585,7 @@ if (!NILP (handler)) return call2 (handler, Qfile_name_as_directory, file); - buf = (char *) alloca (XSTRING (file)->size_byte + 10); + buf = (char *) alloca (STRING_BYTES (XSTRING (file)) + 10); return build_string (file_name_as_directory (buf, XSTRING (file)->data)); } @@ -780,9 +780,9 @@ /* 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 (XSTRING (directory)->size_byte + 20 + 255); + buf = (char *) alloca (STRING_BYTES (XSTRING (directory)) + 20 + 255); #else - buf = (char *) alloca (XSTRING (directory)->size_byte + 20); + buf = (char *) alloca (STRING_BYTES (XSTRING (directory)) + 20); #endif directory_file_name (XSTRING (directory)->data, buf); return build_string (buf); @@ -1805,7 +1805,7 @@ CORRECT_DIR_SEPS (nm); substituted = (strcmp (nm, XSTRING (filename)->data) != 0); #endif - endp = nm + XSTRING (filename)->size_byte; + endp = nm + STRING_BYTES (XSTRING (filename)); /* If /~ or // appears, discard everything through first slash. */ @@ -1898,7 +1898,7 @@ /* If substitution required, recopy the string and do it */ /* Make space in stack frame for the new copy */ - xnm = (unsigned char *) alloca (XSTRING (filename)->size_byte + total + 1); + xnm = (unsigned char *) alloca (STRING_BYTES (XSTRING (filename)) + total + 1); x = xnm; /* Copy the rest of the name through, replacing $ constructs with values */ @@ -2017,7 +2017,7 @@ absname = Fexpand_file_name (filename, defdir); #ifdef VMS { - register int c = XSTRING (absname)->data[XSTRING (absname)->size_byte - 1]; + register int c = XSTRING (absname)->data[STRING_BYTES (XSTRING (absname)) - 1]; if (c == ':' || c == ']' || c == '>') absname = Fdirectory_file_name (absname); } @@ -2025,8 +2025,8 @@ /* 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[XSTRING (absname)->size_byte - 1]) - && !IS_DEVICE_SEP (XSTRING (absname)->data[XSTRING (absname)->size_byte-2])) + && IS_DIRECTORY_SEP (XSTRING (absname)->data[STRING_BYTES (XSTRING (absname)) - 1]) + && !IS_DEVICE_SEP (XSTRING (absname)->data[STRING_BYTES (XSTRING (absname))-2])) /* We cannot take shortcuts; they might be wrong for magic file names. */ absname = Fdirectory_file_name (absname); #endif @@ -4240,7 +4240,7 @@ if (STRINGP (start)) { failure = 0 > a_write (desc, XSTRING (start)->data, - XSTRING (start)->size_byte, 0, &annotations, + STRING_BYTES (XSTRING (start)), 0, &annotations, &coding); save_errno = errno; } @@ -4510,7 +4510,7 @@ tem = Fcdr (Fcar (*annot)); if (STRINGP (tem)) { - if (0 > e_write (desc, XSTRING (tem)->data, XSTRING (tem)->size_byte, + if (0 > e_write (desc, XSTRING (tem)->data, STRING_BYTES (XSTRING (tem)), coding)) return -1; } @@ -4793,11 +4793,11 @@ if (!NILP (b->filename)) { fwrite (XSTRING (b->filename)->data, 1, - XSTRING (b->filename)->size_byte, stream); + STRING_BYTES (XSTRING (b->filename)), stream); } putc ('\n', stream); fwrite (XSTRING (b->auto_save_file_name)->data, 1, - XSTRING (b->auto_save_file_name)->size_byte, stream); + STRING_BYTES (XSTRING (b->auto_save_file_name)), stream); putc ('\n', stream); } @@ -4931,7 +4931,7 @@ register int n; int osize, count; - osize = XSTRING (val)->size_byte; + osize = STRING_BYTES (XSTRING (val)); /* Count the number of $ characters. */ for (n = osize, count = 0, old = XSTRING (val)->data; n > 0; n--) @@ -5072,7 +5072,7 @@ && IS_DIRECTORY_SEP (XSTRING (dir)->data[strlen (homedir)])) { dir = make_string (XSTRING (dir)->data + strlen (homedir) - 1, - XSTRING (dir)->size_byte - strlen (homedir) + 1); + STRING_BYTES (XSTRING (dir)) - strlen (homedir) + 1); XSTRING (dir)->data[0] = '~'; } diff -r e82a4a4fa12a -r 50929073a0ba src/filelock.c --- a/src/filelock.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/filelock.c Sat Mar 21 07:06:14 1998 +0000 @@ -129,7 +129,7 @@ /* Write the name of the lock file for FN into LFNAME. Length will be that of FN plus two more for the leading `.#' plus one for the null. */ #define MAKE_LOCK_NAME(lock, file) \ - (lock = (char *) alloca (XSTRING (file)->size_byte + 2 + 1), \ + (lock = (char *) alloca (STRING_BYTES (XSTRING (file)) + 2 + 1), \ fill_in_lock_file_name (lock, (file))) static void diff -r e82a4a4fa12a -r 50929073a0ba src/fns.c --- a/src/fns.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/fns.c Sat Mar 21 07:06:14 1998 +0000 @@ -186,7 +186,7 @@ Lisp_Object string; { CHECK_STRING (string, 1); - return make_number (XSTRING (string)->size_byte); + return make_number (STRING_BYTES (XSTRING (string))); } DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0, @@ -204,8 +204,8 @@ CHECK_STRING (s2, 1); if (XSTRING (s1)->size != XSTRING (s2)->size - || XSTRING (s1)->size_byte != XSTRING (s2)->size_byte - || bcmp (XSTRING (s1)->data, XSTRING (s2)->data, XSTRING (s1)->size_byte)) + || STRING_BYTES (XSTRING (s1)) != STRING_BYTES (XSTRING (s2)) + || bcmp (XSTRING (s1)->data, XSTRING (s2)->data, STRING_BYTES (XSTRING (s1)))) return Qnil; return Qt; } @@ -488,7 +488,7 @@ if (STRING_MULTIBYTE (this)) { some_multibyte = 1; - result_len_byte += XSTRING (this)->size_byte; + result_len_byte += STRING_BYTES (XSTRING (this)); } else result_len_byte += count_size_as_multibyte (XSTRING (this)->data, @@ -542,9 +542,9 @@ if (STRINGP (this) && STRINGP (val) && STRING_MULTIBYTE (this) == some_multibyte) { - int thislen_byte = XSTRING (this)->size_byte; + int thislen_byte = STRING_BYTES (XSTRING (this)); bcopy (XSTRING (this)->data, XSTRING (val)->data + toindex_byte, - XSTRING (this)->size_byte); + STRING_BYTES (XSTRING (this))); toindex_byte += thislen_byte; toindex += thisleni; } @@ -664,7 +664,7 @@ best_below = best_below_byte = 0; best_above = XSTRING (string)->size; - best_above_byte = XSTRING (string)->size_byte; + best_above_byte = STRING_BYTES (XSTRING (string)); if (EQ (string, string_char_byte_cache_string)) { @@ -730,7 +730,7 @@ best_below = best_below_byte = 0; best_above = XSTRING (string)->size; - best_above_byte = XSTRING (string)->size_byte; + best_above_byte = STRING_BYTES (XSTRING (string)); if (EQ (string, string_char_byte_cache_string)) { @@ -798,11 +798,11 @@ XSTRING (string)->size); /* 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 == XSTRING (string)->size_byte) + if (nbytes == STRING_BYTES (XSTRING (string))) return string; buf = (unsigned char *) alloca (nbytes); - copy_text (XSTRING (string)->data, buf, XSTRING (string)->size_byte, + copy_text (XSTRING (string)->data, buf, STRING_BYTES (XSTRING (string)), 0, 1); return make_multibyte_string (buf, XSTRING (string)->size, nbytes); @@ -821,7 +821,7 @@ buf = (unsigned char *) alloca (XSTRING (string)->size); - copy_text (XSTRING (string)->data, buf, XSTRING (string)->size_byte, + copy_text (XSTRING (string)->data, buf, STRING_BYTES (XSTRING (string)), 1, 0); return make_unibyte_string (buf, XSTRING (string)->size); @@ -855,7 +855,7 @@ if (STRING_MULTIBYTE (string)) { string = Fcopy_sequence (string); - XSTRING (string)->size = XSTRING (string)->size_byte; + XSTRING (string)->size = STRING_BYTES (XSTRING (string)); } return string; } @@ -870,9 +870,9 @@ if (! STRING_MULTIBYTE (string)) { int newlen = multibyte_chars_in_text (XSTRING (string)->data, - XSTRING (string)->size_byte); + STRING_BYTES (XSTRING (string))); /* If all the chars are ASCII, STRING is already suitable. */ - if (newlen != XSTRING (string)->size_byte) + if (newlen != STRING_BYTES (XSTRING (string))) { string = Fcopy_sequence (string); XSTRING (string)->size = newlen; @@ -932,7 +932,7 @@ if (STRINGP (string)) { size = XSTRING (string)->size; - size_byte = XSTRING (string)->size_byte; + size_byte = STRING_BYTES (XSTRING (string)); } else size = XVECTOR (string)->size; @@ -996,7 +996,7 @@ if (STRINGP (string)) { size = XSTRING (string)->size; - size_byte = XSTRING (string)->size_byte; + size_byte = STRING_BYTES (XSTRING (string)); } else size = XVECTOR (string)->size; @@ -1587,10 +1587,10 @@ case Lisp_String: if (XSTRING (o1)->size != XSTRING (o2)->size) return 0; - if (XSTRING (o1)->size_byte != XSTRING (o2)->size_byte) + if (STRING_BYTES (XSTRING (o1)) != STRING_BYTES (XSTRING (o2))) return 0; if (bcmp (XSTRING (o1)->data, XSTRING (o2)->data, - XSTRING (o1)->size_byte)) + STRING_BYTES (XSTRING (o1)))) return 0; return 1; } @@ -2075,7 +2075,7 @@ else if (STRINGP (seq)) { /* Multi-byte string. */ - int len_byte = XSTRING (seq)->size_byte; + int len_byte = STRING_BYTES (XSTRING (seq)); int i_byte; for (i = 0, i_byte = 0; i < leni;) diff -r e82a4a4fa12a -r 50929073a0ba src/frame.c --- a/src/frame.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/frame.c Sat Mar 21 07:06:14 1998 +0000 @@ -1794,7 +1794,7 @@ /* Check for no change needed in this very common case before we do any consing. */ if (frame_name_fnn_p (XSTRING (f->name)->data, - XSTRING (f->name)->size_byte)) + STRING_BYTES (XSTRING (f->name)))) return; terminal_frame_count++; @@ -1811,7 +1811,7 @@ /* Don't allow the user to set the frame name to F, so it doesn't clash with the names we generate for terminal frames. */ - if (frame_name_fnn_p (XSTRING (name)->data, XSTRING (name)->size_byte)) + if (frame_name_fnn_p (XSTRING (name)->data, STRING_BYTES (XSTRING (name)))) error ("Frame names of the form F are usurped by Emacs"); } diff -r e82a4a4fa12a -r 50929073a0ba src/insdel.c --- a/src/insdel.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/insdel.c Sat Mar 21 07:06:14 1998 +0000 @@ -1189,7 +1189,7 @@ intervals = XSTRING (string)->intervals; /* Get the intervals for the part of the string we are inserting-- not including the combined-before bytes. */ - if (nbytes < XSTRING (string)->size_byte) + if (nbytes < STRING_BYTES (XSTRING (string))) intervals = copy_intervals (intervals, pos, nchars); /* Insert those intervals. */ @@ -1497,7 +1497,7 @@ int from, to, prepare, inherit, nomarkers; { int inschars = XSTRING (new)->size; - int insbytes = XSTRING (new)->size_byte; + int insbytes = STRING_BYTES (XSTRING (new)); int from_byte, to_byte; int nbytes_del, nchars_del; register Lisp_Object temp; diff -r e82a4a4fa12a -r 50929073a0ba src/keyboard.c --- a/src/keyboard.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/keyboard.c Sat Mar 21 07:06:14 1998 +0000 @@ -617,11 +617,11 @@ else if (SYMBOLP (c)) { struct Lisp_String *name = XSYMBOL (c)->name; - if ((ptr - current_kboard->echobuf) + name->size_byte + 4 + if ((ptr - current_kboard->echobuf) + STRING_BYTES (name) + 4 > ECHOBUFSIZE) return; - bcopy (name->data, ptr, name->size_byte); - ptr += name->size_byte; + bcopy (name->data, ptr, STRING_BYTES (name)); + ptr += STRING_BYTES (name); } if (current_kboard->echoptr == current_kboard->echobuf @@ -2378,7 +2378,7 @@ { putc ('<', dribble); fwrite (XSYMBOL (dribblee)->name->data, sizeof (char), - XSYMBOL (dribblee)->name->size_byte, + STRING_BYTES (XSYMBOL (dribblee)->name), dribble); putc ('>', dribble); } @@ -4340,7 +4340,7 @@ modifiers = 0; name = XSYMBOL (symbol)->name; - for (i = 0; i+2 <= name->size_byte; ) + for (i = 0; i+2 <= STRING_BYTES (name); ) { int this_mod_end = 0; int this_mod = 0; @@ -4387,7 +4387,8 @@ /* Check there is a dash after the modifier, so that it really is a modifier. */ - if (this_mod_end >= name->size_byte || name->data[this_mod_end] != '-') + if (this_mod_end >= STRING_BYTES (name) + || name->data[this_mod_end] != '-') break; /* This modifier is real; look for another. */ @@ -4398,7 +4399,7 @@ /* Should we include the `click' modifier? */ if (! (modifiers & (down_modifier | drag_modifier | double_modifier | triple_modifier)) - && i + 7 == name->size_byte + && i + 7 == STRING_BYTES (name) && strncmp (name->data + i, "mouse-", 6) == 0 && ('0' <= name->data[i + 6] && name->data[i + 6] <= '9')) modifiers |= click_modifier; @@ -4515,7 +4516,7 @@ Lisp_Object mask; unmodified = Fintern (make_string (XSYMBOL (symbol)->name->data + end, - XSYMBOL (symbol)->name->size_byte - end), + STRING_BYTES (XSYMBOL (symbol)->name) - end), Qnil); if (modifiers & ~(((EMACS_INT)1 << VALBITS) - 1)) @@ -4570,7 +4571,7 @@ new_symbol = apply_modifiers_uncached (modifiers, XSYMBOL (base)->name->data, XSYMBOL (base)->name->size, - XSYMBOL (base)->name->size_byte); + STRING_BYTES (XSYMBOL (base)->name)); /* Add the new symbol to the base's cache. */ entry = Fcons (index, new_symbol); @@ -4818,11 +4819,11 @@ switch (name->data[0]) { #define SINGLE_LETTER_MOD(BIT) \ - if (name->size_byte == 1) \ + if (STRING_BYTES (name) == 1) \ return BIT; #define MULTI_LETTER_MOD(BIT, NAME, LEN) \ - if (LEN == name->size_byte \ + if (LEN == STRING_BYTES (name) \ && ! strncmp (name->data, NAME, LEN)) \ return BIT; @@ -5989,7 +5990,7 @@ /* Prompt string always starts with map's prompt, and a space. */ strcpy (menu, XSTRING (name)->data); - nlength = XSTRING (name)->size_byte; + nlength = STRING_BYTES (XSTRING (name)); menu[nlength++] = ':'; menu[nlength++] = ' '; menu[nlength] = 0; @@ -7608,7 +7609,7 @@ newmessage = (char *) alloca (XSYMBOL (function)->name->size - + XSTRING (binding)->size_byte + + STRING_BYTES (XSTRING (binding)) + 100); sprintf (newmessage, "You can run the command `%s' with %s", XSYMBOL (function)->name->data, @@ -7928,7 +7929,7 @@ register int count; p = XSTRING (stuffstring)->data; - count = XSTRING (stuffstring)->size_byte; + count = STRING_BYTES (XSTRING (stuffstring)); while (count-- > 0) stuff_char (*p++); stuff_char ('\n'); diff -r e82a4a4fa12a -r 50929073a0ba src/keymap.c --- a/src/keymap.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/keymap.c Sat Mar 21 07:06:14 1998 +0000 @@ -3026,7 +3026,7 @@ tem2 = CHARSET_TABLE_INFO (i - 128, CHARSET_SHORT_NAME_IDX); if (STRINGP (tem2)) insert_from_string (tem2, 0, 0, XSTRING (tem2)->size, - XSTRING (tem2)->size_byte, 0); + STRING_BYTES (XSTRING (tem2)), 0); else insert ("?", 1); insert (">", 1); diff -r e82a4a4fa12a -r 50929073a0ba src/lread.c --- a/src/lread.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/lread.c Sat Mar 21 07:06:14 1998 +0000 @@ -1157,12 +1157,12 @@ CHECK_STRING (string,0); if (NILP (end)) - endval = XSTRING (string)->size_byte; + endval = STRING_BYTES (XSTRING (string)); else { CHECK_NUMBER (end, 2); endval = string_char_to_byte (string, XINT (end)); - if (endval < 0 || endval > XSTRING (string)->size_byte) + if (endval < 0 || endval > STRING_BYTES (XSTRING (string))) args_out_of_range (string, end); } @@ -2255,7 +2255,7 @@ tem = oblookup (obarray, XSTRING (string)->data, XSTRING (string)->size, - XSTRING (string)->size_byte); + STRING_BYTES (XSTRING (string))); if (!INTEGERP (tem)) return tem; @@ -2292,7 +2292,7 @@ tem = oblookup (obarray, XSTRING (string)->data, XSTRING (string)->size, - XSTRING (string)->size_byte); + STRING_BYTES (XSTRING (string))); if (!INTEGERP (tem)) return tem; return Qnil; @@ -2323,7 +2323,7 @@ tem = oblookup (obarray, XSTRING (string)->data, XSTRING (string)->size, - XSTRING (string)->size_byte); + STRING_BYTES (XSTRING (string))); if (INTEGERP (tem)) return Qnil; /* If arg was a symbol, don't delete anything but that symbol itself. */ @@ -2398,7 +2398,7 @@ else for (tail = bucket; ; XSETSYMBOL (tail, XSYMBOL (tail)->next)) { - if (XSYMBOL (tail)->name->size_byte == size_byte + if (STRING_BYTES (XSYMBOL (tail)->name) == size_byte && XSYMBOL (tail)->name->size == size && !bcmp (XSYMBOL (tail)->name->data, ptr, size_byte)) return tail; diff -r e82a4a4fa12a -r 50929073a0ba src/minibuf.c --- a/src/minibuf.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/minibuf.c Sat Mar 21 07:06:14 1998 +0000 @@ -480,7 +480,7 @@ /* Ignore trailing whitespace; any other trailing junk is an error. */ int i; pos = string_char_to_byte (val, pos); - for (i = pos; i < XSTRING (val)->size_byte; i++) + for (i = pos; i < STRING_BYTES (XSTRING (val)); i++) { int c = XSTRING (val)->data[i]; if (c != ' ' && c != '\t' && c != '\n') @@ -954,9 +954,9 @@ /* Is this element a possible completion? */ if (STRINGP (eltstring) - && XSTRING (string)->size_byte <= XSTRING (eltstring)->size_byte + && STRING_BYTES (XSTRING (string)) <= STRING_BYTES (XSTRING (eltstring)) && 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data, - XSTRING (string)->size_byte)) + STRING_BYTES (XSTRING (string)))) { /* Yes. */ Lisp_Object regexps; @@ -996,11 +996,11 @@ if (NILP (bestmatch)) { bestmatch = eltstring; - bestmatchsize = XSTRING (eltstring)->size_byte; + bestmatchsize = STRING_BYTES (XSTRING (eltstring)); } else { - compare = min (bestmatchsize, XSTRING (eltstring)->size_byte); + compare = min (bestmatchsize, STRING_BYTES (XSTRING (eltstring))); matchsize = scmp (XSTRING (bestmatch)->data, XSTRING (eltstring)->data, compare); @@ -1012,8 +1012,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_byte - && matchsize < XSTRING (bestmatch)->size_byte) + if ((matchsize == STRING_BYTES (XSTRING (eltstring)) + && matchsize < STRING_BYTES (XSTRING (bestmatch))) || /* If there is more than one exact match ignoring case, and one of them is exact including case, @@ -1021,15 +1021,15 @@ /* If there is no exact match ignoring case, prefer a match that does not change the case of the input. */ - ((matchsize == XSTRING (eltstring)->size_byte) + ((matchsize == STRING_BYTES (XSTRING (eltstring))) == - (matchsize == XSTRING (bestmatch)->size_byte) + (matchsize == STRING_BYTES (XSTRING (bestmatch))) && !bcmp (XSTRING (eltstring)->data, XSTRING (string)->data, - XSTRING (string)->size_byte) + STRING_BYTES (XSTRING (string))) && bcmp (XSTRING (bestmatch)->data, XSTRING (string)->data, - XSTRING (string)->size_byte))) + STRING_BYTES (XSTRING (string))))) bestmatch = eltstring; } bestmatchsize = matchsize; @@ -1042,13 +1042,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_byte - && XSTRING (bestmatch)->size_byte > bestmatchsize) + if (completion_ignore_case && bestmatchsize == STRING_BYTES (XSTRING (string)) + && STRING_BYTES (XSTRING (bestmatch)) > bestmatchsize) return string; /* 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_byte + if (matchcount == 1 && bestmatchsize == STRING_BYTES (XSTRING (string)) && !bcmp (XSTRING (bestmatch)->data, XSTRING (string)->data, bestmatchsize)) return Qt; @@ -1182,15 +1182,15 @@ /* Is this element a possible completion? */ if (STRINGP (eltstring) - && XSTRING (string)->size_byte <= XSTRING (eltstring)->size_byte + && STRING_BYTES (XSTRING (string)) <= STRING_BYTES (XSTRING (eltstring)) /* If HIDE_SPACES, reject alternatives that start with space unless the input starts with space. */ - && ((XSTRING (string)->size_byte > 0 + && ((STRING_BYTES (XSTRING (string)) > 0 && XSTRING (string)->data[0] == ' ') || XSTRING (eltstring)->data[0] != ' ' || NILP (hide_spaces)) && 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data, - XSTRING (string)->size_byte)) + STRING_BYTES (XSTRING (string)))) { /* Yes. */ Lisp_Object regexps; @@ -1356,7 +1356,7 @@ tem = oblookup (Vminibuffer_completion_table, XSTRING (txt)->data, XSTRING (txt)->size, - XSTRING (txt)->size_byte); + STRING_BYTES (XSTRING (txt))); if (!SYMBOLP (tem)) return Qnil; else if (!NILP (Vminibuffer_completion_predicate)) @@ -1658,13 +1658,13 @@ tem = substituted; Ferase_buffer (); insert_from_string (tem, 0, 0, XSTRING (tem)->size, - XSTRING (tem)->size_byte, 0); + STRING_BYTES (XSTRING (tem)), 0); } } buffer_string = XSTRING (tem)->data; completion_string = XSTRING (completion)->data; - buffer_nbytes = XSTRING (tem)->size_byte; /* ie ZV_BYTE - BEGV_BYTE */ - completion_nbytes = XSTRING (completion)->size_byte; + buffer_nbytes = STRING_BYTES (XSTRING (tem)); /* ie ZV_BYTE - BEGV_BYTE */ + completion_nbytes = STRING_BYTES (XSTRING (completion)); i_byte = buffer_nbytes - completion_nbytes; if (i_byte > 0 || 0 <= scmp (buffer_string, completion_string, buffer_nbytes)) @@ -1716,7 +1716,7 @@ int len, c; completion_string = XSTRING (completion)->data; - for (; i_byte < XSTRING (completion)->size_byte; i_byte += len, i++) + for (; i_byte < STRING_BYTES (XSTRING (completion)); i_byte += len, i++) { c = STRING_CHAR_AND_LENGTH (completion_string + i_byte, XSTRING (completion)->size - i_byte, diff -r e82a4a4fa12a -r 50929073a0ba src/print.c --- a/src/print.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/print.c Sat Mar 21 07:06:14 1998 +0000 @@ -536,7 +536,7 @@ /* strout is safe for output to a frame (echo area) or to print_buffer. */ strout (XSTRING (string)->data, XSTRING (string)->size, - XSTRING (string)->size_byte, + STRING_BYTES (XSTRING (string)), printcharfun, STRING_MULTIBYTE (string)); else { @@ -544,7 +544,7 @@ So re-fetch the string address for each character. */ int i; int size = XSTRING (string)->size; - int size_byte = XSTRING (string)->size_byte; + int size_byte = STRING_BYTES (XSTRING (string)); struct gcpro gcpro1; GCPRO1 (string); if (size == size_byte) @@ -1162,7 +1162,7 @@ #endif PRINTCHAR ('\"'); - size_byte = XSTRING (obj)->size_byte; + size_byte = STRING_BYTES (XSTRING (obj)); for (i = 0, i_byte = 0; i_byte < size_byte;) { @@ -1234,7 +1234,7 @@ { register int confusing; register unsigned char *p = XSYMBOL (obj)->name->data; - register unsigned char *end = p + XSYMBOL (obj)->name->size_byte; + register unsigned char *end = p + STRING_BYTES (XSYMBOL (obj)->name); register int c; int i, i_byte, size_byte; Lisp_Object name; @@ -1296,7 +1296,7 @@ PRINTCHAR (':'); } - size_byte = XSTRING (name)->size_byte; + size_byte = STRING_BYTES (XSTRING (name)); for (i = 0, i_byte = 0; i_byte < size_byte;) { diff -r e82a4a4fa12a -r 50929073a0ba src/process.c --- a/src/process.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/process.c Sat Mar 21 07:06:14 1998 +0000 @@ -1089,12 +1089,12 @@ #ifdef VMS /* Make a one member argv with all args concatenated together separated by a blank. */ - len = XSTRING (program)->size_byte + 2; + len = STRING_BYTES (XSTRING (program)) + 2; for (i = 3; i < nargs; i++) { tem = args[i]; CHECK_STRING (tem, i); - len += XSTRING (tem)->size_byte + 1; /* count the blank */ + len += STRING_BYTES (XSTRING (tem)) + 1; /* count the blank */ } new_argv = (unsigned char *) alloca (len); strcpy (new_argv, XSTRING (program)->data); @@ -2756,7 +2756,7 @@ char *buf = (char *) xmalloc (nbytes + carryover); bcopy (XSTRING (p->decoding_buf)->data - + XSTRING (p->decoding_buf)->size_byte - carryover, + + STRING_BYTES (XSTRING (p->decoding_buf)) - carryover, buf, carryover); bcopy (chars, buf + carryover, nbytes); chars = buf; @@ -2767,7 +2767,7 @@ if (carryover) /* See the comment above. */ bcopy (XSTRING (p->decoding_buf)->data - + XSTRING (p->decoding_buf)->size_byte - carryover, + + STRING_BYTES (XSTRING (p->decoding_buf)) - carryover, buf, carryover); if (proc_buffered_char[channel] < 0) @@ -2799,10 +2799,10 @@ int require = decoding_buffer_size (coding, nbytes); int result; - if (XSTRING (p->decoding_buf)->size_byte < require) + if (STRING_BYTES (XSTRING (p->decoding_buf)) < require) p->decoding_buf = make_uninit_string (require); result = decode_coding (coding, chars, XSTRING (p->decoding_buf)->data, - nbytes, XSTRING (p->decoding_buf)->size_byte); + nbytes, STRING_BYTES (XSTRING (p->decoding_buf))); carryover = nbytes - coding->consumed; /* A new coding system might be found by `decode_coding'. */ @@ -3111,7 +3111,7 @@ offset = -1; } bcopy ((XSTRING (XPROCESS (proc)->encoding_buf)->data - + XSTRING (XPROCESS (proc)->encoding_buf)->size_byte + + STRING_BYTES (XSTRING (XPROCESS (proc)->encoding_buf)) - carryover), temp_buf, carryover); @@ -3119,7 +3119,7 @@ buf = temp_buf; } - if (XSTRING (XPROCESS (proc)->encoding_buf)->size_byte < require) + if (STRING_BYTES (XSTRING (XPROCESS (proc)->encoding_buf)) < require) { XPROCESS (proc)->encoding_buf = make_uninit_string (require); @@ -3133,7 +3133,7 @@ } object = XPROCESS (proc)->encoding_buf; encode_coding (coding, buf, XSTRING (object)->data, - len, XSTRING (object)->size_byte); + len, STRING_BYTES (XSTRING (object))); len = coding->produced; buf = XSTRING (object)->data; if (temp_buf) @@ -3318,7 +3318,7 @@ CHECK_STRING (string, 1); proc = get_process (process); send_process (proc, XSTRING (string)->data, - XSTRING (string)->size_byte, string); + STRING_BYTES (XSTRING (string)), string); return Qnil; } diff -r e82a4a4fa12a -r 50929073a0ba src/search.c --- a/src/search.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/search.c Sat Mar 21 07:06:14 1998 +0000 @@ -135,7 +135,7 @@ if (multibyte == STRING_MULTIBYTE (pattern)) { raw_pattern = (char *) XSTRING (pattern)->data; - raw_pattern_size = XSTRING (pattern)->size_byte; + raw_pattern_size = STRING_BYTES (XSTRING (pattern)); } else if (multibyte) { @@ -156,7 +156,7 @@ raw_pattern_size = XSTRING (pattern)->size; raw_pattern = (char *) alloca (raw_pattern_size + 1); copy_text (XSTRING (pattern)->data, raw_pattern, - XSTRING (pattern)->size_byte, 1, 0); + STRING_BYTES (XSTRING (pattern)), 1, 0); } cp->regexp = Qnil; @@ -368,8 +368,8 @@ re_match_object = string; val = re_search (bufp, (char *) XSTRING (string)->data, - XSTRING (string)->size_byte, pos_byte, - XSTRING (string)->size_byte - pos_byte, + STRING_BYTES (XSTRING (string)), pos_byte, + STRING_BYTES (XSTRING (string)) - pos_byte, &search_regs); immediate_quit = 0; last_thing_searched = Qt; @@ -431,8 +431,8 @@ re_match_object = string; val = re_search (bufp, (char *) XSTRING (string)->data, - XSTRING (string)->size_byte, 0, XSTRING (string)->size_byte, - 0); + STRING_BYTES (XSTRING (string)), 0, + STRING_BYTES (XSTRING (string)), 0); immediate_quit = 0; return val; } @@ -930,7 +930,7 @@ trivial_regexp_p (regexp) Lisp_Object regexp; { - int len = XSTRING (regexp)->size_byte; + int len = STRING_BYTES (XSTRING (regexp)); unsigned char *s = XSTRING (regexp)->data; unsigned char c; while (--len >= 0) @@ -1004,7 +1004,7 @@ int posix; { int len = XSTRING (string)->size; - int len_byte = XSTRING (string)->size_byte; + int len_byte = STRING_BYTES (XSTRING (string)); register int i; if (running_asynch_code) @@ -1143,7 +1143,7 @@ { raw_pattern = (char *) XSTRING (string)->data; raw_pattern_size = XSTRING (string)->size; - raw_pattern_size_byte = XSTRING (string)->size_byte; + raw_pattern_size_byte = STRING_BYTES (XSTRING (string)); } else if (multibyte) { @@ -1167,7 +1167,7 @@ raw_pattern_size_byte = XSTRING (string)->size; raw_pattern = (char *) alloca (raw_pattern_size + 1); copy_text (XSTRING (string)->data, raw_pattern, - XSTRING (string)->size_byte, 1, 0); + STRING_BYTES (XSTRING (string)), 1, 0); } /* Copy and optionally translate the pattern. */ @@ -1951,13 +1951,13 @@ adjust = - punct_count + 5 * (word_count - 1) + 4; val = make_uninit_multibyte_string (len + adjust, - XSTRING (string)->size_byte + adjust); + STRING_BYTES (XSTRING (string)) + adjust); o = XSTRING (val)->data; *o++ = '\\'; *o++ = 'b'; - for (i = 0; i < XSTRING (val)->size_byte; i++) + for (i = 0; i < STRING_BYTES (XSTRING (val)); i++) if (SYNTAX (p[i]) == Sword) *o++ = p[i]; else if (i > 0 && SYNTAX (p[i-1]) == Sword && --word_count) @@ -2283,7 +2283,7 @@ accum = Qnil; - for (pos_byte = 0, pos = 0; pos_byte < XSTRING (newtext)->size_byte;) + for (pos_byte = 0, pos = 0; pos_byte < STRING_BYTES (XSTRING (newtext));) { int substart = -1; int subend; @@ -2693,12 +2693,12 @@ CHECK_STRING (string, 0); - temp = (unsigned char *) alloca (XSTRING (string)->size_byte * 2); + temp = (unsigned char *) alloca (STRING_BYTES (XSTRING (string)) * 2); /* Now copy the data into the new string, inserting escapes. */ in = XSTRING (string)->data; - end = in + XSTRING (string)->size_byte; + end = in + STRING_BYTES (XSTRING (string)); out = temp; for (; in != end; in++) diff -r e82a4a4fa12a -r 50929073a0ba src/xdisp.c --- a/src/xdisp.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/xdisp.c Sat Mar 21 07:06:14 1998 +0000 @@ -877,7 +877,7 @@ already wasted too much time by walking through the list with display_mode_element, then we might need to optimize at a higher level than this.) */ - if (! STRINGP (f->name) || XSTRING (f->name)->size_byte != len + if (! STRINGP (f->name) || STRING_BYTES (XSTRING (f->name)) != len || bcmp (frame_title_buf, XSTRING (f->name)->data, len) != 0) x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil); } @@ -3231,7 +3231,7 @@ minibuf_prompt_width = (display_string (w, vpos, XSTRING (minibuf_prompt)->data, - XSTRING (minibuf_prompt)->size_byte, + STRING_BYTES (XSTRING (minibuf_prompt)), hpos + WINDOW_LEFT_MARGIN (w), /* Display a space if we truncate. */ ' ', @@ -4104,7 +4104,7 @@ if (hpos < maxendcol) hpos = display_string (w, vpos, XSTRING (string)->data, - XSTRING (string)->size_byte, + STRING_BYTES (XSTRING (string)), hpos, 0, 0, hpos, maxendcol, STRING_MULTIBYTE (string)); /* Put a space between items. */ @@ -4311,7 +4311,7 @@ minendcol, maxendcol); else hpos = display_string (w, vpos, XSTRING (tem)->data, - XSTRING (tem)->size_byte, + STRING_BYTES (XSTRING (tem)), hpos, 0, 1, minendcol, maxendcol, STRING_MULTIBYTE (tem)); } @@ -4607,7 +4607,7 @@ case 'b': obj = b->name; #if 0 - if (maxwidth >= 3 && XSTRING (obj)->size_byte > maxwidth) + if (maxwidth >= 3 && STRING_BYTES (XSTRING (obj)) > maxwidth) { bcopy (XSTRING (obj)->data, decode_mode_spec_buf, maxwidth - 1); decode_mode_spec_buf[maxwidth - 1] = '\\'; @@ -4641,10 +4641,10 @@ #if 0 if (NILP (obj)) return "[none]"; - else if (STRINGP (obj) && XSTRING (obj)->size_byte > maxwidth) + else if (STRINGP (obj) && STRING_BYTES (XSTRING (obj)) > maxwidth) { bcopy ("...", decode_mode_spec_buf, 3); - bcopy (XSTRING (obj)->data + XSTRING (obj)->size_byte - maxwidth + 3, + bcopy (XSTRING (obj)->data + STRING_BYTES (XSTRING (obj)) - maxwidth + 3, decode_mode_spec_buf + 3, maxwidth - 3); return decode_mode_spec_buf; } diff -r e82a4a4fa12a -r 50929073a0ba src/xfns.c --- a/src/xfns.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/xfns.c Sat Mar 21 07:06:14 1998 +0000 @@ -600,7 +600,7 @@ dpyinfo->bitmaps[id - 1].pixmap = bitmap; dpyinfo->bitmaps[id - 1].refcount = 1; dpyinfo->bitmaps[id - 1].file - = (char *) xmalloc (XSTRING (file)->size_byte + 1); + = (char *) xmalloc (STRING_BYTES (XSTRING (file)) + 1); dpyinfo->bitmaps[id - 1].depth = 1; dpyinfo->bitmaps[id - 1].height = height; dpyinfo->bitmaps[id - 1].width = width; @@ -1823,14 +1823,14 @@ text.value = XSTRING (name)->data; text.encoding = XA_STRING; text.format = 8; - text.nitems = XSTRING (name)->size_byte; + text.nitems = STRING_BYTES (XSTRING (name)); icon_name = (!NILP (f->icon_name) ? f->icon_name : name); icon.value = XSTRING (icon_name)->data; icon.encoding = XA_STRING; icon.format = 8; - icon.nitems = XSTRING (icon_name)->size_byte; + icon.nitems = STRING_BYTES (XSTRING (icon_name)); #ifdef USE_X_TOOLKIT XSetWMName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), &text); @@ -1913,14 +1913,14 @@ text.value = XSTRING (name)->data; text.encoding = XA_STRING; text.format = 8; - text.nitems = XSTRING (name)->size_byte; + text.nitems = STRING_BYTES (XSTRING (name)); icon_name = (!NILP (f->icon_name) ? f->icon_name : name); icon.value = XSTRING (icon_name)->data; icon.encoding = XA_STRING; icon.format = 8; - icon.nitems = XSTRING (icon_name)->size_byte; + icon.nitems = STRING_BYTES (XSTRING (icon_name)); #ifdef USE_X_TOOLKIT XSetWMName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), &text); @@ -2050,7 +2050,7 @@ unsigned char *p = XSTRING (Vx_resource_name)->data; int i; - len = XSTRING (Vx_resource_name)->size_byte; + len = STRING_BYTES (XSTRING (Vx_resource_name)); /* Only letters, digits, - and _ are valid in resource names. Count the valid characters and count the invalid ones. */ @@ -2134,16 +2134,16 @@ /* 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 (XSTRING (Vx_resource_name)->size_byte + name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) + (STRINGP (component) - ? XSTRING (component)->size_byte : 0) - + XSTRING (attribute)->size_byte + ? STRING_BYTES (XSTRING (component)) : 0) + + STRING_BYTES (XSTRING (attribute)) + 3); - class_key = (char *) alloca (XSTRING (Vx_resource_class)->size_byte - + XSTRING (class)->size_byte + class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class)) + + STRING_BYTES (XSTRING (class)) + (STRINGP (subclass) - ? XSTRING (subclass)->size_byte : 0) + ? STRING_BYTES (XSTRING (subclass)) : 0) + 3); /* Start with emacs.FRAMENAME for the name (the specific one) @@ -2202,16 +2202,16 @@ /* 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 (XSTRING (Vx_resource_name)->size_byte + name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) + (STRINGP (component) - ? XSTRING (component)->size_byte : 0) - + XSTRING (attribute)->size_byte + ? STRING_BYTES (XSTRING (component)) : 0) + + STRING_BYTES (XSTRING (attribute)) + 3); - class_key = (char *) alloca (XSTRING (Vx_resource_class)->size_byte - + XSTRING (class)->size_byte + class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class)) + + STRING_BYTES (XSTRING (class)) + (STRINGP (subclass) - ? XSTRING (subclass)->size_byte : 0) + ? STRING_BYTES (XSTRING (subclass)) : 0) + 3); /* Start with emacs.FRAMENAME for the name (the specific one) @@ -2254,7 +2254,7 @@ /* Allocate space for the components, the dots which separate them, and the final '\0'. */ - name_key = (char *) alloca (XSTRING (Vinvocation_name)->size_byte + name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name)) + strlen (attribute) + 2); class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) + strlen (class) + 2); @@ -4871,7 +4871,8 @@ if (NILP (modifiers)) XRebindKeysym (x_current_display, keysym, modifier_list, 0, - XSTRING (newstring)->data, XSTRING (newstring)->size_byte); + XSTRING (newstring)->data, + STRING_BYTES (XSTRING (newstring))); else { register Lisp_Object rest, mod; @@ -4899,7 +4900,8 @@ } XRebindKeysym (x_current_display, keysym, modifier_list, i, - XSTRING (newstring)->data, XSTRING (newstring)->size_byte); + XSTRING (newstring)->data, + STRING_BYTES (XSTRING (newstring))); } return Qnil; @@ -4930,7 +4932,7 @@ if (!NILP (item)) { CHECK_STRING (item, 2); - strsize = XSTRING (item)->size_byte; + strsize = STRING_BYTES (XSTRING (item)); rawstring = (unsigned char *) xmalloc (strsize); bcopy (XSTRING (item)->data, rawstring, strsize); modifier[1] = 1 << i; diff -r e82a4a4fa12a -r 50929073a0ba src/xmenu.c --- a/src/xmenu.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/xmenu.c Sat Mar 21 07:06:14 1998 +0000 @@ -2436,7 +2436,7 @@ j++; continue; } - width = XSTRING (item)->size_byte; + width = STRING_BYTES (XSTRING (item)); if (width > maxwidth) maxwidth = width; @@ -2459,7 +2459,7 @@ = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY]; if (!NILP (descrip)) { - int gap = maxwidth - XSTRING (item_name)->size_byte; + int gap = maxwidth - STRING_BYTES (XSTRING (item_name)); #ifdef C_ALLOCA Lisp_Object spacer; spacer = Fmake_string (make_number (gap), make_number (' ')); @@ -2471,14 +2471,14 @@ to reduce gc needs. */ item_data = (unsigned char *) alloca (maxwidth - + XSTRING (descrip)->size_byte + 1); + + STRING_BYTES (XSTRING (descrip)) + 1); bcopy (XSTRING (item_name)->data, item_data, - XSTRING (item_name)->size_byte); + STRING_BYTES (XSTRING (item_name))); for (j = XSTRING (item_name)->size; j < maxwidth; j++) item_data[j] = ' '; bcopy (XSTRING (descrip)->data, item_data + j, - XSTRING (descrip)->size_byte); - item_data[j + XSTRING (descrip)->size_byte] = 0; + STRING_BYTES (XSTRING (descrip))); + item_data[j + STRING_BYTES (XSTRING (descrip))] = 0; #endif } else diff -r e82a4a4fa12a -r 50929073a0ba src/xselect.c --- a/src/xselect.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/xselect.c Sat Mar 21 07:06:14 1998 +0000 @@ -1611,7 +1611,7 @@ int num; *format_ret = 8; - *size_ret = XSTRING (obj)->size_byte; + *size_ret = STRING_BYTES (XSTRING (obj)); *data_ret = XSTRING (obj)->data; bzero (charsets, (MAX_CHARSET + 1) * sizeof (int)); num = ((*size_ret <= 1 /* Check the possibility of short cut. */ @@ -2134,7 +2134,7 @@ buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (selected_frame), display, buffer); data = (unsigned char *) XSTRING (string)->data; - bytes = XSTRING (string)->size_byte; + bytes = STRING_BYTES (XSTRING (string)); bytes_remaining = bytes; if (! FRAME_X_DISPLAY_INFO (selected_frame)->cut_buffers_initialized) diff -r e82a4a4fa12a -r 50929073a0ba src/xterm.c --- a/src/xterm.c Sat Mar 21 06:16:35 1998 +0000 +++ b/src/xterm.c Sat Mar 21 07:06:14 1998 +0000 @@ -6933,8 +6933,8 @@ #endif /* ! 0 */ dpyinfo->x_id_name - = (char *) xmalloc (XSTRING (Vinvocation_name)->size_byte - + XSTRING (Vsystem_name)->size_byte + = (char *) xmalloc (STRING_BYTES (XSTRING (Vinvocation_name)) + + STRING_BYTES (XSTRING (Vsystem_name)) + 2); sprintf (dpyinfo->x_id_name, "%s@%s", XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data);