Use ws_sign_ext64()

svn path=/trunk/; revision=54238
This commit is contained in:
Jakub Zawadzki 2013-12-18 22:25:18 +00:00
parent 424fae1228
commit e49da695a1
1 changed files with 2 additions and 4 deletions

View File

@ -7289,8 +7289,7 @@ _proto_tree_add_bits_ret_val(proto_tree *tree, const int hfindex, tvbuff_t *tvb,
case FT_INT24:
case FT_INT32:
case FT_INT64:
if (value & (G_GINT64_CONSTANT(1) << (no_of_bits-1)))
value |= (G_GINT64_CONSTANT(-1) << no_of_bits);
value = ws_sign_ext64(value, no_of_bits);
break;
default:
@ -7434,8 +7433,7 @@ proto_tree_add_split_bits_item_ret_val(proto_tree *tree, const int hfindex, tvbu
case FT_INT24:
case FT_INT32:
case FT_INT64:
if (no_of_bits && (value & (G_GINT64_CONSTANT(1) << (no_of_bits-1))))
value |= (G_GINT64_CONSTANT(-1) << no_of_bits);
value = ws_sign_ext64(value, no_of_bits);
break;
default:
break;