/* 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
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");
if (result)
{
- char *copy = (char *) xmalloc (strlen (result) + 1);
+ char *copy = xmalloc (strlen (result) + 1);
strcpy (copy, result);
return copy;
}
Return NULL otherwise. */
static char *
-magic_file_p (const char *string, EMACS_INT string_len, const char *class,
+magic_file_p (const char *string, ptrdiff_t string_len, const char *class,
const char *escaped_suffix)
{
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;
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);
if (ptr == NULL)
return xstrdup ("/");
- copy = (char *) xmalloc (strlen (ptr) + 2);
+ copy = xmalloc (strlen (ptr) + 2);
strcpy (copy, ptr);
strcat (copy, "/");
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);
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;
}
XrmClass classlist[100];
XrmRepresentation type;
- XrmStringToNameList(name, namelist);
- XrmStringToClassList(class, classlist);
+ XrmStringToNameList (name, namelist);
+ XrmStringToClassList (class, classlist);
if (XrmQGetResource (rdb, namelist, classlist, &type, &value) == True
&& (type == expected_type))