diff options
author | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2013-09-28 23:01:07 +0200 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2013-10-31 20:45:26 +0000 |
commit | 01298ca2c839965f54d6d6a7b8ac00fe77190116 (patch) | |
tree | fc8a0697e378b58270f043d865cc5154fd5f72fe /src/helper/binarybuffer.c | |
parent | 4935709484828f9ce6e12c31957c78c6c1019d3e (diff) |
binarybuffer: Remove unnecessary cast and fix hidden "bug"
Because of the cast, the const decoration on the parameter provided no
guarantee against modification since it was silently discarded.
Change-Id: Ib83ade955e1a61ee2175c690620437b5e19cbb6a
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1776
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/helper/binarybuffer.c')
-rw-r--r-- | src/helper/binarybuffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helper/binarybuffer.c b/src/helper/binarybuffer.c index 6fe3664a..a3c993d3 100644 --- a/src/helper/binarybuffer.c +++ b/src/helper/binarybuffer.c @@ -148,7 +148,7 @@ void *buf_set_buf(const void *_src, unsigned src_start, if ((sq == 0) && (dq == 0) && (lq == 0)) { for (i = 0; i < lb; i++) *dst++ = *src++; - return (uint8_t *)_dst; + return _dst; } /* fallback to slow bit copy */ @@ -167,7 +167,7 @@ void *buf_set_buf(const void *_src, unsigned src_start, } } - return (uint8_t *)_dst; + return _dst; } uint32_t flip_u32(uint32_t value, unsigned int num) |