diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-04-22 03:25:48 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-04-22 03:25:48 +0000 |
commit | 38bfb185aa9ebb7f783c045c36e5b9bfc360be21 (patch) | |
tree | f2268ec993175a73a6429a81af5a034a98370b50 /epan | |
parent | 7c378ed02556c0de058fe9021c0d008ff9513148 (diff) | |
download | wireshark-38bfb185aa9ebb7f783c045c36e5b9bfc360be21.tar.gz |
"guint8 *" means "pointer to array of bytes that may or may not be
properly aligned"; "void *", at least when it's the return value of
ep_malloc(), means "pointer to properly-aligned chunk of memory". Use
"void *" in get_sdp_data_element() and its callers in that case, to
squelch compiler warnings.
svn path=/trunk/; revision=36790
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-btsdp.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c index 7bca7ee87f..ec66118bb0 100644 --- a/epan/dissectors/packet-btsdp.c +++ b/epan/dissectors/packet-btsdp.c @@ -261,7 +261,7 @@ dissect_sdp_error_response(proto_tree *t, tvbuff_t *tvb, int offset) { } static int -get_sdp_data_element(tvbuff_t *tvb, int offset, guint16 id, guint8 *type, guint8 **val, guint32 *service, guint32 *service_val) +get_sdp_data_element(tvbuff_t *tvb, int offset, guint16 id, guint8 *type, void **val, guint32 *service, guint32 *service_val) { int size, start_offset, type_size; guint8 byte0; @@ -546,7 +546,8 @@ dissect_sdp_service_attribute(proto_tree *tree, tvbuff_t *tvb, int offset, packe proto_item_append_text(ti_sa, ", value = %s", attr_val); if( pinfo->fd->flags.visited ==0) { - guint8 *val, type; + void *val; + guint8 type; guint32 service, service_val; btsdp_data_t *service_item; @@ -583,12 +584,14 @@ dissect_sdp_service_attribute(proto_tree *tree, tvbuff_t *tvb, int offset, packe case ATTR_ID_GOEP_L2CAP_PSM_GROUP_ID_IP_SUBNET: /* GOEP L2CAP PSM? */ { - guint8 *psm; + void *psm; + guint8 *psm_guint8; get_sdp_data_element(tvb, offset+ 3, id, &type, &psm, &service, &service_val); + psm_guint8 = psm; - if( (type == 1) && (*psm & 0x1) ) { - service_item->channel = *psm; + if( (type == 1) && (*psm_guint8 & 0x1) ) { + service_item->channel = *psm_guint8; service_item->protocol = BTSDP_L2CAP_PROTOCOL_UUID; service_item->flags = 0; } @@ -777,7 +780,8 @@ dissect_sdp_service_search_request(proto_tree *t, tvbuff_t *tvb, int offset, pac if (pinfo->fd->flags.visited == 0) { guint32 service, service_val; - guint8 type, *val = NULL; + guint8 type; + void *val = NULL; service_item=se_tree_lookup32(service_table, token); |