Wireshark-bugs: [Wireshark-bugs] [Bug 8416] remove C++ incompatibilities

Date: Fri, 01 Mar 2013 17:36:04 +0000

changed bug 8416

What Removed Added
Status UNCONFIRMED IN_PROGRESS
Ever confirmed   1

Comment # 7 on bug 8416 from
(In reply to comment #2)
> Created attachment 10146 [details]
> patch to remove C++ incompatibilities from packet-asn1.c
> 
> More work to remove C++ incompatibilities, this time in
> plugins/asn1/packet-asn1.c which required changing the name of a structure
> member from typename (a reserved word in C++) to asn1typename and the usual
> assortment of implicit casts converted to explicit casts.

In the following hunk:
@@ -2384,7 +2384,7 @@
         if ((con == ASN1_PRI) && (tag == want_tag))    {
             if (def) {
                 asn1_oid_value_decode(&asn1, len, &oid, &con);
-                oid = g_realloc(oid, con + sizeof(guint)); /* prepend the
length */
+                oid = (guint32 *)g_realloc(oid, con + sizeof(guint)); /*
prepend the length */
                 memmove(&oid[1], oid, con*sizeof(guint));
                 oid[0] = con;
                 return oid;
Why not use (subid_t *) instead of (guint32 *)?

For this hunk:
@@ -3333,7 +3333,7 @@
         /* names do not have a fullname */
         if (asn1_verbose) g_message("%*s*collection T %s", n*2, empty,
p->name);
             /* read the enumeration [save min-max somewhere ?] */
-        p->value_hf.hfinfo.type = tbl_types_wireshark[p->type]; /* XXX change
field type... */
+        p->value_hf.hfinfo.type = (enum ftenum)tbl_types_wireshark[p->type];
/* XXX change field type... */
         p->value_hf.hfinfo.display = tbl_display_wireshark[p->type];

         proto_register_field_array(proto_asn1, &(p->value_hf) , 1);
Would not it be simpler to define tbl_display_wireshark as static enum ftenum
instead of static guint?


You are receiving this mail because:
  • You are watching all bug changes.