diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-05 09:42:33 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-05 09:47:01 -0800 |
commit | 639071ff3446b0df53078be1ff5820c812313aa7 (patch) | |
tree | e0d4cf1692c44d3bfc17f06d7194fd9c7dc9459a /parse.c | |
parent | 1b5e7ee6483415d7093f3d5395c4832fa69f0a28 (diff) |
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.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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; } |