} else
ctl->pagesize = kernel_pagesize;
- ctl->signature_page = (unsigned long *) xcalloc(1, ctl->pagesize);
+ ctl->signature_page = xcalloc(1, ctl->pagesize);
ctl->hdr = (struct swap_header_v1_2 *) ctl->signature_page;
}
for (i = 0; envp[i] != NULL; i++)
continue;
- environ = (char **) malloc(sizeof(char *) * (i + 1));
+ environ = malloc(sizeof(char *) * (i + 1));
if (environ == NULL)
return;
char *strndup(const char *s, size_t n)
{
size_t len = strnlen(s, n);
- char *new = (char *) malloc((len + 1) * sizeof(char));
+ char *new = malloc((len + 1) * sizeof(char));
if (!new)
return NULL;
new[len] = '\0';
DBG(CACHE, ul_debug("creating blkid cache (using %s)",
filename ? filename : "default cache"));
- if (!(cache = (blkid_cache) calloc(1, sizeof(struct blkid_struct_cache))))
+ if (!(cache = calloc(1, sizeof(struct blkid_struct_cache))))
return -BLKID_ERR_MEM;
INIT_LIST_HEAD(&cache->bic_devs);
if (!filename)
filename = BLKID_CONFIG_FILE;
- conf = (struct blkid_config *) calloc(1, sizeof(*conf));
+ conf = calloc(1, sizeof(*conf));
if (!conf)
return NULL;
conf->uevent = -1;
{
blkid_dev dev;
- if (!(dev = (blkid_dev) calloc(1, sizeof(struct blkid_struct_dev))))
+ if (!(dev = calloc(1, sizeof(struct blkid_struct_dev))))
return NULL;
INIT_LIST_HEAD(&dev->bid_devs);
{
blkid_tag tag;
- if (!(tag = (blkid_tag) calloc(1, sizeof(struct blkid_struct_tag))))
+ if (!(tag = calloc(1, sizeof(struct blkid_struct_tag))))
return NULL;
INIT_LIST_HEAD(&tag->bit_tags);
/* destroy environment unless user has requested preservation (-p) */
if (!cxt->keep_env) {
- environ = (char **) xmalloc(sizeof(char *));
+ environ = xmalloc(sizeof(char *));
memset(environ, 0, sizeof(char *));
}
size_t i, ncreated = 0;
int rc;
- threads = (thread_t *) xcalloc(nthreads, sizeof(thread_t));
+ threads = xcalloc(nthreads, sizeof(thread_t));
for (i = 0; i < nthreads; i++) {
thread_t *th = &threads[i];
process_t *process;
size_t i;
- process = (process_t *) xcalloc(nprocesses, sizeof(process_t));
+ process = xcalloc(nprocesses, sizeof(process_t));
for (i = 0; i < nprocesses; i++) {
process_t *proc = &process[i];
void add_label(const char *label)
{
- llist = (const char **) xrealloc(llist, (++llct) * sizeof(char *));
+ llist = xrealloc(llist, (++llct) * sizeof(char *));
llist[llct - 1] = label;
}
void add_uuid(const char *uuid)
{
- ulist = (const char **) xrealloc(ulist, (++ulct) * sizeof(char *));
+ ulist = xrealloc(ulist, (++ulct) * sizeof(char *));
ulist[ulct - 1] = uuid;
}
if (len < 0)
log_err(_("%s: invalid character conversion for login name"), op->tty);
- wcs = (wchar_t *) malloc((len + 1) * sizeof(wchar_t));
+ wcs = malloc((len + 1) * sizeof(wchar_t));
if (!wcs)
log_err(_("failed to allocate memory: %m"));
int need;
need = l->l_lsize ? l->l_lsize * 2 : 90;
- l->l_line = (CHAR *)xrealloc((void *) l->l_line,
+ l->l_line = xrealloc((void *) l->l_line,
(unsigned) need * sizeof(CHAR));
l->l_lsize = need;
}
*/
if (l->l_lsize > sorted_size) {
sorted_size = l->l_lsize;
- sorted = (CHAR *)xrealloc((void *)sorted,
+ sorted = xrealloc((void *)sorted,
(unsigned)sizeof(CHAR) * sorted_size);
}
if (l->l_max_col >= count_size) {