Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Originally I was trying to remove the const type casting for the 2nd parameter of the function call tvb_new_child_real_data, which I fixed in function definition/declaration etc.

DO NOT DO THAT. That's NOT a "fix" to *ANYTHING*.

The second argument is SUPPOSED to be a const guint8 *, because neither tvb_new_child_real_data() nor any of the code that uses the data to which it's passed a pointer modifies the data to which it points; the const explicitly indicates that it will not be modified and so it can safely be passed in without a concern that it will be modified.

So PUT THE const BACK, get rid of the cast in the call, and go on from there.

Originally I was trying to remove the const type casting for the 2nd parameter of the function call tvb_new_child_real_data, which I fixed in function definition/declaration etc.

DO NOT DO THAT. That's NOT a "fix" to *ANYTHINGANYTHING*..

The second argument is SUPPOSED to be a const guint8 *, because neither tvb_new_child_real_data() nor any of the code that uses the data to which it's passed a pointer modifies the data to which it points; the const explicitly indicates that it will not be modified and so it can safely be passed in without a concern that it will be modified.

So PUT THE const BACK, get rid of the cast in the call, and go on from there.

Originally I was trying to remove the const type casting for the 2nd parameter of the function call tvb_new_child_real_data, which I fixed in function definition/declaration etc.

DO NOT DO THAT. That's NOT a "fix" to ANYTHING.

The second argument is SUPPOSED to be a const guint8 *, because neither tvb_new_child_real_data() nor any of the code that uses the data to which it's passed a pointer modifies the data to which it points; the const explicitly indicates that it will not be modified and so it can safely be passed in without a concern that it will be modified.

So PUT THE const BACKBACK IN THE FUNCTION DECLARATION AND DEFINITION, get rid of the cast in the call, and go on from there.