+2011-01-23 Paul Eggert <eggert@cs.ucla.edu>
+
+ Promote SSDATA macro from gtkutil.c and xsmfns.c to lisp.h.
+ * lisp.h (SSDATA): New macro.
+ All uses of (char *) SDATA (x) replaced with SSDATA (x),
+ and all uses of (unsigned char *) SDATA (x) replaced with SDATA (x).
+ * gtkutil.c (SSDATA): Remove, as lisp.h now defines this.
+ * xsmfns.c (SSDATA): Likewise.
+
2011-01-22 Martin Rudalics <rudalics@gmx.at>
* window.c (select_window): New function.
if (next_event >= key_count)
error ("%s must be bound to an event with parameters",
(SYMBOLP (function)
- ? (char *) SDATA (SYMBOL_NAME (function))
+ ? SSDATA (SYMBOL_NAME (function))
: "command"));
args[i] = AREF (keys, next_event);
next_event++;
defsubr (&Scall_interactively);
defsubr (&Sprefix_numeric_value);
}
-
{
if (SBYTES (entry) > varlen && SREF (entry, varlen) == '=')
{
- *value = (char *) SDATA (entry) + (varlen + 1);
+ *value = SSDATA (entry) + (varlen + 1);
*valuelen = SBYTES (entry) - (varlen + 1);
return 1;
}
= Fframe_parameter (NILP (frame) ? selected_frame : frame, Qdisplay);
if (STRINGP (display))
{
- *value = (char *) SDATA (display);
+ *value = SSDATA (display);
*valuelen = SBYTES (display);
return 1;
}
defsubr (&Sgetenv_internal);
defsubr (&Scall_process_region);
}
-
c = temp_charset_work->min_char;
stop = (temp_charset_work->max_char < 0x20000
? temp_charset_work->max_char : 0xFFFF);
-
+
while (1)
{
int index = GET_TEMP_CHARSET_WORK_ENCODER (c);
else
{
code = GET_TEMP_CHARSET_WORK_ENCODER (c);
- code = INDEX_TO_CODE_POINT (charset, code);
+ code = INDEX_TO_CODE_POINT (charset, code);
}
}
else /* method == CHARSET_METHOD_OFFSET */
{
Lisp_Object tempdir;
tempdir = Fexpand_file_name (build_string ("charsets"), Vdata_directory);
- if (access ((char *) SDATA (tempdir), 0) < 0)
+ if (access (SSDATA (tempdir), 0) < 0)
{
dir_warning ("Error: charsets directory (%s) does not exist.\n\
Emacs will not function correctly without the character map files.\n\
}
#endif /* emacs */
-
attrs = CODING_ID_ATTRS (coding->id);
valids = AREF (attrs, coding_attr_charset_valids);
name = CODING_ID_NAME (coding->id);
- if (strncmp ((char *) SDATA (SYMBOL_NAME (name)),
+ if (strncmp (SSDATA (SYMBOL_NAME (name)),
"iso-8859-", sizeof ("iso-8859-") - 1) == 0
- || strncmp ((char *) SDATA (SYMBOL_NAME (name)),
+ || strncmp (SSDATA (SYMBOL_NAME (name)),
"iso-latin-", sizeof ("iso-latin-") - 1) == 0)
check_latin_extra = 1;
Lisp_Object dec = code_convert_string_norecord (build_string (str),
Vlocale_coding_system,
0);
- str = (char *) SDATA (dec);
+ str = SSDATA (dec);
}
return str;
w,
((BUFFERP (w->buffer)
&& STRINGP (XBUFFER (w->buffer)->name))
- ? (char *) SDATA (XBUFFER (w->buffer)->name)
+ ? SSDATA (XBUFFER (w->buffer)->name)
: "???"),
paused_p ? " ***paused***" : "");
strcat (buf, msg);
Vwindow_system_version = Qnil;
}
}
-
}
else
{
- name = (char *) SDATA (file);
+ name = SSDATA (file);
}
fd = emacs_open (name, O_RDONLY, 0);
bufp += length_byte;
nchars += length;
/* Check STRING again in case gc relocated it. */
- strp = (unsigned char *) SDATA (string) + idx;
+ strp = SDATA (string) + idx;
}
}
else if (! multibyte) /* just copy other chars */
defsubr (&Ssnarf_documentation);
defsubr (&Ssubstitute_command_keys);
}
-
get_system_name (void)
{
if (STRINGP (Vsystem_name))
- return (const char *) SDATA (Vsystem_name);
+ return SSDATA (Vsystem_name);
else
return "";
}
get_operating_system_release (void)
{
if (STRINGP (Voperating_system_release))
- return (char *) SDATA (Voperating_system_release);
+ return SSDATA (Voperating_system_release);
else
return "";
}
if (EQ (zone, Qt))
tzstring = "UTC0";
else if (STRINGP (zone))
- tzstring = (char *) SDATA (zone);
+ tzstring = SSDATA (zone);
else if (INTEGERP (zone))
{
int abszone = eabs (XINT (zone));
else
{
CHECK_STRING (tz);
- tzstring = (char *) SDATA (tz);
+ tzstring = SSDATA (tz);
}
set_time_zone_rule (tzstring);
defsubr (&Ssave_restriction);
defsubr (&Stranspose_regions);
}
-
{
*plocale = desired_locale;
setlocale (category, (STRINGP (desired_locale)
- ? (char *) SDATA (desired_locale)
+ ? SSDATA (desired_locale)
: ""));
}
}
/* Make sure IS_DAEMON starts up as false. */
daemon_pipe[1] = 0;
}
-
{
int c;
- str = (char *) SDATA (errstring);
+ str = SSDATA (errstring);
c = STRING_CHAR (str);
Faset (errstring, make_number (0), make_number (DOWNCASE (c)));
}
return Qnil;
return (statbuf.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil;
#else
- return (check_writable (!NILP (dir) ? (char *) SDATA (dir) : "")
+ return (check_writable (!NILP (dir) ? SSDATA (dir) : "")
? Qt : Qnil);
#endif
}
boot_time = get_boot_time ();
if (STRINGP (Fuser_login_name (Qnil)))
- user_name = (char *)SDATA (Fuser_login_name (Qnil));
+ user_name = SSDATA (Fuser_login_name (Qnil));
else
user_name = "";
if (STRINGP (Fsystem_name ()))
- host_name = (char *)SDATA (Fsystem_name ());
+ host_name = SSDATA (Fsystem_name ());
else
host_name = "";
lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name)
defsubr (&Sfile_locked_p);
#endif
}
-
if (SYMBOLP (val))
val = SYMBOL_NAME (val);
if (j == XLFD_REGISTRY_INDEX
- && ! strchr ((char *) SDATA (val), '-'))
+ && ! strchr (SSDATA (val), '-'))
{
/* Change "jisx0208*" and "jisx0208" to "jisx0208*-*". */
if (SDATA (val)[SBYTES (val) - 1] == '*')
}
}
else
- f[j] = (char *) SDATA (val), len += SBYTES (val) + 1;
+ f[j] = SSDATA (val), len += SBYTES (val) + 1;
}
}
else
{
val = SYMBOL_NAME (val);
- f[j] = (char *) SDATA (val), len += SBYTES (val) + 1;
+ f[j] = SSDATA (val), len += SBYTES (val) + 1;
}
}
{
CHECK_STRING (family);
len = SBYTES (family);
- p0 = (char *) SDATA (family);
+ p0 = SSDATA (family);
p1 = strchr (p0, '-');
if (p1)
{
/* Convert "XXX" and "XXX*" to "XXX*-*". */
CHECK_STRING (registry);
len = SBYTES (registry);
- p0 = (char *) SDATA (registry);
+ p0 = SSDATA (registry);
p1 = strchr (p0, '-');
if (! p1)
{
otf = XSAVE_VALUE (XCDR (val))->pointer;
else
{
- otf = STRINGP (file) ? OTF_open ((char *) SDATA (file)) : NULL;
+ otf = STRINGP (file) ? OTF_open (SSDATA (file)) : NULL;
val = make_save_value (otf, 0);
otf_list = Fcons (Fcons (file, val), otf_list);
}
Lisp_Object spec = Ffont_spec (0, NULL);
CHECK_STRING (font_name);
- if (font_parse_name ((char *) SDATA (font_name), spec) == -1)
+ if (font_parse_name (SSDATA (font_name), spec) == -1)
return Qnil;
font_put_extra (spec, QCname, font_name);
font_put_extra (spec, QCuser_spec, font_name);
else if (STRINGP (attrs[LFACE_FOUNDRY_INDEX]))
{
val = attrs[LFACE_FOUNDRY_INDEX];
- foundry[0] = font_intern_prop ((char *) SDATA (val), SBYTES (val), 1);
+ foundry[0] = font_intern_prop (SSDATA (val), SBYTES (val), 1);
foundry[1] = Qnil;
foundry[2] = null_vector;
}
if (NILP (val) && STRINGP (attrs[LFACE_FAMILY_INDEX]))
{
val = attrs[LFACE_FAMILY_INDEX];
- val = font_intern_prop ((char *) SDATA (val), SBYTES (val), 1);
+ val = font_intern_prop (SSDATA (val), SBYTES (val), 1);
}
if (NILP (val))
{
if (strcmp (boolean_properties[i], keystr) == 0)
{
const char *str = INTEGERP (val) ? (XINT (val) ? "true" : "false")
- : SYMBOLP (val) ? (const char *) SDATA (SYMBOL_NAME (val))
+ : SYMBOLP (val) ? SSDATA (SYMBOL_NAME (val))
: "true";
if (strcmp ("false", str) == 0 || strcmp ("False", str) == 0
if (EQ (key, QCname))
{
CHECK_STRING (val);
- font_parse_name ((char *) SDATA (val), spec);
+ font_parse_name (SSDATA (val), spec);
font_put_extra (spec, key, val);
}
else
{
if (NILP (fold_wildcards))
return font_name;
- strcpy (name, (char *) SDATA (font_name));
+ strcpy (name, SSDATA (font_name));
goto done;
}
pixel_size = XFONT_OBJECT (font)->pixel_size;
if (fontset >= 0)
name = fontset_ascii (fontset);
- font_object = font_open_by_name (f, (char *) SDATA (name));
+ font_object = font_open_by_name (f, SSDATA (name));
}
else if (FONT_OBJECT_P (name))
font_object = name;
return;
if (STRINGP (AREF (Vfont_log_deferred, 0)))
{
- char *str = (char *) SDATA (AREF (Vfont_log_deferred, 0));
+ char *str = SSDATA (AREF (Vfont_log_deferred, 0));
ASET (Vfont_log_deferred, 0, Qnil);
font_add_log (str, AREF (Vfont_log_deferred, 1),
{
Vfont_log = egetenv ("EMACS_FONT_LOG") ? Qnil : Qt;
}
-
the corresponding regular expression. */
static Lisp_Object Vcached_fontset_data;
-#define CACHED_FONTSET_NAME ((char *) SDATA (XCAR (Vcached_fontset_data)))
+#define CACHED_FONTSET_NAME SSDATA (XCAR (Vcached_fontset_data))
#define CACHED_FONTSET_REGEX (XCDR (Vcached_fontset_data))
/* If fontset name PATTERN contains any wild card, return regular
static Lisp_Object
fontset_pattern_regexp (Lisp_Object pattern)
{
- if (!strchr ((char *) SDATA (pattern), '*')
- && !strchr ((char *) SDATA (pattern), '?'))
+ if (!strchr (SSDATA (pattern), '*')
+ && !strchr (SSDATA (pattern), '?'))
/* PATTERN does not contain any wild cards. */
return Qnil;
if (!CONSP (Vcached_fontset_data)
- || strcmp ((char *) SDATA (pattern), CACHED_FONTSET_NAME))
+ || strcmp (SSDATA (pattern), CACHED_FONTSET_NAME))
{
/* We must at first update the cached data. */
unsigned char *regex, *p0, *p1;
*p1++ = '$';
*p1++ = 0;
- Vcached_fontset_data = Fcons (build_string ((char *) SDATA (pattern)),
+ Vcached_fontset_data = Fcons (build_string (SSDATA (pattern)),
build_string ((char *) regex));
}
if (STRINGP (regexp)
? (fast_string_match (regexp, name) < 0)
- : strcmp ((char *) SDATA (pattern), (char *) SDATA (name)))
+ : strcmp (SSDATA (pattern), SSDATA (name)))
continue;
val = Fcons (Fcopy_sequence (FONTSET_NAME (fontset)), val);
char xlfd[256];
int len;
- if (font_parse_xlfd ((char *) SDATA (name), font_spec) < 0)
+ if (font_parse_xlfd (SSDATA (name), font_spec) < 0)
error ("Fontset name must be in XLFD format");
short_name = AREF (font_spec, FONT_REGISTRY_INDEX);
- if (strncmp ((char *) SDATA (SYMBOL_NAME (short_name)), "fontset-", 8)
+ if (strncmp (SSDATA (SYMBOL_NAME (short_name)), "fontset-", 8)
|| SBYTES (SYMBOL_NAME (short_name)) < 9)
error ("Registry field of fontset name must be \"fontset-*\"");
Vfontset_alias_alist = Fcons (Fcons (name, SYMBOL_NAME (short_name)),
CHECK_STRING (string);
- geometry = XParseGeometry ((char *) SDATA (string),
+ geometry = XParseGeometry (SSDATA (string),
&x, &y, &width, &height);
result = Qnil;
if (geometry & XValue)
#endif
}
-
if (cache_for == FTFONT_CACHE_FOR_FACE
? ! cache_data->ft_face : ! cache_data->fc_charset)
{
- char *filename = (char *) SDATA (XCAR (key));
+ char *filename = SSDATA (XCAR (key));
int index = XINT (XCDR (key));
if (cache_for == FTFONT_CACHE_FOR_FACE)
static int
ftfont_get_charset (Lisp_Object registry)
{
- char *str = (char *) SDATA (SYMBOL_NAME (registry));
+ char *str = SSDATA (SYMBOL_NAME (registry));
char *re = alloca (SBYTES (SYMBOL_NAME (registry)) * 2 + 1);
Lisp_Object regexp;
int i, j;
flt_font_ft.flt_font.family = Mnil;
else
flt_font_ft.flt_font.family
- = msymbol ((char *) SDATA (Fdowncase (SYMBOL_NAME (family))));
+ = msymbol (SSDATA (Fdowncase (SYMBOL_NAME (family))));
}
flt_font_ft.flt_font.x_ppem = ft_face->size->metrics.x_ppem;
flt_font_ft.flt_font.y_ppem = ft_face->size->metrics.y_ppem;
ftfont_driver.type = Qfreetype;
register_font_driver (&ftfont_driver, NULL);
}
-
(x509_cred,
SDATA (trustfile),
file_format);
-
+
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
}
(x509_cred,
SDATA (keyfile),
file_format);
-
+
if (ret < GNUTLS_E_SUCCESS)
return gnutls_make_error (ret);
}
if (STRINGP (priority_string))
{
- priority_string_ptr = (char*) SDATA (priority_string);
+ priority_string_ptr = SSDATA (priority_string);
GNUTLS_LOG2 (1, max_log_level, "got non-default priority string:",
priority_string_ptr);
}
GNUTLS_LOG2 (1, max_log_level, "using default priority string:",
priority_string_ptr);
}
-
+
GNUTLS_LOG (1, max_log_level, "setting the priority string");
ret = gnutls_priority_set_direct (state,
#define FRAME_TOTAL_PIXEL_WIDTH(f) \
(FRAME_PIXEL_WIDTH (f) + FRAME_TOOLBAR_WIDTH (f))
-/* Avoid "differ in sign" warnings */
-#define SSDATA(x) ((char *) SDATA (x))
-
#ifndef HAVE_GTK_WIDGET_SET_HAS_WINDOW
#define gtk_widget_set_has_window(w, b) \
(gtk_fixed_set_has_window (GTK_FIXED (w), b))
}
#endif /* USE_GTK */
-
{
if (dpyinfo->bitmaps[id].refcount
&& dpyinfo->bitmaps[id].file
- && !strcmp (dpyinfo->bitmaps[id].file, (char *) SDATA (file)))
+ && !strcmp (dpyinfo->bitmaps[id].file, SSDATA (file)))
{
++dpyinfo->bitmaps[id].refcount;
return id + 1;
return -1;
emacs_close (fd);
- filename = (char *) SDATA (found);
+ filename = SSDATA (found);
result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
filename, &width, &height, &bitmap, &xhot, &yhot);
init_image (void)
{
}
-
/* Try to make one from caption and key. */
Lisp_Object key = PROP (TOOL_BAR_ITEM_KEY);
Lisp_Object capt = PROP (TOOL_BAR_ITEM_CAPTION);
- const char *label = SYMBOLP (key) ? (char *) SDATA (SYMBOL_NAME (key)) : "";
- const char *caption = STRINGP (capt) ? (char *) SDATA (capt) : "";
+ const char *label = SYMBOLP (key) ? SSDATA (SYMBOL_NAME (key)) : "";
+ const char *caption = STRINGP (capt) ? SSDATA (capt) : "";
EMACS_INT max_lbl = 2 * tool_bar_max_label_size;
char *buf = (char *) xmalloc (max_lbl + 1);
Lisp_Object new_lbl;
}
}
}
-
#define SCHARS(string) (XSTRING (string)->size + 0)
#define SBYTES(string) (STRING_BYTES (XSTRING (string)) + 0)
+/* Avoid "differ in sign" warnings. */
+#define SSDATA(x) ((char *) SDATA (x))
+
#define STRING_SET_CHARS(string, newsize) \
(XSTRING (string)->size = (newsize))
/* Macros we use to define forwarded Lisp variables.
These are used in the syms_of_FILENAME functions.
-
+
An ordinary (not in buffer_defaults, per-buffer, or per-keyboard)
lisp variable is actually a field in `struct emacs_globals'. The
field's name begins with "f_", which is a convention enforced by
#ifdef DOS_NT
fmode = "rb";
#endif /* DOS_NT */
- stat ((char *)SDATA (efound), &s1);
+ stat (SSDATA (efound), &s1);
SSET (efound, SBYTES (efound) - 1, 0);
- result = stat ((char *)SDATA (efound), &s2);
+ result = stat (SSDATA (efound), &s2);
SSET (efound, SBYTES (efound) - 1, 'c');
if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime)
#ifdef WINDOWSNT
emacs_close (fd);
efound = ENCODE_FILE (found);
- stream = fopen ((char *) SDATA (efound), fmode);
+ stream = fopen (SSDATA (efound), fmode);
#else /* not WINDOWSNT */
stream = fdopen (fd, fmode);
#endif /* not WINDOWSNT */
Qrehash_threshold = intern_c_string ("rehash-threshold");
staticpro (&Qrehash_threshold);
}
-
#endif
pane_string = (NILP (pane_name)
- ? "" : (char *) SDATA (pane_name));
+ ? "" : SSDATA (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)
{
if (STRINGP (wv->lname))
{
- wv->name = (char *) SDATA (wv->lname);
+ wv->name = SSDATA (wv->lname);
/* Ignore the @ that means "separate pane".
This is a kludge, but this isn't worth more time. */
}
if (STRINGP (wv->lkey))
- wv->key = (char *) SDATA (wv->lkey);
+ wv->key = SSDATA (wv->lkey);
if (wv->contents)
update_submenu_strings (wv->contents);
defsubr (&Sx_popup_menu);
}
-
/* if (submenu && strcmp (submenuTitle, SDATA (string)))
continue; */
- wv->name = (char *) SDATA (string);
+ wv->name = SSDATA (string);
update_submenu_strings (wv->contents);
wv = wv->next;
}
strncpy (previous_strings[i/4], SDATA (string), 10);
wv = xmalloc_widget_value ();
- wv->name = (char *) SDATA (string);
+ wv->name = SSDATA (string);
wv->value = 0;
wv->enabled = 1;
wv->button_type = BUTTON_TYPE_NONE;
}
#endif
pane_string = (NILP (pane_name)
- ? "" : (char *) SDATA (pane_name));
+ ? "" : SSDATA (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)
prev_wv->next = wv;
else
save_wv->contents = wv;
- wv->name = (char *) SDATA (item_name);
+ wv->name = SSDATA (item_name);
if (!NILP (descrip))
- wv->key = (char *) SDATA (descrip);
+ wv->key = SSDATA (descrip);
wv->value = 0;
/* If this item has a null value,
make the call_data null so that it won't display a box
title = ENCODE_MENU_STRING (title);
#endif
- wv_title->name = (char *) SDATA (title);
+ wv_title->name = SSDATA (title);
wv_title->enabled = NO;
wv_title->button_type = BUTTON_TYPE_NONE;
wv_title->help = Qnil;
helpObj = TOOLPROP (TOOL_BAR_ITEM_HELP);
if (NILP (helpObj))
helpObj = TOOLPROP (TOOL_BAR_ITEM_CAPTION);
- helpText = NILP (helpObj) ? "" : (char *)SDATA (helpObj);
+ helpText = NILP (helpObj) ? "" : SSDATA (helpObj);
/* Ignore invalid image specifications. */
if (!valid_image_p (image))
max_input_desc = fd;
break;
}
-
+
}
}
if (! NILP (Vlocale_coding_system))
string = (code_convert_string_norecord
(string, Vlocale_coding_system, 0));
- c1 = STRING_CHAR ((char *) SDATA (string));
+ c1 = STRING_CHAR (SSDATA (string));
c2 = DOWNCASE (c1);
if (c1 != c2)
Faset (string, make_number (0), make_number (c2));
port = Fformat_network_address (Fplist_get (p->childp, QClocal), Qnil);
sprintf (tembuf, "(network %s server on %s)\n",
(DATAGRAM_CHAN_P (p->infd) ? "datagram" : "stream"),
- (STRINGP (port) ? (char *)SDATA (port) : "?"));
+ (STRINGP (port) ? SSDATA (port) : "?"));
insert_string (tembuf);
}
else if (NETCONN1_P (p))
host = Fformat_network_address (Fplist_get (p->childp, QCremote), Qnil);
sprintf (tembuf, "(network %s connection to %s)\n",
(DATAGRAM_CHAN_P (p->infd) ? "datagram" : "stream"),
- (STRINGP (host) ? (char *)SDATA (host) : "?"));
+ (STRINGP (host) ? SSDATA (host) : "?"));
insert_string (tembuf);
}
else if (SERIALCONN1_P (p))
CHECK_SYMBOL (opt);
- name = (char *) SDATA (SYMBOL_NAME (opt));
+ name = SSDATA (SYMBOL_NAME (opt));
for (sopt = socket_options; sopt->name; sopt++)
if (strcmp (name, sopt->name) == 0)
break;
memset (devname, 0, sizeof devname);
if (STRINGP (val))
{
- char *arg = (char *) SDATA (val);
+ char *arg = SSDATA (val);
int len = min (strlen (arg), IFNAMSIZ);
memcpy (devname, arg, len);
}
record_unwind_protect (make_serial_process_unwind, proc);
p = XPROCESS (proc);
- fd = serial_open ((char*) SDATA (port));
+ fd = serial_open (SSDATA (port));
p->infd = fd;
p->outfd = fd;
if (fd > max_process_desc)
/* Attempt to interpret host as numeric inet address */
{
unsigned long numeric_addr;
- numeric_addr = inet_addr ((char *) SDATA (host));
+ numeric_addr = inet_addr (SSDATA (host));
if (numeric_addr == -1)
error ("Unknown host \"%s\"", SDATA (host));
#ifdef HAVE_GNUTLS
if (XPROCESS (proc)->gnutls_p)
rv = emacs_gnutls_write (outfd,
- XPROCESS (proc),
+ XPROCESS (proc),
(char *) buf, this);
else
#endif
defsubr (&Slist_system_processes);
defsubr (&Sprocess_attributes);
}
-
else
re_set_whitespace_regexp (NULL);
- val = (char *) re_compile_pattern ((char *) SDATA (pattern),
+ val = (char *) re_compile_pattern (SSDATA (pattern),
SBYTES (pattern), &cp->buf);
/* If the compiled pattern hard codes some of the contents of the
immediate_quit = 1;
re_match_object = string;
- val = re_search (bufp, (char *) SDATA (string),
+ val = re_search (bufp, SSDATA (string),
SBYTES (string), pos_byte,
SBYTES (string) - pos_byte,
(NILP (Vinhibit_changing_match_data)
immediate_quit = 1;
re_match_object = string;
- val = re_search (bufp, (char *) SDATA (string),
+ val = re_search (bufp, SSDATA (string),
SBYTES (string), 0,
SBYTES (string), 0);
immediate_quit = 0;
immediate_quit = 1;
re_match_object = string;
- val = re_search (bufp, (char *) SDATA (string),
+ val = re_search (bufp, SSDATA (string),
SBYTES (string), 0,
SBYTES (string), 0);
immediate_quit = 0;
if (multibyte == STRING_MULTIBYTE (string))
{
- raw_pattern = (unsigned char *) SDATA (string);
+ raw_pattern = SDATA (string);
raw_pattern_size = SCHARS (string);
raw_pattern_size_byte = SBYTES (string);
}
defsubr (&Sset_match_data);
defsubr (&Sregexp_quote);
}
-
if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display))
acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c);
buf[0] = '[';
- str = STRINGP (acronym) ? (char *) SDATA (acronym) : "";
+ str = STRINGP (acronym) ? SSDATA (acronym) : "";
for (len = 0; len < 6 && str[len] && ASCII_BYTE_P (str[len]); len++)
buf[1 + len] = str[len];
buf[1 + len] = ']';
tty->mouse_highlight.mouse_face_window = Qnil;
#endif
-
+
#ifndef DOS_NT
set_tty_hooks (terminal);
encode_terminal_src = NULL;
encode_terminal_dst = NULL;
}
-
BLOCK_INPUT;
result = x_text_icon (f,
- (char *) SDATA ((!NILP (f->icon_name)
- ? f->icon_name
- : !NILP (f->title)
- ? f->title
- : f->name)));
+ SSDATA ((!NILP (f->icon_name)
+ ? f->icon_name
+ : !NILP (f->title)
+ ? f->title
+ : f->name)));
if (result)
{
Elsewhere we specify the window name for the window manager. */
{
- char *str = (char *) SDATA (Vx_resource_name);
+ char *str = SSDATA (Vx_resource_name);
f->namebuf = (char *) xmalloc (strlen (str) + 1);
strcpy (f->namebuf, str);
}
? IconicState
: NormalState));
- x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name)
- ? f->icon_name
- : f->name)));
+ x_text_icon (f, SSDATA ((!NILP (f->icon_name)
+ ? f->icon_name
+ : f->name)));
#endif
UNBLOCK_INPUT;
validate_x_resource_name ();
dpyinfo = w32_term_init (name, (unsigned char *)0,
- (char *) SDATA (Vx_resource_name));
+ SSDATA (Vx_resource_name));
if (dpyinfo == 0)
error ("Cannot connect to server %s", SDATA (name));
add_system_logical_colors_to_map (&Vw32_color_map);
if (! NILP (xrm_string))
- xrm_option = (unsigned char *) SDATA (xrm_string);
+ xrm_option = SDATA (xrm_string);
else
xrm_option = (unsigned char *) 0;
/* 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 *) SDATA (Vx_resource_name));
+ SSDATA (Vx_resource_name));
if (dpyinfo == 0)
{
code_convert_string_norecord (make_unibyte_string (errstr,
strlen (errstr)),
Vlocale_coding_system, 0);
- errstr = (char *)SDATA (decoded);
+ errstr = SSDATA (decoded);
}
error ("ShellExecute failed: %s", errstr);
}
{
return GetLastError ();
}
-
string = AREF (items, i + 1);
if (NILP (string))
break;
- wv->name = (char *) SDATA (string);
+ wv->name = SSDATA (string);
update_submenu_strings (wv->contents);
wv = wv->next;
}
break;
wv = xmalloc_widget_value ();
- wv->name = (char *) SDATA (string);
+ wv->name = SSDATA (string);
wv->value = 0;
wv->enabled = 1;
wv->button_type = BUTTON_TYPE_NONE;
}
pane_string = (NILP (pane_name)
- ? "" : (char *) SDATA (pane_name));
+ ? "" : SSDATA (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)
prev_wv->next = wv;
else
save_wv->contents = wv;
- wv->name = (char *) SDATA (item_name);
+ wv->name = SSDATA (item_name);
if (!NILP (descrip))
- wv->key = (char *) SDATA (descrip);
+ wv->key = SSDATA (descrip);
wv->value = 0;
/* Use the contents index as call_data, since we are
restricted to 16-bits. */
else if (STRING_MULTIBYTE (title))
title = ENCODE_SYSTEM (title);
- wv_title->name = (char *) SDATA (title);
+ wv_title->name = SSDATA (title);
wv_title->enabled = TRUE;
wv_title->title = TRUE;
wv_title->button_type = BUTTON_TYPE_NONE;
pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME);
prefix = AREF (menu_items, MENU_ITEMS_PANE_PREFIX);
pane_string = (NILP (pane_name)
- ? "" : (char *) SDATA (pane_name));
+ ? "" : SSDATA (pane_name));
prev_wv = xmalloc_widget_value ();
prev_wv->value = pane_string;
if (keymaps && !NILP (prefix))
prev_wv->next = wv;
wv->name = (char *) button_names[nb_buttons];
if (!NILP (descrip))
- wv->key = (char *) SDATA (descrip);
- wv->value = (char *) SDATA (item_name);
+ wv->key = SSDATA (descrip);
+ wv->value = SSDATA (item_name);
wv->call_data = (void *) &AREF (menu_items, i);
wv->enabled = !NILP (enable);
wv->help = Qnil;
unicode_append_menu = (AppendMenuW_Proc) GetProcAddress (user32, "AppendMenuW");
unicode_message_box = (MessageBoxW_Proc) GetProcAddress (user32, "MessageBoxW");
}
-
glyph->u.glyphless.ch)
: XCHAR_TABLE (Vglyphless_char_display)->extras[0]);
if (STRINGP (acronym))
- str = (char *) SDATA (acronym);
+ str = SSDATA (acronym);
}
}
else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE)
staticpro (&last_mouse_motion_frame);
last_mouse_motion_frame = Qnil;
}
-
w,
((BUFFERP (w->buffer)
&& STRINGP (XBUFFER (w->buffer)->name))
- ? (char *) SDATA (XBUFFER (w->buffer)->name)
+ ? SSDATA (XBUFFER (w->buffer)->name)
: "no buffer"),
buffer);
}
case 'F':
/* %F displays the frame name. */
if (!NILP (f->title))
- return (char *) SDATA (f->title);
+ return SSDATA (f->title);
if (f->explicit_name || ! FRAME_WINDOW_P (f))
- return (char *) SDATA (f->name);
+ return SSDATA (f->name);
return "Emacs";
case 'f':
if (STRINGP (obj))
{
*string = obj;
- return (char *) SDATA (obj);
+ return SSDATA (obj);
}
else
return "";
{
if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display))
acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c);
- str = STRINGP (acronym) ? (char *) SDATA (acronym) : "";
+ str = STRINGP (acronym) ? SSDATA (acronym) : "";
}
else
{
else
upper_xoff = (width - metrics_upper.width) / 2;
}
-
+
/* +5 is for horizontal bars of a box plus 1-pixel spaces at
top, bottom, and between upper and lower strings. */
height = (metrics_upper.ascent + metrics_upper.descent
#endif
}
#endif /* ! WINDOWSNT */
-
#if defined HAVE_X_I18N
char *fontsetname = xic_create_fontsetname (SDATA (xlfd), motif);
#else
- char *fontsetname = (char *) SDATA (xlfd);
+ char *fontsetname = SSDATA (xlfd);
#endif
sprintf (line, "%s.pane.menubar*font%s: %s",
myname, suffix, fontsetname);
myname, popup_path, suffix, fontsetname);
XrmPutLineResource (&rdb, line);
changed_p = 1;
- if (fontsetname != (char *) SDATA (xlfd))
+ if (fontsetname != SSDATA (xlfd))
xfree (fontsetname);
}
}
defsubr (&Sx_family_fonts);
#endif
}
-
{
GdkPixbuf *pixbuf;
GError *err = NULL;
- char *filename = (char *) SDATA (found);
+ char *filename = SSDATA (found);
BLOCK_INPUT;
pixbuf = gdk_pixbuf_new_from_file (filename, &err);
BLOCK_INPUT;
if (NILP (arg))
result = x_text_icon (f,
- (char *) SDATA ((!NILP (f->icon_name)
- ? f->icon_name
- : f->name)));
+ SSDATA ((!NILP (f->icon_name)
+ ? f->icon_name
+ : f->name)));
else
result = x_bitmap_icon (f, arg);
BLOCK_INPUT;
result = x_text_icon (f,
- (char *) SDATA ((!NILP (f->icon_name)
- ? f->icon_name
- : !NILP (f->title)
- ? f->title
- : f->name)));
+ SSDATA ((!NILP (f->icon_name)
+ ? f->icon_name
+ : !NILP (f->title)
+ ? f->title
+ : f->name)));
if (result)
{
#ifdef USE_GTK
gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
- (char *) SDATA (encoded_name));
+ SSDATA (encoded_name));
#else /* not USE_GTK */
XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_name,
FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
8, PropModeReplace,
- (char *) SDATA (encoded_name),
+ SSDATA (encoded_name),
SBYTES (encoded_name));
#endif /* not USE_GTK */
FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_icon_name,
FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
8, PropModeReplace,
- (char *) SDATA (encoded_icon_name),
+ SSDATA (encoded_icon_name),
SBYTES (encoded_icon_name));
if (do_free_icon_value)
Elsewhere we specify the window name for the window manager. */
{
- char *str = (char *) SDATA (Vx_resource_name);
+ char *str = SSDATA (Vx_resource_name);
f->namebuf = (char *) xmalloc (strlen (str) + 1);
strcpy (f->namebuf, str);
}
validate_x_resource_name ();
- class_hints.res_name = (char *) SDATA (Vx_resource_name);
- class_hints.res_class = (char *) SDATA (Vx_resource_class);
+ class_hints.res_name = SSDATA (Vx_resource_name);
+ class_hints.res_class = SSDATA (Vx_resource_class);
XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints);
#ifdef HAVE_X_I18N
validate_x_resource_name ();
- class_hints.res_name = (char *) SDATA (Vx_resource_name);
- class_hints.res_class = (char *) SDATA (Vx_resource_class);
+ class_hints.res_name = SSDATA (Vx_resource_name);
+ class_hints.res_class = SSDATA (Vx_resource_class);
XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints);
/* The menubar is part of the ordinary display;
: NormalState));
#endif
- x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name)
- ? f->icon_name
- : f->name)));
+ x_text_icon (f, SSDATA ((!NILP (f->icon_name)
+ ? f->icon_name
+ : f->name)));
UNBLOCK_INPUT;
}
validate_x_resource_name ();
dpyinfo = x_term_init (name, (char *)0,
- (char *) SDATA (Vx_resource_name));
+ SSDATA (Vx_resource_name));
if (dpyinfo == 0)
error ("Cannot connect to X server %s", SDATA (name));
#endif
if (! NILP (xrm_string))
- xrm_option = (unsigned char *) SDATA (xrm_string);
+ xrm_option = SDATA (xrm_string);
else
xrm_option = (unsigned char *) 0;
/* 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 *) SDATA (Vx_resource_name));
+ SSDATA (Vx_resource_name));
if (dpyinfo == 0)
{
script = Qnil;
}
}
-
+
BLOCK_INPUT;
x_catch_errors (display);
if (STRINGP (XCAR (alter))
&& ((r - name) + SBYTES (XCAR (alter))) < 256)
{
- strcpy (r, (char *) SDATA (XCAR (alter)));
+ strcpy (r, SSDATA (XCAR (alter)));
list = xfont_list_pattern (display, name, registry, script);
if (! NILP (list))
break;
ASET (font_object, FONT_TYPE_INDEX, Qx);
if (STRINGP (fullname))
{
- font_parse_xlfd ((char *) SDATA (fullname), font_object);
+ font_parse_xlfd (SSDATA (fullname), font_object);
ASET (font_object, FONT_NAME_INDEX, fullname);
}
else
xfont_driver.type = Qx;
register_font_driver (&xfont_driver, NULL);
}
-
apply_systemfont_to_dialog (Widget w)
{
const char *fn = xsettings_get_system_normal_font ();
- if (fn)
+ if (fn)
{
XrmDatabase db = XtDatabase (XtDisplay (w));
if (db)
string = XVECTOR (items)->contents[i + 1];
if (NILP (string))
break;
- wv->name = (char *) SDATA (string);
+ wv->name = SSDATA (string);
update_submenu_strings (wv->contents);
wv = wv->next;
}
break;
wv = xmalloc_widget_value ();
- wv->name = (char *) SDATA (string);
+ wv->name = SSDATA (string);
wv->value = 0;
wv->enabled = 1;
wv->button_type = BUTTON_TYPE_NONE;
}
#endif
pane_string = (NILP (pane_name)
- ? "" : (char *) SDATA (pane_name));
+ ? "" : SSDATA (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)
prev_wv->next = wv;
else
save_wv->contents = wv;
- wv->name = (char *) SDATA (item_name);
+ wv->name = SSDATA (item_name);
if (!NILP (descrip))
- wv->key = (char *) SDATA (descrip);
+ wv->key = SSDATA (descrip);
wv->value = 0;
/* If this item has a null value,
make the call_data null so that it won't display a box
title = ENCODE_MENU_STRING (title);
#endif
- wv_title->name = (char *) SDATA (title);
+ wv_title->name = SSDATA (title);
wv_title->enabled = TRUE;
wv_title->button_type = BUTTON_TYPE_NONE;
wv_title->help = Qnil;
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 *) SDATA (pane_name));
+ ? "" : SSDATA (pane_name));
prev_wv = xmalloc_widget_value ();
prev_wv->value = pane_string;
if (keymaps && !NILP (prefix))
prev_wv->next = wv;
wv->name = (char *) button_names[nb_buttons];
if (!NILP (descrip))
- wv->key = (char *) SDATA (descrip);
- wv->value = (char *) SDATA (item_name);
+ wv->key = SSDATA (descrip);
+ wv->value = SSDATA (item_name);
wv->call_data = (void *) &XVECTOR (menu_items)->contents[i];
wv->enabled = !NILP (enable);
wv->help = Qnil;
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 *) SDATA (pane_name));
+ ? "" : SSDATA (pane_name));
if (keymaps && !NILP (prefix))
pane_string++;
defsubr (&Sx_popup_dialog);
#endif
}
-
if (EQ (sym, QNULL)) return dpyinfo->Xatom_NULL;
if (!SYMBOLP (sym)) abort ();
- TRACE1 (" XInternAtom %s", (char *) SDATA (SYMBOL_NAME (sym)));
+ TRACE1 (" XInternAtom %s", SSDATA (SYMBOL_NAME (sym)));
BLOCK_INPUT;
- val = XInternAtom (display, (char *) SDATA (SYMBOL_NAME (sym)), False);
+ val = XInternAtom (display, SSDATA (SYMBOL_NAME (sym)), False);
UNBLOCK_INPUT;
return val;
}
else if (STRINGP (o))
{
BLOCK_INPUT;
- val = (long) XInternAtom (dpy, (char *) SDATA (o), False);
+ val = (long) XInternAtom (dpy, SSDATA (o), False);
UNBLOCK_INPUT;
}
else
else if (STRINGP (atom))
{
BLOCK_INPUT;
- x_atom = XInternAtom (FRAME_X_DISPLAY (f), (char *) SDATA (atom), False);
+ x_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (atom), False);
UNBLOCK_INPUT;
}
else
#include "termopts.h"
#include "xterm.h"
-/* Avoid "differ in sign" warnings */
-#define SSDATA(x) ((char *) SDATA (x))
-
/* This is the event used when SAVE_SESSION_EVENT occurs. */
static struct input_event emacs_event;
props[props_idx]->vals[2].value = NOSPLASH_OPT;
cwd = get_current_dir_name ();
- if (cwd)
+ if (cwd)
{
chdir_opt = xmalloc (strlen (CHDIR_OPT) + strlen (cwd) + 1);
strcpy (chdir_opt, CHDIR_OPT);
-1, -1, 1, 1,
CopyFromParent, CopyFromParent, CopyFromParent);
- class_hints.res_name = (char *) SDATA (Vx_resource_name);
- class_hints.res_class = (char *) SDATA (Vx_resource_class);
+ class_hints.res_name = SSDATA (Vx_resource_name);
+ class_hints.res_class = SSDATA (Vx_resource_class);
XSetClassHint (dpyinfo->display, w, &class_hints);
XStoreName (dpyinfo->display, w, class_hints.res_name);
SmcCloseConnection (smc_conn, 0, 0);
ice_connection_closed ();
}
-
+
return Qnil;
}
-
+
\f
/***********************************************************************
}
#endif /* HAVE_X_SM */
-
glyph->u.glyphless.ch)
: XCHAR_TABLE (Vglyphless_char_display)->extras[0]);
if (STRINGP (acronym))
- str = (char *) SDATA (acronym);
+ str = SSDATA (acronym);
}
}
else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE)
for (i = 0; i < actual_size; ++i)
{
Atom a = ((Atom*)tmp_data)[i];
- if (a == dpyinfo->Xatom_net_wm_state_maximized_horz)
+ if (a == dpyinfo->Xatom_net_wm_state_maximized_horz)
{
if (*size_state == FULLSCREEN_HEIGHT)
*size_state = FULLSCREEN_MAXIMIZED;
{
static char display_opt[] = "--display";
static char name_opt[] = "--name";
-
+
for (argc = 0; argc < NUM_ARGV; ++argc)
argv[argc] = 0;
}
#endif /* HAVE_X_WINDOWS */
-