if (makeit) {
NodePtr nd;
- nd = (NodePtr)malloc(sizeof(NodeRec));
+ nd = malloc(sizeof(NodeRec));
if (!nd)
return BAD_RESOURCE;
- nd->string = (char *)malloc(len + 1);
+ nd->string = malloc(len + 1);
if (!nd->string) {
free(nd);
return BAD_RESOURCE;
*total = (*num) + num_new;
if (*old)
- *old = (char *)realloc(*old, (*total) * sz_elem);
+ *old = realloc(*old, (*total) * sz_elem);
else
- *old = (char *)calloc(*total, sz_elem);
+ *old = calloc(*total, sz_elem);
if (!(*old)) {
*total = *num = 0;
return BadAlloc;
{
if (line->num_line>=line->sz_line) {
if (line->line==line->buf) {
- line->line= (char *)malloc(line->sz_line*2);
+ line->line = malloc(line->sz_line * 2);
memcpy(line->line,line->buf,line->sz_line);
}
else {
- line->line=(char *)realloc((char *)line->line,line->sz_line*2);
+ line->line = realloc(line->line, line->sz_line * 2);
}
line->sz_line*= 2;
}
}
str= strchr(&str[0],'%');
}
- name= (char *)malloc(len+1);
+ name = malloc(len + 1);
str= orig;
outstr= name;
while (*str!='\0') {
int len;
char *new;
len = strlen(leftRtrn.str) + strlen(rightRtrn.str) + 1;
- new = (char *) malloc(len);
+ new = malloc(len);
if (new)
{ sprintf(new, "%s%s", leftRtrn.str, rightRtrn.str);
free(leftRtrn.str);
new->numLevels[i] = 0;
return False;
}
- memcpy((char *) new->syms[i], (char *) old->syms[i],
- width * sizeof(uint32_t));
+ memcpy(new->syms[i], old->syms[i], width * sizeof(uint32_t));
}
if (old->acts[i] != NULL)
{
new->acts[i] = NULL;
return False;
}
- memcpy((char *) new->acts[i], (char *) old->acts[i],
+ memcpy(new->acts[i], old->acts[i],
width * sizeof(union xkb_action));
}
}
{
key->numLevels[i] = 0;
free(key->syms[i]);
- key->syms[i] = (uint32_t *) NULL;
+ key->syms[i] = NULL;
free(key->acts[i]);
- key->acts[i] = (union xkb_action *) NULL;
- key->types[i] = (uint32_t) 0;
+ key->acts[i] = NULL;
+ key->types[i] = 0;
}
}
key->typesDefined = key->symsDefined = key->actsDefined = 1 << group;
key->numLevels[group] = key->numLevels[0];
key->numLevels[0] = 0;
key->syms[group] = key->syms[0];
- key->syms[0] = (uint32_t *) NULL;
+ key->syms[0] = NULL;
key->acts[group] = key->acts[0];
- key->acts[0] = (union xkb_action *) NULL;
+ key->acts[0] = NULL;
key->types[group] = key->types[0];
- key->types[0] = (uint32_t) 0;
+ key->types[0] = 0;
return True;
}
key->acts[i] = uTypedCalloc(width, union xkb_action);
if (key->acts[i] == NULL)
continue;
- memcpy((void *) key->acts[i], (void *) key->acts[0],
+ memcpy(key->acts[i], key->acts[0],
width * sizeof(union xkb_action));
key->actsDefined |= 1 << i;
}
key->syms[i] = uTypedCalloc(width, uint32_t);
if (key->syms[i] == NULL)
continue;
- memcpy((void *) key->syms[i], (void *) key->syms[0],
- width * sizeof(uint32_t));
+ memcpy(key->syms[i], key->syms[0], width * sizeof(uint32_t));
key->symsDefined |= 1 << i;
}
if (defined & 1)
}
if ((key->syms[i] != key->syms[0]) &&
(key->syms[i] == NULL || key->syms[0] == NULL ||
- memcmp((void *) key->syms[i], (void *) key->syms[0],
+ memcmp(key->syms[i], key->syms[0],
sizeof(uint32_t) * key->numLevels[0])))
{
identical = False;
}
if ((key->acts[i] != key->acts[0]) &&
(key->acts[i] == NULL || key->acts[0] == NULL ||
- memcmp((void *) key->acts[i], (void *) key->acts[0],
+ memcmp(key->acts[i], key->acts[0],
sizeof(union xkb_action) * key->numLevels[0])))
{
identical = False;
{
key->numLevels[i] = 0;
free(key->syms[i]);
- key->syms[i] = (uint32_t *) NULL;
+ key->syms[i] = NULL;
free(key->acts[i]);
- key->acts[i] = (union xkb_action *) NULL;
- key->types[i] = (uint32_t) 0;
+ key->acts[i] = NULL;
+ key->types[i] = 0;
}
key->symsDefined &= 1;
key->actsDefined &= 1;
char *rtrn;
if (old == NULL)
- rtrn = (char *) calloc(nNew, itemSize);
+ rtrn = calloc(nNew, itemSize);
else
{
- rtrn = (char *) realloc((char *) old, nNew * itemSize);
+ rtrn = realloc(old, nNew * itemSize);
if ((rtrn) && (nNew > nOld))
{
memset(&rtrn[nOld * itemSize], 0, (nNew - nOld) * itemSize);
}
}
- return (void *) rtrn;
+ return rtrn;
}
static FILE *errorFile = NULL;
#define uTypedAlloc(t) ((t *)malloc((unsigned)sizeof(t)))
#define uTypedCalloc(n,t) ((t *)calloc((unsigned)n,(unsigned)sizeof(t)))
-#define uTypedRealloc(pO,n,t) ((t *)realloc((void *)pO,((unsigned)n)*sizeof(t)))
-#define uTypedRecalloc(pO,o,n,t) ((t *)recalloc((void *)pO,((unsigned)o),((unsigned)n),sizeof(t)))
+#define uTypedRealloc(pO,n,t) ((t *)realloc(pO,((unsigned)n)*sizeof(t)))
+#define uTypedRecalloc(pO,o,n,t) ((t *)recalloc(pO,((unsigned)o),((unsigned)n),sizeof(t)))
#if (defined mdHasAlloca) && (mdHasAlloca)
-#define uTmpAlloc(n) ((void *)alloca((unsigned)n))
+#define uTmpAlloc(n) alloca((unsigned)n)
#define uTmpFree(p)
#else
#define uTmpAlloc(n) malloc(n)
return True;
szPath = PATH_CHUNK;
- includePath = (char **) calloc(szPath, sizeof(char *));
+ includePath = calloc(szPath, sizeof(char *));
if (!includePath)
return False;
if (nPathEntries >= szPath)
{
szPath += PATH_CHUNK;
- includePath = (char **) realloc(includePath, szPath * sizeof(char *));
+ includePath = realloc(includePath, szPath * sizeof(char *));
if (includePath == NULL)
{
WSGO("Allocation failed (includePath)\n");
if ((file != NULL) && (pathRtrn != NULL))
{
- *pathRtrn = (char *) calloc(strlen(buf) + 1, sizeof(char));
+ *pathRtrn = calloc(strlen(buf) + 1, sizeof(char));
if (*pathRtrn != NULL)
strcpy(*pathRtrn, buf);
}