diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2013-03-01 19:05:25 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2013-03-01 19:05:25 +0000 |
commit | 809c118bee21f3dc361116d8562ecef683855888 (patch) | |
tree | 47eeb2c6ac4f601fb455a9b3511dd761865690ca /plugins | |
parent | b9f723bb185a8742761626b3daaecd2bbfa22d7e (diff) | |
download | wireshark-809c118bee21f3dc361116d8562ecef683855888.tar.gz wireshark-809c118bee21f3dc361116d8562ecef683855888.tar.bz2 wireshark-809c118bee21f3dc361116d8562ecef683855888.zip |
From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 :
Remove C++ incompatibilities from WiMAX plugins
svn path=/trunk/; revision=47978
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/m2m/wimax_tlv.c | 74 | ||||
-rw-r--r-- | plugins/wimax/wimax_tlv.c | 74 | ||||
-rw-r--r-- | plugins/wimax/wimax_tlv.h | 20 |
3 files changed, 84 insertions, 84 deletions
diff --git a/plugins/m2m/wimax_tlv.c b/plugins/m2m/wimax_tlv.c index 687706e6ed..e936ec6951 100644 --- a/plugins/m2m/wimax_tlv.c +++ b/plugins/m2m/wimax_tlv.c @@ -44,50 +44,50 @@ /* init_tlv_info() */ /* retrive the tlv information from specified tvb and offset */ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* 0-success */ /* !=0-the invalid size of the TLV length (failed) */ /*************************************************************/ -gint init_tlv_info(tlv_info_t *this, tvbuff_t *tvb, gint offset) +gint init_tlv_info(tlv_info_t *info, tvbuff_t *tvb, gint offset) { guint tlv_len; /* get TLV type */ - this->type = (guint8)tvb_get_guint8( tvb, offset ); + info->type = (guint8)tvb_get_guint8( tvb, offset ); /* get TLV length */ tlv_len = (guint)tvb_get_guint8( tvb, (offset + 1) ); /* set the TLV value offset */ - this->value_offset = 2; + info->value_offset = 2; /* adjust for multiple-byte TLV length */ if((tlv_len & WIMAX_TLV_EXTENDED_LENGTH_MASK) != 0) { /* multiple bytes TLV length */ - this->length_type = 1; + info->length_type = 1; /* get the size of the TLV length */ tlv_len = (tlv_len & WIMAX_TLV_LENGTH_MASK); - this->size_of_length = tlv_len; + info->size_of_length = tlv_len; /* update the TLV value offset */ - this->value_offset += tlv_len; + info->value_offset += tlv_len; switch (tlv_len) { case 0: - this->length = 0; /* no length */ + info->length = 0; /* no length */ break; case 1: - this->length = (gint32)tvb_get_guint8( tvb, (offset + 2) ); /* 8 bit */ + info->length = (gint32)tvb_get_guint8( tvb, (offset + 2) ); /* 8 bit */ break; case 2: - this->length = (gint32)tvb_get_ntohs( tvb, (offset + 2) ); /* 16 bit */ + info->length = (gint32)tvb_get_ntohs( tvb, (offset + 2) ); /* 16 bit */ break; case 3: - this->length = (gint32)tvb_get_ntoh24( tvb, (offset + 2) ); /* 24 bit */ + info->length = (gint32)tvb_get_ntoh24( tvb, (offset + 2) ); /* 24 bit */ break; case 4: - this->length = (gint32)tvb_get_ntohl( tvb, (offset + 2) ); /* 32 bit */ + info->length = (gint32)tvb_get_ntohl( tvb, (offset + 2) ); /* 32 bit */ break; default: /* mark invalid tlv */ - this->valid = 0; + info->valid = 0; /* failed, return the invalid size of the tlv length */ return (gint)tlv_len; break; @@ -95,12 +95,12 @@ gint init_tlv_info(tlv_info_t *this, tvbuff_t *tvb, gint offset) } else /* single byte length */ { - this->length_type = 0; - this->size_of_length = 0; - this->length = (gint32)tlv_len; + info->length_type = 0; + info->size_of_length = 0; + info->length = (gint32)tlv_len; } /* mark valid tlv */ - this->valid = 1; + info->valid = 1; /* success */ return 0; } @@ -109,15 +109,15 @@ gint init_tlv_info(tlv_info_t *this, tvbuff_t *tvb, gint offset) /* get_tlv_type() */ /* get the tlv type of the specified tlv information */ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* >=0 - TLV type */ /* =-1 - invalid tlv info */ /*************************************************************/ -gint get_tlv_type(tlv_info_t *this) +gint get_tlv_type(tlv_info_t *info) { - if(this->valid) - return (gint)this->type; + if(info->valid) + return (gint)info->type; return -1; } @@ -125,15 +125,15 @@ gint get_tlv_type(tlv_info_t *this) /* get_tlv_size_of_length() */ /* get the size of tlv length of the specified tlv information*/ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* >=0 - the size of TLV length */ /* =-1 - invalid tlv info */ /**************************************************************/ -gint get_tlv_size_of_length(tlv_info_t *this) +gint get_tlv_size_of_length(tlv_info_t *info) { - if(this->valid) - return (gint)this->size_of_length; + if(info->valid) + return (gint)info->size_of_length; return -1; } @@ -141,15 +141,15 @@ gint get_tlv_size_of_length(tlv_info_t *this) /* get_tlv_length() */ /* get the tlv length of the specified tlv information */ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* >=0 - TLV length */ /* =-1 - invalid tlv info */ /*************************************************************/ -gint32 get_tlv_length(tlv_info_t *this) +gint32 get_tlv_length(tlv_info_t *info) { - if(this->valid) - return (gint32)this->length; + if(info->valid) + return (gint32)info->length; return -1; } @@ -157,15 +157,15 @@ gint32 get_tlv_length(tlv_info_t *this) /* get_tlv_value_offset() */ /* get the tlv value offset of the specified tlv information */ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* >0 - TLV value offset in byte */ /* =-1 - invalid tlv info */ /*************************************************************/ -gint get_tlv_value_offset(tlv_info_t *this) +gint get_tlv_value_offset(tlv_info_t *info) { - if(this->valid) - return (gint)this->value_offset; + if(info->valid) + return (gint)info->value_offset; return -1; } @@ -173,14 +173,14 @@ gint get_tlv_value_offset(tlv_info_t *this) /* get_tlv_length_type() */ /* get the tlv length type of the specified tlv information */ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* 0 - single byte TLV length */ /* 1 - multiple bytes TLV length */ /*************************************************************/ -gint get_tlv_length_type(tlv_info_t *this) +gint get_tlv_length_type(tlv_info_t *info) { - if(this->valid) - return (gint)this->length_type; + if(info->valid) + return (gint)info->length_type; return -1; } diff --git a/plugins/wimax/wimax_tlv.c b/plugins/wimax/wimax_tlv.c index 7b5e25890a..53f701917a 100644 --- a/plugins/wimax/wimax_tlv.c +++ b/plugins/wimax/wimax_tlv.c @@ -44,50 +44,50 @@ /* init_tlv_info() */ /* retrive the tlv information from specified tvb and offset */ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* 0-success */ /* !=0-the invalid size of the TLV length (failed) */ /*************************************************************/ -gint init_tlv_info(tlv_info_t *this, tvbuff_t *tvb, gint offset) +gint init_tlv_info(tlv_info_t *info, tvbuff_t *tvb, gint offset) { guint tlv_len; /* get TLV type */ - this->type = (guint8)tvb_get_guint8( tvb, offset ); + info->type = (guint8)tvb_get_guint8( tvb, offset ); /* get TLV length */ tlv_len = (guint)tvb_get_guint8( tvb, (offset + 1) ); /* set the TLV value offset */ - this->value_offset = 2; + info->value_offset = 2; /* adjust for multiple-byte TLV length */ if((tlv_len & WIMAX_TLV_EXTENDED_LENGTH_MASK) != 0) { /* multiple bytes TLV length */ - this->length_type = 1; + info->length_type = 1; /* get the size of the TLV length */ tlv_len = (tlv_len & WIMAX_TLV_LENGTH_MASK); - this->size_of_length = tlv_len; + info->size_of_length = tlv_len; /* update the TLV value offset */ - this->value_offset += tlv_len; + info->value_offset += tlv_len; switch (tlv_len) { case 0: - this->length = 0; /* no length */ + info->length = 0; /* no length */ break; case 1: - this->length = (gint32)tvb_get_guint8( tvb, (offset + 2) ); /* 8 bit */ + info->length = (gint32)tvb_get_guint8( tvb, (offset + 2) ); /* 8 bit */ break; case 2: - this->length = (gint32)tvb_get_ntohs( tvb, (offset + 2) ); /* 16 bit */ + info->length = (gint32)tvb_get_ntohs( tvb, (offset + 2) ); /* 16 bit */ break; case 3: - this->length = (gint32)tvb_get_ntoh24( tvb, (offset + 2) ); /* 24 bit */ + info->length = (gint32)tvb_get_ntoh24( tvb, (offset + 2) ); /* 24 bit */ break; case 4: - this->length = (gint32)tvb_get_ntohl( tvb, (offset + 2) ); /* 32 bit */ + info->length = (gint32)tvb_get_ntohl( tvb, (offset + 2) ); /* 32 bit */ break; default: /* mark invalid tlv */ - this->valid = 0; + info->valid = 0; /* failed, return the invalid size of the tlv length */ return (gint)tlv_len; break; @@ -95,12 +95,12 @@ gint init_tlv_info(tlv_info_t *this, tvbuff_t *tvb, gint offset) } else /* single byte length */ { - this->length_type = 0; - this->size_of_length = 0; - this->length = (gint32)tlv_len; + info->length_type = 0; + info->size_of_length = 0; + info->length = (gint32)tlv_len; } /* mark valid tlv */ - this->valid = 1; + info->valid = 1; /* success */ return 0; } @@ -109,15 +109,15 @@ gint init_tlv_info(tlv_info_t *this, tvbuff_t *tvb, gint offset) /* get_tlv_type() */ /* get the tlv type of the specified tlv information */ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* >=0 - TLV type */ /* =-1 - invalid tlv info */ /*************************************************************/ -gint get_tlv_type(tlv_info_t *this) +gint get_tlv_type(tlv_info_t *info) { - if(this->valid) - return (gint)this->type; + if(info->valid) + return (gint)info->type; return -1; } @@ -125,15 +125,15 @@ gint get_tlv_type(tlv_info_t *this) /* get_tlv_size_of_length() */ /* get the size of tlv length of the specified tlv information*/ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* >=0 - the size of TLV length */ /* =-1 - invalid tlv info */ /**************************************************************/ -gint get_tlv_size_of_length(tlv_info_t *this) +gint get_tlv_size_of_length(tlv_info_t *info) { - if(this->valid) - return (gint)this->size_of_length; + if(info->valid) + return (gint)info->size_of_length; return -1; } @@ -141,15 +141,15 @@ gint get_tlv_size_of_length(tlv_info_t *this) /* get_tlv_length() */ /* get the tlv length of the specified tlv information */ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* >=0 - TLV length */ /* =-1 - invalid tlv info */ /*************************************************************/ -gint32 get_tlv_length(tlv_info_t *this) +gint32 get_tlv_length(tlv_info_t *info) { - if(this->valid) - return (gint32)this->length; + if(info->valid) + return (gint32)info->length; return -1; } @@ -157,15 +157,15 @@ gint32 get_tlv_length(tlv_info_t *this) /* get_tlv_value_offset() */ /* get the tlv value offset of the specified tlv information */ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* >0 - TLV value offset in byte */ /* =-1 - invalid tlv info */ /*************************************************************/ -gint get_tlv_value_offset(tlv_info_t *this) +gint get_tlv_value_offset(tlv_info_t *info) { - if(this->valid) - return (gint)this->value_offset; + if(info->valid) + return (gint)info->value_offset; return -1; } @@ -173,14 +173,14 @@ gint get_tlv_value_offset(tlv_info_t *this) /* get_tlv_length_type() */ /* get the tlv length type of the specified tlv information */ /* parameter: */ -/* this - pointer of a tlv information data structure */ +/* info - pointer of a tlv information data structure */ /* return: */ /* 0 - single byte TLV length */ /* 1 - multiple bytes TLV length */ /*************************************************************/ -gint get_tlv_length_type(tlv_info_t *this) +gint get_tlv_length_type(tlv_info_t *info) { - if(this->valid) - return (gint)this->length_type; + if(info->valid) + return (gint)info->length_type; return -1; } diff --git a/plugins/wimax/wimax_tlv.h b/plugins/wimax/wimax_tlv.h index a0633f701b..c72f9cd9b1 100644 --- a/plugins/wimax/wimax_tlv.h +++ b/plugins/wimax/wimax_tlv.h @@ -16,7 +16,7 @@ * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * - * This program is distributed in t/he hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -46,14 +46,14 @@ typedef struct gint32 length; /* length of TLV value field */ } tlv_info_t; -gint init_tlv_info(tlv_info_t *this, tvbuff_t *tvb, gint offset); -gint valid_tlv_info(tlv_info_t *this); -gint get_tlv_type(tlv_info_t *this); -gint get_tlv_length_type(tlv_info_t *this); -gint get_tlv_size_of_length(tlv_info_t *this); -gint get_tlv_value_offset(tlv_info_t *this); -gint32 get_tlv_length(tlv_info_t *this); -proto_tree *add_tlv_subtree(tlv_info_t *this, gint idx, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gboolean little_endian); -proto_tree *add_protocol_subtree(tlv_info_t *this, gint idx, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *format, ...); +gint init_tlv_info(tlv_info_t *info, tvbuff_t *tvb, gint offset); +gint valid_tlv_info(tlv_info_t *info); +gint get_tlv_type(tlv_info_t *info); +gint get_tlv_length_type(tlv_info_t *info); +gint get_tlv_size_of_length(tlv_info_t *info); +gint get_tlv_value_offset(tlv_info_t *info); +gint32 get_tlv_length(tlv_info_t *info); +proto_tree *add_tlv_subtree(tlv_info_t *info, gint idx, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gboolean little_endian); +proto_tree *add_protocol_subtree(tlv_info_t *info, gint idx, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *format, ...); #endif /* WIMAX_TLV_H */ |