diff options
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/callint.c | 3 | ||||
| -rw-r--r-- | src/callproc.c | 5 | ||||
| -rw-r--r-- | src/charset.c | 7 | ||||
| -rw-r--r-- | src/coding.c | 6 | ||||
| -rw-r--r-- | src/dispnew.c | 3 | ||||
| -rw-r--r-- | src/doc.c | 5 | ||||
| -rw-r--r-- | src/editfns.c | 9 | ||||
| -rw-r--r-- | src/emacs.c | 3 | ||||
| -rw-r--r-- | src/fileio.c | 4 | ||||
| -rw-r--r-- | src/filelock.c | 5 | ||||
| -rw-r--r-- | src/font.c | 29 | ||||
| -rw-r--r-- | src/fontset.c | 16 | ||||
| -rw-r--r-- | src/frame.c | 3 | ||||
| -rw-r--r-- | src/ftfont.c | 7 | ||||
| -rw-r--r-- | src/gnutls.c | 8 | ||||
| -rw-r--r-- | src/gtkutil.c | 4 | ||||
| -rw-r--r-- | src/image.c | 5 | ||||
| -rw-r--r-- | src/keyboard.c | 5 | ||||
| -rw-r--r-- | src/lisp.h | 5 | ||||
| -rw-r--r-- | src/lread.c | 7 | ||||
| -rw-r--r-- | src/menu.c | 7 | ||||
| -rw-r--r-- | src/nsmenu.m | 14 | ||||
| -rw-r--r-- | src/process.c | 19 | ||||
| -rw-r--r-- | src/search.c | 11 | ||||
| -rw-r--r-- | src/term.c | 5 | ||||
| -rw-r--r-- | src/w32fns.c | 27 | ||||
| -rw-r--r-- | src/w32menu.c | 19 | ||||
| -rw-r--r-- | src/w32term.c | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 13 | ||||
| -rw-r--r-- | src/xfaces.c | 5 | ||||
| -rw-r--r-- | src/xfns.c | 46 | ||||
| -rw-r--r-- | src/xfont.c | 7 | ||||
| -rw-r--r-- | src/xmenu.c | 23 | ||||
| -rw-r--r-- | src/xselect.c | 8 | ||||
| -rw-r--r-- | src/xsmfns.c | 14 | ||||
| -rw-r--r-- | src/xterm.c | 7 | 
37 files changed, 177 insertions, 199 deletions
| diff --git a/src/ChangeLog b/src/ChangeLog index 355376a886b..0c5c98eac2e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +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. diff --git a/src/callint.c b/src/callint.c index 4ac1acd4abc..33dee693a95 100644 --- a/src/callint.c +++ b/src/callint.c @@ -646,7 +646,7 @@ invoke it.  If KEYS is omitted or nil, the return value of  	  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++; @@ -974,4 +974,3 @@ a way to turn themselves off when a mouse command switches windows.  */);    defsubr (&Scall_interactively);    defsubr (&Sprefix_numeric_value);  } - diff --git a/src/callproc.c b/src/callproc.c index 4c17cecdced..bc4c6a2f20d 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1278,7 +1278,7 @@ getenv_internal_1 (const char *var, int varlen, char **value, int *valuelen,  	{  	  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;  	    } @@ -1310,7 +1310,7 @@ getenv_internal (const char *var, int varlen, char **value, int *valuelen,  	= Fframe_parameter (NILP (frame) ? selected_frame : frame, Qdisplay);        if (STRINGP (display))  	{ -	  *value    = (char *) SDATA (display); +	  *value    = SSDATA (display);  	  *valuelen = SBYTES (display);  	  return 1;  	} @@ -1594,4 +1594,3 @@ See `setenv' and `getenv'.  */);    defsubr (&Sgetenv_internal);    defsubr (&Scall_process_region);  } - diff --git a/src/charset.c b/src/charset.c index c37c33cd9fb..67315544e91 100644 --- a/src/charset.c +++ b/src/charset.c @@ -666,7 +666,7 @@ map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), Lisp_Object    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); @@ -1828,7 +1828,7 @@ encode_char (struct charset *charset, int 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 */ @@ -2295,7 +2295,7 @@ init_charset (void)  {    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\ @@ -2431,4 +2431,3 @@ the value may be a list of mnemonics.  */);  }  #endif /* emacs */ - diff --git a/src/coding.c b/src/coding.c index 4d47b28cf33..dc86112ee87 100644 --- a/src/coding.c +++ b/src/coding.c @@ -5380,9 +5380,9 @@ detect_coding_charset (struct coding_system *coding,    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; @@ -10827,7 +10827,7 @@ emacs_strerror (int error_number)        Lisp_Object dec = code_convert_string_norecord (build_string (str),  						      Vlocale_coding_system,  						      0); -      str = (char *) SDATA (dec); +      str = SSDATA (dec);      }    return str; diff --git a/src/dispnew.c b/src/dispnew.c index 061058b1465..80c55864b9a 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -312,7 +312,7 @@ add_window_display_history (struct window *w, char *msg, int paused_p)  	   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); @@ -6592,4 +6592,3 @@ If nil, never pre-empt redisplay.  */);        Vwindow_system_version = Qnil;      }  } - diff --git a/src/doc.c b/src/doc.c index 900deded25c..cc054938c44 100644 --- a/src/doc.c +++ b/src/doc.c @@ -126,7 +126,7 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)      }    else      { -      name = (char *) SDATA (file); +      name = SSDATA (file);      }    fd = emacs_open (name, O_RDONLY, 0); @@ -891,7 +891,7 @@ a new string, without any text properties, is returned.  */)  	    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 */ @@ -938,4 +938,3 @@ syms_of_doc (void)    defsubr (&Ssnarf_documentation);    defsubr (&Ssubstitute_command_keys);  } - diff --git a/src/editfns.c b/src/editfns.c index 0c4bf4f0d7e..7d70c0fee70 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1397,7 +1397,7 @@ const char *  get_system_name (void)  {    if (STRINGP (Vsystem_name)) -    return (const char *) SDATA (Vsystem_name); +    return SSDATA (Vsystem_name);    else      return "";  } @@ -1406,7 +1406,7 @@ const char *  get_operating_system_release (void)  {    if (STRINGP (Voperating_system_release)) -    return (char *) SDATA (Voperating_system_release); +    return SSDATA (Voperating_system_release);    else      return "";  } @@ -1814,7 +1814,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE)  */)        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)); @@ -2003,7 +2003,7 @@ If TZ is t, use Universal Time.  */)    else      {        CHECK_STRING (tz); -      tzstring = (char *) SDATA (tz); +      tzstring = SSDATA (tz);      }    set_time_zone_rule (tzstring); @@ -4677,4 +4677,3 @@ functions if all the text being accessed has this property.  */);    defsubr (&Ssave_restriction);    defsubr (&Stranspose_regions);  } - diff --git a/src/emacs.c b/src/emacs.c index 304f87ea90e..70dd76d3a3b 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2205,7 +2205,7 @@ synchronize_locale (int category, Lisp_Object *plocale, Lisp_Object desired_loca      {        *plocale = desired_locale;        setlocale (category, (STRINGP (desired_locale) -			    ? (char *) SDATA (desired_locale) +			    ? SSDATA (desired_locale)  			    : ""));      }  } @@ -2490,4 +2490,3 @@ libraries; only those already known by Emacs will be loaded.  */);    /* Make sure IS_DAEMON starts up as false.  */    daemon_pipe[1] = 0;  } - diff --git a/src/fileio.c b/src/fileio.c index b12f92b7b8a..ca4412cbb6b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -194,7 +194,7 @@ report_file_error (const char *string, Lisp_Object data)  	  {  	    int c; -	    str = (char *) SDATA (errstring); +	    str = SSDATA (errstring);  	    c = STRING_CHAR (str);  	    Faset (errstring, make_number (0), make_number (DOWNCASE (c)));  	  } @@ -2558,7 +2558,7 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,      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  } diff --git a/src/filelock.c b/src/filelock.c index bae6f58f024..a46d7ecfaa0 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -358,11 +358,11 @@ lock_file_1 (char *lfname, int force)    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) @@ -738,4 +738,3 @@ syms_of_filelock (void)    defsubr (&Sfile_locked_p);  #endif  } - diff --git a/src/font.c b/src/font.c index fa8e18f0100..9ef609d16fa 100644 --- a/src/font.c +++ b/src/font.c @@ -1190,7 +1190,7 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)  	  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] == '*') @@ -1207,7 +1207,7 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)  		}  	    }  	  else -	    f[j] = (char *) SDATA (val), len += SBYTES (val) + 1; +	    f[j] = SSDATA (val), len += SBYTES (val) + 1;  	}      } @@ -1220,7 +1220,7 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)        else  	{  	  val = SYMBOL_NAME (val); -	  f[j] = (char *) SDATA (val), len += SBYTES (val) + 1; +	  f[j] = SSDATA (val), len += SBYTES (val) + 1;  	}      } @@ -1703,7 +1703,7 @@ font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Objec      {        CHECK_STRING (family);        len = SBYTES (family); -      p0 = (char *) SDATA (family); +      p0 = SSDATA (family);        p1 = strchr (p0, '-');        if (p1)  	{ @@ -1722,7 +1722,7 @@ font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Objec        /* Convert "XXX" and "XXX*" to "XXX*-*".  */        CHECK_STRING (registry);        len = SBYTES (registry); -      p0 = (char *) SDATA (registry); +      p0 = SSDATA (registry);        p1 = strchr (p0, '-');        if (! p1)  	{ @@ -1855,7 +1855,7 @@ otf_open (file)      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);      } @@ -3000,7 +3000,7 @@ font_spec_from_name (Lisp_Object font_name)    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); @@ -3158,7 +3158,7 @@ font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c)    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;      } @@ -3189,7 +3189,7 @@ font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c)    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))      { @@ -3620,7 +3620,7 @@ font_filter_properties (Lisp_Object font,          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 @@ -3890,7 +3890,7 @@ usage: (font-spec ARGS...)  */)        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 @@ -4250,7 +4250,7 @@ the consecutive wildcards are folded to one.  */)  	{  	  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; @@ -4913,7 +4913,7 @@ If the named font is not yet loaded, return nil.  */)        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; @@ -4991,7 +4991,7 @@ font_add_log (const char *action, Lisp_Object arg, Lisp_Object result)      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), @@ -5269,4 +5269,3 @@ init_font (void)  {    Vfont_log = egetenv ("EMACS_FONT_LOG") ? Qnil : Qt;  } - diff --git a/src/fontset.c b/src/fontset.c index be8ff1bd0eb..41a8a567a9a 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1049,7 +1049,7 @@ make_fontset_for_ascii_face (FRAME_PTR f, int base_fontset_id, struct face *face     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 @@ -1058,13 +1058,13 @@ static Lisp_Object Vcached_fontset_data;  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; @@ -1115,7 +1115,7 @@ fontset_pattern_regexp (Lisp_Object pattern)        *p1++ = '$';        *p1++ = 0; -      Vcached_fontset_data = Fcons (build_string ((char *) SDATA (pattern)), +      Vcached_fontset_data = Fcons (build_string (SSDATA (pattern)),  				    build_string ((char *) regex));      } @@ -1225,7 +1225,7 @@ list_fontsets (FRAME_PTR f, Lisp_Object pattern, int size)        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); @@ -1651,10 +1651,10 @@ FONT-SPEC is a vector, a cons, or a string.  See the documentation of        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)), diff --git a/src/frame.c b/src/frame.c index 89f58ba6a68..5cbdcf15abf 100644 --- a/src/frame.c +++ b/src/frame.c @@ -4037,7 +4037,7 @@ On Nextstep, this just calls `ns-parse-geometry'.  */)    CHECK_STRING (string); -  geometry = XParseGeometry ((char *) SDATA (string), +  geometry = XParseGeometry (SSDATA (string),  			     &x, &y, &width, &height);    result = Qnil;    if (geometry & XValue) @@ -4637,4 +4637,3 @@ automatically.  See also `mouse-autoselect-window'.  */);  #endif  } - diff --git a/src/ftfont.c b/src/ftfont.c index 372160dc0f6..e3edb45b14a 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -392,7 +392,7 @@ ftfont_lookup_cache (Lisp_Object key, enum ftfont_cache_for cache_for)    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) @@ -555,7 +555,7 @@ ftfont_get_cache (FRAME_PTR f)  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; @@ -2453,7 +2453,7 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font,        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; @@ -2675,4 +2675,3 @@ syms_of_ftfont (void)    ftfont_driver.type = Qfreetype;    register_font_driver (&ftfont_driver, NULL);  } - diff --git a/src/gnutls.c b/src/gnutls.c index 1872d6cc340..07db43db2f1 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -448,7 +448,7 @@ one trustfile (usually a CA bundle).  */)                  (x509_cred,                   SDATA (trustfile),                   file_format); -               +                if (ret < GNUTLS_E_SUCCESS)                  return gnutls_make_error (ret);              } @@ -470,7 +470,7 @@ one trustfile (usually a CA bundle).  */)                  (x509_cred,                   SDATA (keyfile),                   file_format); -               +                if (ret < GNUTLS_E_SUCCESS)                  return gnutls_make_error (ret);              } @@ -497,7 +497,7 @@ one trustfile (usually a CA bundle).  */)    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);      } @@ -506,7 +506,7 @@ one trustfile (usually a CA bundle).  */)        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, diff --git a/src/gtkutil.c b/src/gtkutil.c index 9d55f52c9f9..8147954957f 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -46,9 +46,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */  #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)) @@ -4565,4 +4562,3 @@ xg_initialize (void)  }  #endif /* USE_GTK */ - diff --git a/src/image.c b/src/image.c index 8f438e26015..542968d2a76 100644 --- a/src/image.c +++ b/src/image.c @@ -350,7 +350,7 @@ x_create_bitmap_from_file (struct frame *f, Lisp_Object file)      {        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; @@ -363,7 +363,7 @@ x_create_bitmap_from_file (struct frame *f, Lisp_Object file)      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); @@ -8883,4 +8883,3 @@ void  init_image (void)  {  } - diff --git a/src/keyboard.c b/src/keyboard.c index 1d09c084f81..5da1310d541 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8177,8 +8177,8 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)        /* 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; @@ -12298,4 +12298,3 @@ mark_kboards (void)        }    }  } - diff --git a/src/lisp.h b/src/lisp.h index 726b7671f4a..64c0b2332e3 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -635,6 +635,9 @@ extern Lisp_Object make_number (EMACS_INT);  #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)) @@ -1844,7 +1847,7 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);  /* 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 diff --git a/src/lread.c b/src/lread.c index 60a2778dbbc..0baab54a00c 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1082,9 +1082,9 @@ Return t if the file exists and loads successfully.  */)  #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) @@ -1125,7 +1125,7 @@ Return t if the file exists and loads successfully.  */)  #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 */ @@ -4404,4 +4404,3 @@ to load.  See also `load-dangerous-libraries'.  */);    Qrehash_threshold = intern_c_string ("rehash-threshold");    staticpro (&Qrehash_threshold);  } - diff --git a/src/menu.c b/src/menu.c index 24df935eef6..53cd721a1e8 100644 --- a/src/menu.c +++ b/src/menu.c @@ -695,7 +695,7 @@ digest_single_submenu (int start, int end, int top_level_items)  #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) @@ -847,7 +847,7 @@ update_submenu_strings (widget_value *first_wv)      {        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.  */ @@ -860,7 +860,7 @@ update_submenu_strings (widget_value *first_wv)          }        if (STRINGP (wv->lkey)) -        wv->key = (char *) SDATA (wv->lkey); +        wv->key = SSDATA (wv->lkey);        if (wv->contents)          update_submenu_strings (wv->contents); @@ -1353,4 +1353,3 @@ syms_of_menu (void)    defsubr (&Sx_popup_menu);  } - diff --git a/src/nsmenu.m b/src/nsmenu.m index fb402845cf1..44621f0c2fd 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -355,7 +355,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)  /*           if (submenu && strcmp (submenuTitle, SDATA (string)))                 continue; */ -	  wv->name = (char *) SDATA (string); +	  wv->name = SSDATA (string);            update_submenu_strings (wv->contents);  	  wv = wv->next;  	} @@ -444,7 +444,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)              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; @@ -833,7 +833,7 @@ ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,  	    }  #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) @@ -898,9 +898,9 @@ ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,  	    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 @@ -949,7 +949,7 @@ ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,  	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; @@ -1036,7 +1036,7 @@ update_frame_tool_bar (FRAME_PTR f)        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)) diff --git a/src/process.c b/src/process.c index 80d149347a5..5f28cc6b48f 100644 --- a/src/process.c +++ b/src/process.c @@ -411,7 +411,7 @@ delete_write_fd (int fd)                max_input_desc = fd;                break;              } -       +      }  } @@ -498,7 +498,7 @@ status_message (struct Lisp_Process *p)  	  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)); @@ -1420,7 +1420,7 @@ list_processes_1 (Lisp_Object query_only)  	    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)) @@ -1438,7 +1438,7 @@ list_processes_1 (Lisp_Object query_only)  	    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)) @@ -2517,7 +2517,7 @@ set_socket_option (int s, Lisp_Object opt, Lisp_Object val)    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; @@ -2556,7 +2556,7 @@ set_socket_option (int s, Lisp_Object opt, Lisp_Object val)  	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);  	  } @@ -2841,7 +2841,7 @@ usage:  (make-serial-process &rest ARGS)  */)    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) @@ -3377,7 +3377,7 @@ usage: (make-network-process &rest ARGS)  */)  	/* 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)); @@ -5645,7 +5645,7 @@ send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,  #ifdef HAVE_GNUTLS  		  if (XPROCESS (proc)->gnutls_p)  		    rv = emacs_gnutls_write (outfd, -					     XPROCESS (proc),  +					     XPROCESS (proc),  					     (char *) buf, this);  		  else  #endif @@ -7727,4 +7727,3 @@ The variable takes effect when `start-process' is called.  */);    defsubr (&Slist_system_processes);    defsubr (&Sprocess_attributes);  } - diff --git a/src/search.c b/src/search.c index c7e6f15a876..570bbe72588 100644 --- a/src/search.c +++ b/src/search.c @@ -153,7 +153,7 @@ compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, Lisp_Object tra    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 @@ -414,7 +414,7 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, int p    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) @@ -485,7 +485,7 @@ fast_string_match (Lisp_Object regexp, Lisp_Object string)    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; @@ -528,7 +528,7 @@ fast_string_match_ignore_case (Lisp_Object regexp, Lisp_Object string)    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; @@ -1268,7 +1268,7 @@ search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,        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);  	} @@ -3254,4 +3254,3 @@ is to bind it with `let' around a small expression.  */);    defsubr (&Sset_match_data);    defsubr (&Sregexp_quote);  } - diff --git a/src/term.c b/src/term.c index 63548304a75..f8484ce636c 100644 --- a/src/term.c +++ b/src/term.c @@ -1949,7 +1949,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)  	  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] = ']'; @@ -3157,7 +3157,7 @@ init_tty (const char *name, const char *terminal_type, int must_succeed)    tty->mouse_highlight.mouse_face_window = Qnil;  #endif -   +  #ifndef DOS_NT    set_tty_hooks (terminal); @@ -3800,4 +3800,3 @@ bigger, or it may make it blink, or it may do nothing at all.  */);    encode_terminal_src = NULL;    encode_terminal_dst = NULL;  } - diff --git a/src/w32fns.c b/src/w32fns.c index 8508e3313aa..387a8313297 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1507,11 +1507,11 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)    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)      { @@ -3877,7 +3877,7 @@ w32_window (struct frame *f, long window_prompting, int minibuffer_only)       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);    } @@ -3943,9 +3943,9 @@ x_icon (struct frame *f, Lisp_Object parms)  	 ? 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; @@ -4723,7 +4723,7 @@ x_display_info_for_name (Lisp_Object name)    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)); @@ -4786,7 +4786,7 @@ terminate Emacs if we can't open the connection.    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; @@ -4807,7 +4807,7 @@ terminate Emacs if we can't open the connection.    /* 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)      { @@ -6188,7 +6188,7 @@ an integer representing a ShowWindow flag:  	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);  } @@ -7203,4 +7203,3 @@ w32_last_error (void)  {    return GetLastError ();  } - diff --git a/src/w32menu.c b/src/w32menu.c index 7f883e3de84..6c6a4edd167 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -527,7 +527,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)  	  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;  	} @@ -555,7 +555,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)  	    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; @@ -745,7 +745,7 @@ w32_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,  	    }  	  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) @@ -813,9 +813,9 @@ w32_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,  	    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.  */ @@ -861,7 +861,7 @@ w32_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,        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; @@ -1021,7 +1021,7 @@ w32_dialog_show (FRAME_PTR f, int keymaps,      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)) @@ -1069,8 +1069,8 @@ w32_dialog_show (FRAME_PTR f, int keymaps,  	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; @@ -1730,4 +1730,3 @@ globals_of_w32menu (void)    unicode_append_menu = (AppendMenuW_Proc) GetProcAddress (user32, "AppendMenuW");    unicode_message_box = (MessageBoxW_Proc) GetProcAddress (user32, "MessageBoxW");  } - diff --git a/src/w32term.c b/src/w32term.c index dfe844f8827..c32cc327c09 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -1406,7 +1406,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)  				     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) @@ -6429,4 +6429,3 @@ With MS Windows, the value is t.  */);    staticpro (&last_mouse_motion_frame);    last_mouse_motion_frame = Qnil;  } - diff --git a/src/xdisp.c b/src/xdisp.c index 384e49abe05..4d0ff88f9a3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11035,7 +11035,7 @@ debug_method_add (w, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9)  	     w,  	     ((BUFFERP (w->buffer)  	       && STRINGP (XBUFFER (w->buffer)->name)) -	      ? (char *) SDATA (XBUFFER (w->buffer)->name) +	      ? SSDATA (XBUFFER (w->buffer)->name)  	      : "no buffer"),  	     buffer);  } @@ -19298,9 +19298,9 @@ decode_mode_spec (struct window *w, register int c, int field_width,      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': @@ -19583,7 +19583,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,    if (STRINGP (obj))      {        *string = obj; -      return (char *) SDATA (obj); +      return SSDATA (obj);      }    else      return ""; @@ -22230,7 +22230,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)  	{  	  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  	{ @@ -22266,7 +22266,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)  	  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 @@ -26991,4 +26991,3 @@ cancel_hourglass (void)  #endif  }  #endif /* ! WINDOWSNT  */ - diff --git a/src/xfaces.c b/src/xfaces.c index cdb398ef102..abfa70b15a0 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3612,7 +3612,7 @@ x_update_menu_appearance (struct frame *f)  #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); @@ -3621,7 +3621,7 @@ x_update_menu_appearance (struct frame *f)  		       myname, popup_path, suffix, fontsetname);  	      XrmPutLineResource (&rdb, line);  	      changed_p = 1; -	      if (fontsetname != (char *) SDATA (xlfd)) +	      if (fontsetname != SSDATA (xlfd))  		xfree (fontsetname);  	    }  	} @@ -6763,4 +6763,3 @@ a font of 10 point, we actually use a font of 10 * RESCALE-RATIO point.  */);    defsubr (&Sx_family_fonts);  #endif  } - diff --git a/src/xfns.c b/src/xfns.c index d79c3a9d8e2..bd1ffea2cd5 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -723,7 +723,7 @@ xg_set_icon (FRAME_PTR f, Lisp_Object file)      {        GdkPixbuf *pixbuf;        GError *err = NULL; -      char *filename = (char *) SDATA (found); +      char *filename = SSDATA (found);        BLOCK_INPUT;        pixbuf = gdk_pixbuf_new_from_file (filename, &err); @@ -1161,9 +1161,9 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)    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); @@ -1198,11 +1198,11 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)    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)      { @@ -1598,14 +1598,14 @@ x_set_name_internal (FRAME_PTR f, Lisp_Object name)  #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 */ @@ -1614,7 +1614,7 @@ x_set_name_internal (FRAME_PTR f, Lisp_Object name)  			 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) @@ -2397,7 +2397,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)       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);    } @@ -2546,8 +2546,8 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)    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 @@ -2711,8 +2711,8 @@ x_window (struct frame *f)    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; @@ -2824,9 +2824,9 @@ x_icon (struct frame *f, Lisp_Object parms)  	 : 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;  } @@ -4047,7 +4047,7 @@ x_display_info_for_name (Lisp_Object name)    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)); @@ -4082,7 +4082,7 @@ terminate Emacs if we can't open the connection.  #endif    if (! NILP (xrm_string)) -    xrm_option = (unsigned char *) SDATA (xrm_string); +    xrm_option = SDATA (xrm_string);    else      xrm_option = (unsigned char *) 0; @@ -4091,7 +4091,7 @@ terminate Emacs if we can't open the connection.    /* 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)      { diff --git a/src/xfont.c b/src/xfont.c index a3de5988093..8326d357ca9 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -362,7 +362,7 @@ xfont_list_pattern (Display *display, const char *pattern,  	  script = Qnil;  	}      } -       +    BLOCK_INPUT;    x_catch_errors (display); @@ -540,7 +540,7 @@ xfont_list (Lisp_Object frame, Lisp_Object spec)  	    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; @@ -797,7 +797,7 @@ xfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)    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 @@ -1113,4 +1113,3 @@ syms_of_xfont (void)    xfont_driver.type = Qx;    register_font_driver (&xfont_driver, NULL);  } - diff --git a/src/xmenu.c b/src/xmenu.c index 47f4ec15347..93fcf693279 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -882,7 +882,7 @@ static void  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) @@ -1106,7 +1106,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)  	  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;  	} @@ -1135,7 +1135,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)  	    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; @@ -1680,7 +1680,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,  	    }  #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) @@ -1745,9 +1745,9 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,  	    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 @@ -1798,7 +1798,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,  	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; @@ -2019,7 +2019,7 @@ xdialog_show (FRAME_PTR f,      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)) @@ -2066,8 +2066,8 @@ xdialog_show (FRAME_PTR f,  	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; @@ -2317,7 +2317,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,  	  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++; @@ -2582,4 +2582,3 @@ syms_of_xmenu (void)    defsubr (&Sx_popup_dialog);  #endif  } - diff --git a/src/xselect.c b/src/xselect.c index 0f57677a302..9031bd03f64 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -235,9 +235,9 @@ symbol_to_x_atom (struct x_display_info *dpyinfo, Display *display, Lisp_Object    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;  } @@ -2255,7 +2255,7 @@ x_fill_property_data (Display *dpy, Lisp_Object data, void *ret, int format)        else if (STRINGP (o))          {            BLOCK_INPUT; -          val = (long) XInternAtom (dpy, (char *) SDATA (o), False); +          val = (long) XInternAtom (dpy, SSDATA (o), False);            UNBLOCK_INPUT;          }        else @@ -2392,7 +2392,7 @@ FRAME is on.  If FRAME is nil, the selected frame is used.  */)    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 diff --git a/src/xsmfns.c b/src/xsmfns.c index 57a95607fa0..5b65e1fa2a3 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -39,9 +39,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */  #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; @@ -232,7 +229,7 @@ smc_save_yourself_CB (SmcConn smcConn,    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); @@ -394,8 +391,8 @@ create_client_leader_window (struct x_display_info *dpyinfo, char *client_id)                             -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); @@ -537,10 +534,10 @@ Do not call this function yourself. */)        SmcCloseConnection (smc_conn, 0, 0);        ice_connection_closed ();      } -   +    return Qnil;  } -   +  /*********************************************************************** @@ -584,4 +581,3 @@ See also `emacs-save-session-functions', `emacs-session-save' and  }  #endif /* HAVE_X_SM */ - diff --git a/src/xterm.c b/src/xterm.c index 9f5c8569b96..eca8f8b0b97 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1365,7 +1365,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)  				     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) @@ -8442,7 +8442,7 @@ get_current_wm_state (struct frame *f,    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; @@ -9894,7 +9894,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)        {          static char display_opt[] = "--display";          static char name_opt[] = "--name"; -         +          for (argc = 0; argc < NUM_ARGV; ++argc)            argv[argc] = 0; @@ -10849,4 +10849,3 @@ default is nil, which is the same as `super'.  */);  }  #endif /* HAVE_X_WINDOWS */ - | 
