Add casts to reassure the compiler that we know what we're doing.
I.e., the calculations (thanks to the masking etc.) will result in values that fit into a guint, so there's no loss of data in converting to a guint. Change-Id: I3dacce93ab87c625a45d22090b27774b9a63ba21 Reviewed-on: https://code.wireshark.org/review/10496 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
500f196802
commit
f5bd19e5cd
1 changed files with 6 additions and 6 deletions
|
@ -2833,22 +2833,22 @@ dissect_naa_designator(proto_tree *tree, tvbuff_t *tvb, guint offset, guint len)
|
||||||
switch(naa_type) {
|
switch(naa_type) {
|
||||||
case NAA_TYPE_IEEE_EXTENDED:
|
case NAA_TYPE_IEEE_EXTENDED:
|
||||||
vs = tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN);
|
vs = tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN);
|
||||||
proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset, 2, (vs >> 48) & 0x0fff);
|
proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset, 2, (guint)((vs >> 48) & 0x0fff));
|
||||||
proto_tree_add_item(naa_tree, hf_scsi_naa_ieee_company_id, tvb, offset + 2, 3, ENC_BIG_ENDIAN);
|
proto_tree_add_item(naa_tree, hf_scsi_naa_ieee_company_id, tvb, offset + 2, 3, ENC_BIG_ENDIAN);
|
||||||
proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset + 5, 3, vs & 0x00ffffff);
|
proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset + 5, 3, (guint)(vs & 0x00ffffff));
|
||||||
break;
|
break;
|
||||||
case NAA_TYPE_LOCALLY_ASSIGNED:
|
case NAA_TYPE_LOCALLY_ASSIGNED:
|
||||||
proto_tree_add_item(naa_tree, hf_scsi_naa_locally_assigned, tvb, offset + 1, len - 1, ENC_NA);
|
proto_tree_add_item(naa_tree, hf_scsi_naa_locally_assigned, tvb, offset + 1, len - 1, ENC_NA);
|
||||||
break;
|
break;
|
||||||
case NAA_TYPE_IEEE_REGISTERED:
|
case NAA_TYPE_IEEE_REGISTERED:
|
||||||
vs = tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN);
|
vs = tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN);
|
||||||
proto_tree_add_uint(naa_tree, hf_scsi_naa_ieee_company_id, tvb, offset, 4, (vs >> 36) & 0x00ffffff);
|
proto_tree_add_uint(naa_tree, hf_scsi_naa_ieee_company_id, tvb, offset, 4, (guint)((vs >> 36) & 0x00ffffff));
|
||||||
proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset + 3, 4, vs & 0x0fffffff);
|
proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset + 3, 4, (guint)(vs & 0x0fffffff));
|
||||||
break;
|
break;
|
||||||
case NAA_TYPE_IEEE_REGISTERED_EXTENDED:
|
case NAA_TYPE_IEEE_REGISTERED_EXTENDED:
|
||||||
vs = tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN);
|
vs = tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN);
|
||||||
proto_tree_add_uint(naa_tree, hf_scsi_naa_ieee_company_id, tvb, offset, 4, (vs >> 36) & 0x00ffffff);
|
proto_tree_add_uint(naa_tree, hf_scsi_naa_ieee_company_id, tvb, offset, 4, (guint)((vs >> 36) & 0x00ffffff));
|
||||||
proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset + 3, 4, vs & 0x0fffffff);
|
proto_tree_add_uint(naa_tree, hf_scsi_naa_vendor_specific, tvb, offset + 3, 4, (guint)(vs & 0x0fffffff));
|
||||||
proto_tree_add_item(naa_tree, hf_scsi_naa_vendor_specific_extension, tvb, offset + 8, 8, ENC_NA);
|
proto_tree_add_item(naa_tree, hf_scsi_naa_vendor_specific_extension, tvb, offset + 8, 8, ENC_NA);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue