X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/5b0d046d5b6a6743be6888d02352b878151e1d6c..1a4f1e9b4805cd80952946b5f4461eeb467d9509:/src/xrdb.c?ds=sidebyside diff --git a/src/xrdb.c b/src/xrdb.c index 0c916da9ff..624bafa5e9 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -1,5 +1,5 @@ /* Deal with the X Resource Manager. - Copyright (C) 1990, 1993-1994, 2000-2011 Free Software Foundation, Inc. + Copyright (C) 1990, 1993-1994, 2000-2012 Free Software Foundation, Inc. Author: Joseph Arceneaux Created: 4/90 @@ -74,10 +74,8 @@ static char * x_get_customization_string (XrmDatabase db, const char *name, const char *class) { - char *full_name - = (char *) alloca (strlen (name) + sizeof ("customization") + 3); - char *full_class - = (char *) alloca (strlen (class) + sizeof ("Customization") + 3); + char *full_name = alloca (strlen (name) + sizeof "customization" + 3); + char *full_class = alloca (strlen (class) + sizeof "Customization" + 3); char *result; sprintf (full_name, "%s.%s", name, "customization"); @@ -87,7 +85,7 @@ x_get_customization_string (XrmDatabase db, const char *name, if (result) { - char *copy = (char *) xmalloc (strlen (result) + 1); + char *copy = xmalloc (strlen (result) + 1); strcpy (copy, result); return copy; } @@ -132,7 +130,7 @@ magic_file_p (const char *string, ptrdiff_t string_len, const char *class, char *lang = getenv ("LANG"); ptrdiff_t path_size = 100; - char *path = (char *) xmalloc (path_size); + char *path = xmalloc (path_size); ptrdiff_t path_len = 0; const char *p = string; @@ -206,7 +204,7 @@ magic_file_p (const char *string, ptrdiff_t string_len, const char *class, if (min (PTRDIFF_MAX, SIZE_MAX) / 2 - 1 - path_len < next_len) memory_full (SIZE_MAX); path_size = (path_len + next_len + 1) * 2; - path = (char *) xrealloc (path, path_size); + path = xrealloc (path, path_size); } memcpy (path + path_len, next, next_len); @@ -258,7 +256,7 @@ gethomedir (void) if (ptr == NULL) return xstrdup ("/"); - copy = (char *) xmalloc (strlen (ptr) + 2); + copy = xmalloc (strlen (ptr) + 2); strcpy (copy, ptr); strcat (copy, "/"); @@ -400,7 +398,7 @@ get_user_db (Display *display) char *xdefault; home = gethomedir (); - xdefault = (char *) xmalloc (strlen (home) + sizeof (".Xdefaults")); + xdefault = xmalloc (strlen (home) + sizeof ".Xdefaults"); strcpy (xdefault, home); strcat (xdefault, ".Xdefaults"); db = XrmGetFileDatabase (xdefault); @@ -434,7 +432,7 @@ get_environ_db (void) char *home = gethomedir (); char const *host = get_system_name (); ptrdiff_t pathsize = strlen (home) + sizeof xdefaults + strlen (host); - path = (char *) xrealloc (home, pathsize); + path = xrealloc (home, pathsize); strcat (strcat (path, xdefaults), host); p = path; }