diff options
| author | Ken Raeburn | 2002-07-15 00:01:34 +0000 |
|---|---|---|
| committer | Ken Raeburn | 2002-07-15 00:01:34 +0000 |
| commit | d5db40779d7505244d37476b4f046641f07eea2b (patch) | |
| tree | 5c8bf4dad41639287e722cb7cbdc0709e47a9e53 /src/xterm.c | |
| parent | 491c2516d32fa8b9ba9422ec142c8925dd82af00 (diff) | |
| download | emacs-d5db40779d7505244d37476b4f046641f07eea2b.tar.gz emacs-d5db40779d7505244d37476b4f046641f07eea2b.zip | |
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
SCHARS, SBYTES, STRING_INTERVALS, SREF, SDATA; explicit size_byte references
left unchanged for now.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/xterm.c b/src/xterm.c index 0067643c89f..5796ff9e8b9 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -7269,7 +7269,7 @@ note_mouse_highlight (f, x, y) | |||
| 7269 | if (NILP (b)) | 7269 | if (NILP (b)) |
| 7270 | b = make_number (0); | 7270 | b = make_number (0); |
| 7271 | if (NILP (e)) | 7271 | if (NILP (e)) |
| 7272 | e = make_number (XSTRING (object)->size - 1); | 7272 | e = make_number (SCHARS (object) - 1); |
| 7273 | fast_find_string_pos (w, XINT (b), object, | 7273 | fast_find_string_pos (w, XINT (b), object, |
| 7274 | &dpyinfo->mouse_face_beg_col, | 7274 | &dpyinfo->mouse_face_beg_col, |
| 7275 | &dpyinfo->mouse_face_beg_row, | 7275 | &dpyinfo->mouse_face_beg_row, |
| @@ -7367,7 +7367,7 @@ note_mouse_highlight (f, x, y) | |||
| 7367 | /* Try text properties. */ | 7367 | /* Try text properties. */ |
| 7368 | if (STRINGP (object) | 7368 | if (STRINGP (object) |
| 7369 | && charpos >= 0 | 7369 | && charpos >= 0 |
| 7370 | && charpos < XSTRING (object)->size) | 7370 | && charpos < SCHARS (object)) |
| 7371 | { | 7371 | { |
| 7372 | help = Fget_text_property (make_number (charpos), | 7372 | help = Fget_text_property (make_number (charpos), |
| 7373 | Qhelp_echo, object); | 7373 | Qhelp_echo, object); |
| @@ -12099,7 +12099,7 @@ x_error_catcher (display, error) | |||
| 12099 | XErrorEvent *error; | 12099 | XErrorEvent *error; |
| 12100 | { | 12100 | { |
| 12101 | XGetErrorText (display, error->error_code, | 12101 | XGetErrorText (display, error->error_code, |
| 12102 | XSTRING (x_error_message_string)->data, | 12102 | SDATA (x_error_message_string), |
| 12103 | X_ERROR_MESSAGE_SIZE); | 12103 | X_ERROR_MESSAGE_SIZE); |
| 12104 | } | 12104 | } |
| 12105 | 12105 | ||
| @@ -12131,7 +12131,7 @@ x_catch_errors (dpy) | |||
| 12131 | record_unwind_protect (x_catch_errors_unwind, x_error_message_string); | 12131 | record_unwind_protect (x_catch_errors_unwind, x_error_message_string); |
| 12132 | 12132 | ||
| 12133 | x_error_message_string = make_uninit_string (X_ERROR_MESSAGE_SIZE); | 12133 | x_error_message_string = make_uninit_string (X_ERROR_MESSAGE_SIZE); |
| 12134 | XSTRING (x_error_message_string)->data[0] = 0; | 12134 | SREF (x_error_message_string, 0) = 0; |
| 12135 | 12135 | ||
| 12136 | return count; | 12136 | return count; |
| 12137 | } | 12137 | } |
| @@ -12158,8 +12158,8 @@ x_check_errors (dpy, format) | |||
| 12158 | /* Make sure to catch any errors incurred so far. */ | 12158 | /* Make sure to catch any errors incurred so far. */ |
| 12159 | XSync (dpy, False); | 12159 | XSync (dpy, False); |
| 12160 | 12160 | ||
| 12161 | if (XSTRING (x_error_message_string)->data[0]) | 12161 | if (SREF (x_error_message_string, 0)) |
| 12162 | error (format, XSTRING (x_error_message_string)->data); | 12162 | error (format, SDATA (x_error_message_string)); |
| 12163 | } | 12163 | } |
| 12164 | 12164 | ||
| 12165 | /* Nonzero if we had any X protocol errors | 12165 | /* Nonzero if we had any X protocol errors |
| @@ -12172,7 +12172,7 @@ x_had_errors_p (dpy) | |||
| 12172 | /* Make sure to catch any errors incurred so far. */ | 12172 | /* Make sure to catch any errors incurred so far. */ |
| 12173 | XSync (dpy, False); | 12173 | XSync (dpy, False); |
| 12174 | 12174 | ||
| 12175 | return XSTRING (x_error_message_string)->data[0] != 0; | 12175 | return SREF (x_error_message_string, 0) != 0; |
| 12176 | } | 12176 | } |
| 12177 | 12177 | ||
| 12178 | /* Forget about any errors we have had, since we did x_catch_errors on DPY. */ | 12178 | /* Forget about any errors we have had, since we did x_catch_errors on DPY. */ |
| @@ -12181,7 +12181,7 @@ void | |||
| 12181 | x_clear_errors (dpy) | 12181 | x_clear_errors (dpy) |
| 12182 | Display *dpy; | 12182 | Display *dpy; |
| 12183 | { | 12183 | { |
| 12184 | XSTRING (x_error_message_string)->data[0] = 0; | 12184 | SREF (x_error_message_string, 0) = 0; |
| 12185 | } | 12185 | } |
| 12186 | 12186 | ||
| 12187 | /* Stop catching X protocol errors and let them make Emacs die. | 12187 | /* Stop catching X protocol errors and let them make Emacs die. |
| @@ -12481,7 +12481,7 @@ x_new_fontset (f, fontsetname) | |||
| 12481 | to do. */ | 12481 | to do. */ |
| 12482 | return fontset_name (fontset); | 12482 | return fontset_name (fontset); |
| 12483 | 12483 | ||
| 12484 | result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data)); | 12484 | result = x_new_font (f, (SDATA (fontset_ascii (fontset)))); |
| 12485 | 12485 | ||
| 12486 | if (!STRINGP (result)) | 12486 | if (!STRINGP (result)) |
| 12487 | /* Can't load ASCII font. */ | 12487 | /* Can't load ASCII font. */ |
| @@ -12493,7 +12493,7 @@ x_new_fontset (f, fontsetname) | |||
| 12493 | #ifdef HAVE_X_I18N | 12493 | #ifdef HAVE_X_I18N |
| 12494 | if (FRAME_XIC (f) | 12494 | if (FRAME_XIC (f) |
| 12495 | && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea))) | 12495 | && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea))) |
| 12496 | xic_set_xfontset (f, XSTRING (fontset_ascii (fontset))->data); | 12496 | xic_set_xfontset (f, SDATA (fontset_ascii (fontset))); |
| 12497 | #endif | 12497 | #endif |
| 12498 | 12498 | ||
| 12499 | return build_string (fontsetname); | 12499 | return build_string (fontsetname); |
| @@ -14093,7 +14093,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 14093 | XFontStruct *font; | 14093 | XFontStruct *font; |
| 14094 | unsigned long value; | 14094 | unsigned long value; |
| 14095 | 14095 | ||
| 14096 | font = XLoadQueryFont (dpy, XSTRING (pattern)->data); | 14096 | font = XLoadQueryFont (dpy, SDATA (pattern)); |
| 14097 | if (x_had_errors_p (dpy)) | 14097 | if (x_had_errors_p (dpy)) |
| 14098 | { | 14098 | { |
| 14099 | /* This error is perhaps due to insufficient memory on X | 14099 | /* This error is perhaps due to insufficient memory on X |
| @@ -14136,7 +14136,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 14136 | { | 14136 | { |
| 14137 | /* We try at least 10 fonts because XListFonts will return | 14137 | /* We try at least 10 fonts because XListFonts will return |
| 14138 | auto-scaled fonts at the head. */ | 14138 | auto-scaled fonts at the head. */ |
| 14139 | names = XListFonts (dpy, XSTRING (pattern)->data, max (maxnames, 10), | 14139 | names = XListFonts (dpy, SDATA (pattern), max (maxnames, 10), |
| 14140 | &num_fonts); | 14140 | &num_fonts); |
| 14141 | if (x_had_errors_p (dpy)) | 14141 | if (x_had_errors_p (dpy)) |
| 14142 | { | 14142 | { |
| @@ -14237,7 +14237,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 14237 | BLOCK_INPUT; | 14237 | BLOCK_INPUT; |
| 14238 | count = x_catch_errors (dpy); | 14238 | count = x_catch_errors (dpy); |
| 14239 | thisinfo = XLoadQueryFont (dpy, | 14239 | thisinfo = XLoadQueryFont (dpy, |
| 14240 | XSTRING (XCAR (tem))->data); | 14240 | SDATA (XCAR (tem))); |
| 14241 | if (x_had_errors_p (dpy)) | 14241 | if (x_had_errors_p (dpy)) |
| 14242 | { | 14242 | { |
| 14243 | /* This error is perhaps due to insufficient memory on X | 14243 | /* This error is perhaps due to insufficient memory on X |
| @@ -14417,9 +14417,9 @@ x_load_font (f, fontname, size) | |||
| 14417 | for (tail = font_names; CONSP (tail); tail = XCDR (tail)) | 14417 | for (tail = font_names; CONSP (tail); tail = XCDR (tail)) |
| 14418 | if (dpyinfo->font_table[i].name | 14418 | if (dpyinfo->font_table[i].name |
| 14419 | && (!strcmp (dpyinfo->font_table[i].name, | 14419 | && (!strcmp (dpyinfo->font_table[i].name, |
| 14420 | XSTRING (XCAR (tail))->data) | 14420 | SDATA (XCAR (tail))) |
| 14421 | || !strcmp (dpyinfo->font_table[i].full_name, | 14421 | || !strcmp (dpyinfo->font_table[i].full_name, |
| 14422 | XSTRING (XCAR (tail))->data))) | 14422 | SDATA (XCAR (tail))))) |
| 14423 | return (dpyinfo->font_table + i); | 14423 | return (dpyinfo->font_table + i); |
| 14424 | } | 14424 | } |
| 14425 | 14425 | ||
| @@ -14437,7 +14437,7 @@ x_load_font (f, fontname, size) | |||
| 14437 | a bug of not finding a font even if the font surely exists and | 14437 | a bug of not finding a font even if the font surely exists and |
| 14438 | is loadable by XLoadQueryFont. */ | 14438 | is loadable by XLoadQueryFont. */ |
| 14439 | if (size > 0 && !NILP (font_names)) | 14439 | if (size > 0 && !NILP (font_names)) |
| 14440 | fontname = (char *) XSTRING (XCAR (font_names))->data; | 14440 | fontname = (char *) SDATA (XCAR (font_names)); |
| 14441 | 14441 | ||
| 14442 | BLOCK_INPUT; | 14442 | BLOCK_INPUT; |
| 14443 | count = x_catch_errors (FRAME_X_DISPLAY (f)); | 14443 | count = x_catch_errors (FRAME_X_DISPLAY (f)); |
| @@ -14689,7 +14689,7 @@ same_x_server (name1, name2) | |||
| 14689 | char *name1, *name2; | 14689 | char *name1, *name2; |
| 14690 | { | 14690 | { |
| 14691 | int seen_colon = 0; | 14691 | int seen_colon = 0; |
| 14692 | unsigned char *system_name = XSTRING (Vsystem_name)->data; | 14692 | unsigned char *system_name = SDATA (Vsystem_name); |
| 14693 | int system_name_length = strlen (system_name); | 14693 | int system_name_length = strlen (system_name); |
| 14694 | int length_until_period = 0; | 14694 | int length_until_period = 0; |
| 14695 | 14695 | ||
| @@ -14771,7 +14771,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 14771 | argv[argc++] = xrm_option; | 14771 | argv[argc++] = xrm_option; |
| 14772 | } | 14772 | } |
| 14773 | stop_polling (); | 14773 | stop_polling (); |
| 14774 | dpy = XtOpenDisplay (Xt_app_con, XSTRING (display_name)->data, | 14774 | dpy = XtOpenDisplay (Xt_app_con, SDATA (display_name), |
| 14775 | resource_name, EMACS_CLASS, | 14775 | resource_name, EMACS_CLASS, |
| 14776 | emacs_options, XtNumber (emacs_options), | 14776 | emacs_options, XtNumber (emacs_options), |
| 14777 | &argc, argv); | 14777 | &argc, argv); |
| @@ -14787,7 +14787,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 14787 | #ifdef HAVE_X11R5 | 14787 | #ifdef HAVE_X11R5 |
| 14788 | XSetLocaleModifiers (""); | 14788 | XSetLocaleModifiers (""); |
| 14789 | #endif | 14789 | #endif |
| 14790 | dpy = XOpenDisplay (XSTRING (display_name)->data); | 14790 | dpy = XOpenDisplay (SDATA (display_name)); |
| 14791 | #endif /* not USE_X_TOOLKIT */ | 14791 | #endif /* not USE_X_TOOLKIT */ |
| 14792 | 14792 | ||
| 14793 | /* Detect failure. */ | 14793 | /* Detect failure. */ |
| @@ -14809,8 +14809,8 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 14809 | 14809 | ||
| 14810 | for (share = x_display_list, tail = x_display_name_list; share; | 14810 | for (share = x_display_list, tail = x_display_name_list; share; |
| 14811 | share = share->next, tail = XCDR (tail)) | 14811 | share = share->next, tail = XCDR (tail)) |
| 14812 | if (same_x_server (XSTRING (XCAR (XCAR (tail)))->data, | 14812 | if (same_x_server (SDATA (XCAR (XCAR (tail))), |
| 14813 | XSTRING (display_name)->data)) | 14813 | SDATA (display_name))) |
| 14814 | break; | 14814 | break; |
| 14815 | if (share) | 14815 | if (share) |
| 14816 | dpyinfo->kboard = share->kboard; | 14816 | dpyinfo->kboard = share->kboard; |
| @@ -14856,11 +14856,11 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 14856 | #endif /* ! 0 */ | 14856 | #endif /* ! 0 */ |
| 14857 | 14857 | ||
| 14858 | dpyinfo->x_id_name | 14858 | dpyinfo->x_id_name |
| 14859 | = (char *) xmalloc (STRING_BYTES (XSTRING (Vinvocation_name)) | 14859 | = (char *) xmalloc (SBYTES (Vinvocation_name) |
| 14860 | + STRING_BYTES (XSTRING (Vsystem_name)) | 14860 | + SBYTES (Vsystem_name) |
| 14861 | + 2); | 14861 | + 2); |
| 14862 | sprintf (dpyinfo->x_id_name, "%s@%s", | 14862 | sprintf (dpyinfo->x_id_name, "%s@%s", |
| 14863 | XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data); | 14863 | SDATA (Vinvocation_name), SDATA (Vsystem_name)); |
| 14864 | 14864 | ||
| 14865 | /* Figure out which modifier bits mean what. */ | 14865 | /* Figure out which modifier bits mean what. */ |
| 14866 | x_find_modifier_meanings (dpyinfo); | 14866 | x_find_modifier_meanings (dpyinfo); |
| @@ -14923,8 +14923,8 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 14923 | build_string ("PrivateColormap"), | 14923 | build_string ("PrivateColormap"), |
| 14924 | Qnil, Qnil); | 14924 | Qnil, Qnil); |
| 14925 | if (STRINGP (value) | 14925 | if (STRINGP (value) |
| 14926 | && (!strcmp (XSTRING (value)->data, "true") | 14926 | && (!strcmp (SDATA (value), "true") |
| 14927 | || !strcmp (XSTRING (value)->data, "on"))) | 14927 | || !strcmp (SDATA (value), "on"))) |
| 14928 | dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap); | 14928 | dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap); |
| 14929 | } | 14929 | } |
| 14930 | } | 14930 | } |
| @@ -15084,8 +15084,8 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 15084 | build_string ("Synchronous"), | 15084 | build_string ("Synchronous"), |
| 15085 | Qnil, Qnil); | 15085 | Qnil, Qnil); |
| 15086 | if (STRINGP (value) | 15086 | if (STRINGP (value) |
| 15087 | && (!strcmp (XSTRING (value)->data, "true") | 15087 | && (!strcmp (SDATA (value), "true") |
| 15088 | || !strcmp (XSTRING (value)->data, "on"))) | 15088 | || !strcmp (SDATA (value), "on"))) |
| 15089 | XSynchronize (dpyinfo->display, True); | 15089 | XSynchronize (dpyinfo->display, True); |
| 15090 | } | 15090 | } |
| 15091 | 15091 | ||