summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-05 09:42:33 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-05 09:47:01 -0800
commit639071ff3446b0df53078be1ff5820c812313aa7 (patch)
treee0d4cf1692c44d3bfc17f06d7194fd9c7dc9459a /parse.c
parent1b5e7ee6483415d7093f3d5395c4832fa69f0a28 (diff)
downloadxorg-util-makedepend-639071ff3446b0df53078be1ff5820c812313aa7.tar.gz
Remove unnecessary casts from malloc/realloc calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/parse.c b/parse.c
index c7aad8c..2d7c95a 100644
--- a/parse.c
+++ b/parse.c
@@ -322,13 +322,11 @@ define2(const char *name, const char *val, struct inclist *file)
/* Make space if it's needed */
if (file->i_defs == NULL)
{
- file->i_defs = (struct symtab **)
- malloc(sizeof (struct symtab*) * SYMTABINC);
+ file->i_defs = malloc(sizeof (struct symtab*) * SYMTABINC);
file->i_ndefs = 0;
}
else if (!(file->i_ndefs % SYMTABINC))
- file->i_defs = (struct symtab **)
- realloc(file->i_defs,
+ file->i_defs = realloc(file->i_defs,
sizeof(struct symtab*)*(file->i_ndefs+SYMTABINC));
if (file->i_defs == NULL)
@@ -387,7 +385,7 @@ define2(const char *name, const char *val, struct inclist *file)
*sp = sp[-1];
sp--;
}
- stab = (struct symtab *) malloc(sizeof (struct symtab));
+ stab = malloc(sizeof (struct symtab));
if (stab == NULL)
fatalerr("malloc()/realloc() failure in insert_defn()\n");
@@ -492,8 +490,7 @@ merge2defines(struct inclist *file1, struct inclist *file2)
{
/* make sure deflen % SYMTABINC == 0 is still true */
deflen += (SYMTABINC - deflen % SYMTABINC) % SYMTABINC;
- i_defs=(struct symtab**)
- malloc(deflen*sizeof(struct symtab*));
+ i_defs = malloc(deflen*sizeof(struct symtab*));
if (i_defs==NULL) return 0;
}