From 342a836bba1e52a50f157a7f4362d37a1be7803c Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 3 Apr 2009 15:30:38 +0000 Subject: Make the "length" argument of the tvb_mem* functions a size_t since it's not uncommon to pass them the result of pointer arithmetic. Add size_t casts in other areas. svn path=/trunk/; revision=27941 --- epan/tvbuff.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'epan/tvbuff.h') diff --git a/epan/tvbuff.h b/epan/tvbuff.h index 91e704a148..6c203f5f28 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -351,17 +351,17 @@ extern guint64 tvb_get_bits64(tvbuff_t *tvb, gint bit_offset, gint no_of_bits, g * different TVBUFF_REAL_DATA tvbuffs. This function assumes that the * target memory is already allocated; it does not allocate or free the * target memory. */ -extern void* tvb_memcpy(tvbuff_t*, void* target, gint offset, gint length); +extern void* tvb_memcpy(tvbuff_t*, void* target, gint offset, size_t length); /** It is the user's responsibility to g_free() the memory allocated by * tvb_memdup(). Calls tvb_memcpy() */ -extern void* tvb_memdup(tvbuff_t*, gint offset, gint length); +extern void* tvb_memdup(tvbuff_t*, gint offset, size_t length); /* Same as above but the buffer returned from this function does not have to * be freed. It will be automatically freed after the packet is dissected. * Buffers allocated by this function are NOT persistent. */ -extern void* ep_tvb_memdup(tvbuff_t *tvb, gint offset, gint length); +extern void* ep_tvb_memdup(tvbuff_t *tvb, gint offset, size_t length); /** WARNING! This function is possibly expensive, temporarily allocating * another copy of the packet data. Furthermore, it's dangerous because once @@ -605,7 +605,7 @@ extern gint tvb_strncaseeql(tvbuff_t *tvb, gint offset, const gchar *str, * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ extern gint tvb_memeql(tvbuff_t *tvb, gint offset, const guint8 *str, - gint size); + size_t size); /** * Format a bunch of data from a tvbuff as bytes, returning a pointer -- cgit v1.2.3