path: root/rawshark.c
diff options
authorEvan Huus <eapache@gmail.com>2013-09-29 12:44:50 +0000
committerEvan Huus <eapache@gmail.com>2013-09-29 12:44:50 +0000
commitc1dd5d3882978b541cfb65c99b91813cbaed45ba (patch)
treea81bb59241271313fb73db4c60f8a471f2cbad62 /rawshark.c
parent640a45d707e1cbf0d21fffd445d770e811584628 (diff)
Replace some val_to_str calls with the equivalent val_to_str_const calls (and
implement rval_to_str_const to do this). The format-strings didn't have any parameter specifiers in them, so they were clearly never used (or they would have blown up) but still a bug. This is one of the first steps towards converting val_to_str and friends to wmem. I'm honestly not sure what the best approach is for the API in this case: the vast majority of usage is within dissectors, so just hard-coding packet scope (the way they currently hard-code ep_ scope) doesn't look terrible, but there are *some* uses in taps and other places that will need to be converted to something else if we go that route. Adding a wmem_pool parameter just for the uncommon case seems a bit like overkill, though perhaps it is the right thing to do. svn path=/trunk/; revision=52264
Diffstat (limited to 'rawshark.c')
1 files changed, 8 insertions, 8 deletions
diff --git a/rawshark.c b/rawshark.c
index 1b8f0f8638..c71c31c638 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -1360,18 +1360,18 @@ static gboolean print_field_value(field_info *finfo, int cmd_line_index)
svalue = fvalue_get_sinteger(&finfo->value);
if (hfinfo->display & BASE_RANGE_STRING) {
- g_string_append(label_s, rval_to_str(svalue, RVALS(hfinfo->strings), "Unknown"));
+ g_string_append(label_s, rval_to_str_const(svalue, RVALS(hfinfo->strings), "Unknown"));
} else if (hfinfo->display & BASE_EXT_STRING) {
- g_string_append(label_s, val_to_str_ext(svalue, (const value_string_ext *) hfinfo->strings, "Unknown"));
+ g_string_append(label_s, val_to_str_ext_const(svalue, (const value_string_ext *) hfinfo->strings, "Unknown"));
} else {
- g_string_append(label_s, val_to_str(svalue, cVALS(hfinfo->strings), "Unknown"));
+ g_string_append(label_s, val_to_str_const(svalue, cVALS(hfinfo->strings), "Unknown"));
case FT_INT64:
svalue64 = (gint64)fvalue_get_integer64(&finfo->value);
if (hfinfo->display & BASE_VAL64_STRING) {
- g_string_append(label_s, val64_to_str(svalue64, (const val64_string *)(hfinfo->strings), "Unknown"));
+ g_string_append(label_s, val64_to_str_const(svalue64, (const val64_string *)(hfinfo->strings), "Unknown"));
case FT_UINT8:
@@ -1380,18 +1380,18 @@ static gboolean print_field_value(field_info *finfo, int cmd_line_index)
case FT_UINT32:
uvalue = fvalue_get_uinteger(&finfo->value);
if (!hfinfo->bitmask && hfinfo->display & BASE_RANGE_STRING) {
- g_string_append(label_s, rval_to_str(uvalue, RVALS(hfinfo->strings), "Unknown"));
+ g_string_append(label_s, rval_to_str_const(uvalue, RVALS(hfinfo->strings), "Unknown"));
} else if (hfinfo->display & BASE_EXT_STRING) {
- g_string_append(label_s, val_to_str_ext(uvalue, (const value_string_ext *) hfinfo->strings, "Unknown"));
+ g_string_append(label_s, val_to_str_ext_const(uvalue, (const value_string_ext *) hfinfo->strings, "Unknown"));
} else {
- g_string_append(label_s, val_to_str(uvalue, cVALS(hfinfo->strings), "Unknown"));
+ g_string_append(label_s, val_to_str_const(uvalue, cVALS(hfinfo->strings), "Unknown"));
case FT_UINT64:
uvalue64 = fvalue_get_integer64(&finfo->value);
if (hfinfo->display & BASE_VAL64_STRING) {
- g_string_append(label_s, val64_to_str(uvalue64, (const val64_string *)(hfinfo->strings), "Unknown"));
+ g_string_append(label_s, val64_to_str_const(uvalue64, (const val64_string *)(hfinfo->strings), "Unknown"));