diff options
author | Guy Harris <guy@alum.mit.edu> | 2007-04-24 11:54:18 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2007-04-24 11:54:18 +0000 |
commit | 6f8cee8acdfd2f14cb62e911ac78d70297c2aef5 (patch) | |
tree | 795fd7779ed1d19dbfac30b99e0b1af315c7a81a /epan/tvbuff.c | |
parent | 474e4c7483141303723f7f11dd817030bd67863b (diff) |
"memcpy()" takes void *'s as arguments and returns a void *; have
tvb_memcpy() be similar, to avoid unnecessarily alignment warnings.
Do the same with "ep_tvb_memdup()".
svn path=/trunk/; revision=21554
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r-- | epan/tvbuff.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index f09250148a..f3766f9514 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -904,7 +904,7 @@ guint8_pbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles) /************** ACCESSORS **************/ -static guint8* +static void* composite_memcpy(tvbuff_t *tvb, guint8* target, guint abs_offset, guint abs_length) { guint i, num_members; @@ -962,7 +962,7 @@ composite_memcpy(tvbuff_t *tvb, guint8* target, guint abs_offset, guint abs_leng return NULL; } -guint8* +void* tvb_memcpy(tvbuff_t *tvb, guint8* target, gint offset, gint length) { guint abs_offset, abs_length; @@ -971,7 +971,7 @@ tvb_memcpy(tvbuff_t *tvb, guint8* target, gint offset, gint length) check_offset_length(tvb, offset, length, &abs_offset, &abs_length); if (tvb->real_data) { - return (guint8*) memcpy(target, tvb->real_data + abs_offset, abs_length); + return memcpy(target, tvb->real_data + abs_offset, abs_length); } switch(tvb->type) { @@ -1030,11 +1030,11 @@ tvb_memdup(tvbuff_t *tvb, gint offset, gint length) * Do not use this function if you want the allocated memory to be persistent * after the current packet has been dissected. */ -guint8* +void* ep_tvb_memdup(tvbuff_t *tvb, gint offset, gint length) { guint abs_offset, abs_length; - guint8 *duped; + void *duped; check_offset_length(tvb, offset, length, &abs_offset, &abs_length); |