From: krj Date: Sun, 4 Oct 2009 18:22:36 +0000 (+0000) Subject: Constify wimax_mac_calc_crc16() X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=0c0fda18866b101f8242e75fe62f4b2936cdae48;p=obnox%2Fwireshark%2Fwip.git Constify wimax_mac_calc_crc16() git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30313 f5534014-38df-0310-8fa8-9805f1628bb7 --- diff --git a/plugins/wimax/crc.c b/plugins/wimax/crc.c index 74b76b9c8c..0273371030 100644 --- a/plugins/wimax/crc.c +++ b/plugins/wimax/crc.c @@ -155,7 +155,7 @@ guint32 wimax_mac_calc_crc32(const guint8 *data, guint data_len) SIDE EFFECTS: */ -guint16 wimax_mac_calc_crc16(guint8 *data, guint data_len) +guint16 wimax_mac_calc_crc16(const guint8 *data, guint data_len) { guint32 crc=CRC16_INITIAL_VALUE; guint j; diff --git a/plugins/wimax/crc.h b/plugins/wimax/crc.h index 327f12e230..2e8f789f5a 100644 --- a/plugins/wimax/crc.h +++ b/plugins/wimax/crc.h @@ -41,7 +41,7 @@ void wimax_mac_gen_crc8_table(void); #endif guint32 wimax_mac_calc_crc32(const guint8 *data, guint data_len); -guint16 wimax_mac_calc_crc16(guint8 *data, guint data_len); +guint16 wimax_mac_calc_crc16(const guint8 *data, guint data_len); guint8 wimax_mac_calc_crc8 (guint8 *data, guint data_len); #endif /* CRC_H */ diff --git a/plugins/wimax/msg_dlmap.c b/plugins/wimax/msg_dlmap.c index 51bfbaf7ac..303f7051a2 100644 --- a/plugins/wimax/msg_dlmap.c +++ b/plugins/wimax/msg_dlmap.c @@ -550,7 +550,7 @@ gint DL_HARQ_IR_CTC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gi data = BIT_BITS(bit, bufptr, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ - calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); + calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); if (data != calculated_crc) { proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc); @@ -623,7 +623,7 @@ gint DL_HARQ_IR_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gin data = BIT_BITS(bit, bufptr, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ - calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); + calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); if (data != calculated_crc) { proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc); @@ -692,7 +692,7 @@ gint MIMO_DL_Chase_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr data = BIT_BITS(bit, bufptr, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ - calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); + calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); if (data != calculated_crc) { proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc); @@ -755,7 +755,7 @@ gint MIMO_DL_IR_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, g data = BIT_BITS(bit, bufptr, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ - calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); + calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); if (data != calculated_crc) { proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc); @@ -819,7 +819,7 @@ gint MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bu data = BIT_BITS(bit, bufptr, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ - calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); + calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); if (data != calculated_crc) { proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc); @@ -881,7 +881,7 @@ gint MIMO_DL_STC_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, data = BIT_BITS(bit, bufptr, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ - calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); + calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); if (data != calculated_crc) { proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc); @@ -2268,7 +2268,7 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *b data = NIB_WORD(nib, bufptr); generic_item = proto_tree_add_text(tree, tvb, NIBHI(nib,4), "CRC-16: 0x%04x",data); /* calculate the CRC */ - calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, NIB_TO_BYTE(nib)), NIB_TO_BYTE(nib)); + calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, NIB_TO_BYTE(nib)), NIB_TO_BYTE(nib)); if (data != calculated_crc) { proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc); @@ -2397,7 +2397,7 @@ gint wimax_decode_dlmap_reduced_aas(tvbuff_t *tvb, packet_info *pinfo, proto_tre data = BIT_BITS(bit, bufptr, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ - calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); + calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); if (data != calculated_crc) { proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);