diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-19 10:33:15 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-12-09 17:37:09 -0800 |
commit | e77dd2e4bc8227ebdab70b4233cb33ed690fa264 (patch) | |
tree | c40965b2ffd7dc02afac66aca8ce05b6086d8446 /src/SMlibint.h | |
parent | 46f3ef4460aa2c1c2cba22897694a1cea572d506 (diff) |
Remove a bunch of unnecessary casts with malloc & free calls
With modern compilers and headers, they cause more problems than they
solve and just hide real issues.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: James Cloos <cloos@jhcloos.com>
Diffstat (limited to 'src/SMlibint.h')
-rw-r--r-- | src/SMlibint.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/SMlibint.h b/src/SMlibint.h index a478b48..c788739 100644 --- a/src/SMlibint.h +++ b/src/SMlibint.h @@ -236,7 +236,7 @@ in this Software without prior written authorization from The Open Group. #define EXTRACT_ARRAY8(_pBuf, _swap, _len, _array8) \ { \ EXTRACT_CARD32 (_pBuf, _swap, _len); \ - _array8 = (char *) malloc (_len + 1); \ + _array8 = malloc (_len + 1); \ memcpy (_array8, _pBuf, _len); \ _array8[_len] = '\0'; \ _pBuf += _len + PAD64 (4 + _len); \ @@ -246,7 +246,7 @@ in this Software without prior written authorization from The Open Group. { \ CARD32 _len; \ EXTRACT_CARD32 (_pBuf, _swap, _len); \ - _string = (char *) malloc (_len + 1); \ + _string = malloc (_len + 1); \ memcpy (_string, _pBuf, _len); \ _string[_len] = '\0'; \ _pBuf += _len + PAD64 (4 + _len); \ @@ -257,15 +257,15 @@ in this Software without prior written authorization from The Open Group. int _i, _j; \ EXTRACT_CARD32 (_pBuf, _swap, _count); \ _pBuf += 4; \ - _props = (SmProp **) malloc (_count * sizeof (SmProp *)); \ + _props = malloc (_count * sizeof (SmProp *)); \ for (_i = 0; _i < _count; _i++) \ { \ - _props[_i] = (SmProp *) malloc (sizeof (SmProp)); \ + _props[_i] = malloc (sizeof (SmProp)); \ EXTRACT_ARRAY8_AS_STRING (_pBuf, _swap, _props[_i]->name); \ EXTRACT_ARRAY8_AS_STRING (_pBuf, _swap, _props[_i]->type); \ EXTRACT_CARD32 (_pBuf, _swap, _props[_i]->num_vals); \ _pBuf += 4; \ - _props[_i]->vals = (SmPropValue *) malloc ( \ + _props[_i]->vals = malloc ( \ _props[_i]->num_vals * sizeof (SmPropValue)); \ for (_j = 0; _j < _props[_i]->num_vals; _j++) \ { \ |