aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-11-09 14:37:13 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-11-09 14:37:13 +0000
commit0b0bbf096583ddb9ef0e660cf052e28d19bd212d (patch)
tree489198af1449d68e3f1d609fc2a129f865a5c14e
parent3b2e51942297ad9406fa8f569ccf0ac845416e2a (diff)
Replace STRINGIFY with glib version.
svn path=/trunk/; revision=53193
-rw-r--r--capture-wpcap.c4
-rw-r--r--capture_wpcap_packet.c2
-rw-r--r--epan/dissectors/packet-dbus.c2
-rw-r--r--epan/dissectors/packet-iec104.c4
-rw-r--r--epan/dissectors/packet-netflow.c2
-rw-r--r--epan/dissectors/packet-rtmpt.c8
-rw-r--r--epan/dissectors/packet-waveagent.c2
-rw-r--r--epan/ftypes/ftype-double.c4
-rw-r--r--epan/proto.c8
-rw-r--r--epan/strutil.h4
10 files changed, 18 insertions, 22 deletions
diff --git a/capture-wpcap.c b/capture-wpcap.c
index ea5f4f5aef..9bbfb968a4 100644
--- a/capture-wpcap.c
+++ b/capture-wpcap.c
@@ -127,7 +127,7 @@ typedef struct {
gboolean optional;
} symbol_table_t;
-#define SYM(x, y) { STRINGIFY(x) , (gpointer) &CONCAT(p_,x), y }
+#define SYM(x, y) { G_STRINGIFY(x) , (gpointer) &CONCAT(p_,x), y }
void
load_wpcap(void)
@@ -903,7 +903,7 @@ cant_get_if_list_error_message(const char *err_str)
void
get_compiled_pcap_version(GString *str)
{
- g_string_append(str, "with WinPcap (" STRINGIFY(PCAP_VERSION) ")");
+ g_string_append(str, "with WinPcap (" G_STRINGIFY(PCAP_VERSION) ")");
}
/*
diff --git a/capture_wpcap_packet.c b/capture_wpcap_packet.c
index 63eada2b4c..62ce615c68 100644
--- a/capture_wpcap_packet.c
+++ b/capture_wpcap_packet.c
@@ -138,7 +138,7 @@ typedef struct {
gboolean optional;
} symbol_table_t;
-#define SYM(x, y) { STRINGIFY(x) , (gpointer) &CONCAT(p_,x), y }
+#define SYM(x, y) { G_STRINGIFY(x) , (gpointer) &CONCAT(p_,x), y }
void
wpcap_packet_load(void)
diff --git a/epan/dissectors/packet-dbus.c b/epan/dissectors/packet-dbus.c
index 8d48724c94..7ea239699d 100644
--- a/epan/dissectors/packet-dbus.c
+++ b/epan/dissectors/packet-dbus.c
@@ -297,7 +297,7 @@ dissect_dbus_sig(tvbuff_t *tvb, dbus_info_t *dinfo, proto_tree *tree, int offset
val = dinfo->getdouble(tvb, offset);
offset += 8;
- proto_tree_add_double_format(tree, hfi_dbus_value_double.id, tvb, org_offset, offset - org_offset, val, "DOUBLE: %." STRINGIFY(DBL_DIG) "g", val);
+ proto_tree_add_double_format(tree, hfi_dbus_value_double.id, tvb, org_offset, offset - org_offset, val, "DOUBLE: %." G_STRINGIFY(DBL_DIG) "g", val);
/* XXX ret */
return offset;
}
diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c
index 69571f6e40..454e7f1c83 100644
--- a/epan/dissectors/packet-iec104.c
+++ b/epan/dissectors/packet-iec104.c
@@ -830,7 +830,7 @@ static void get_NVA(tvbuff_t *tvb, guint8 *offset, proto_tree *iec104_header_tre
fvalue = (float)value / 32768;
/* Normalized value F16[1..16]<-1..+1-2^-15> */
- proto_tree_add_float_format_value(iec104_header_tree, hf_asdu_normval, tvb, *offset, 2, fvalue, "%." STRINGIFY(FLT_DIG) "g (%d)", fvalue, value);
+ proto_tree_add_float_format_value(iec104_header_tree, hf_asdu_normval, tvb, *offset, 2, fvalue, "%." G_STRINGIFY(FLT_DIG) "g (%d)", fvalue, value);
(*offset) += 2;
}
@@ -844,7 +844,7 @@ static void get_NVAspt(tvbuff_t *tvb, guint8 *offset, proto_tree *iec104_header_
fvalue = (float)value / 32768;
/* Normalized value F16[1..16]<-1..+1-2^-15> */
- proto_tree_add_float_format_value(iec104_header_tree, hf_asdu_normval, tvb, *offset, 2, fvalue, "%." STRINGIFY(FLT_DIG) "g (%d)", fvalue, value);
+ proto_tree_add_float_format_value(iec104_header_tree, hf_asdu_normval, tvb, *offset, 2, fvalue, "%." G_STRINGIFY(FLT_DIG) "g (%d)", fvalue, value);
(*offset) += 2;
}
diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c
index 4b079516f8..eaa9ea3f9a 100644
--- a/epan/dissectors/packet-netflow.c
+++ b/epan/dissectors/packet-netflow.c
@@ -8303,7 +8303,7 @@ proto_register_netflow(void)
"Maximum number of fields allowed in a template",
"Set the number of fields allowed in a template. "
"Use 0 (zero) for unlimited. "
- " (default: " STRINGIFY(V9TEMPLATE_MAX_FIELDS_DEF) ")",
+ " (default: " G_STRINGIFY(V9TEMPLATE_MAX_FIELDS_DEF) ")",
10, &v9_tmplt_max_fields);
register_init_routine(&netflow_init);
diff --git a/epan/dissectors/packet-rtmpt.c b/epan/dissectors/packet-rtmpt.c
index 13c8bf98fd..4bbe356ee3 100644
--- a/epan/dissectors/packet-rtmpt.c
+++ b/epan/dissectors/packet-rtmpt.c
@@ -968,9 +968,9 @@ dissect_amf0_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, gboolean *
iDoubleValue = tvb_get_ntohieee_double(tvb, iValueOffset);
proto_tree_add_double(val_tree, hf_amf_number, tvb, iValueOffset, 8, iDoubleValue);
iValueOffset += 8;
- proto_item_append_text(ti, " %." STRINGIFY(DBL_DIG) "g", iDoubleValue);
+ proto_item_append_text(ti, " %." G_STRINGIFY(DBL_DIG) "g", iDoubleValue);
if (parent_ti != NULL)
- proto_item_append_text(parent_ti, " %." STRINGIFY(DBL_DIG) "g", iDoubleValue);
+ proto_item_append_text(parent_ti, " %." G_STRINGIFY(DBL_DIG) "g", iDoubleValue);
break;
case AMF0_BOOLEAN:
iBooleanValue = tvb_get_guint8(tvb, iValueOffset);
@@ -1229,9 +1229,9 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item
iDoubleValue = tvb_get_ntohieee_double(tvb, iValueOffset);
proto_tree_add_double(val_tree, hf_amf_number, tvb, iValueOffset, 8, iDoubleValue);
iValueOffset += 8;
- proto_item_append_text(ti, " %." STRINGIFY(DBL_DIG) "g", iDoubleValue);
+ proto_item_append_text(ti, " %." G_STRINGIFY(DBL_DIG) "g", iDoubleValue);
if (parent_ti != NULL)
- proto_item_append_text(parent_ti, " %." STRINGIFY(DBL_DIG) "g", iDoubleValue);
+ proto_item_append_text(parent_ti, " %." G_STRINGIFY(DBL_DIG) "g", iDoubleValue);
break;
case AMF3_STRING:
iIntegerValue = amf_get_u29(tvb, iValueOffset, &iValueLength);
diff --git a/epan/dissectors/packet-waveagent.c b/epan/dissectors/packet-waveagent.c
index f62f4d9afe..8b34d431aa 100644
--- a/epan/dissectors/packet-waveagent.c
+++ b/epan/dissectors/packet-waveagent.c
@@ -500,7 +500,7 @@ static void dissect_wa_payload(guint32 starting_offset, proto_item *parent_tree,
num_bss_entries = tvb_get_ntohl(tvb, starting_offset + 8);
if (num_bss_entries > NUM_BSS) {
- proto_item_append_text(pi, " [**Too large: Limiting to " STRINGIFY(NUM_BSS) "]");
+ proto_item_append_text(pi, " [**Too large: Limiting to " G_STRINGIFY(NUM_BSS) "]");
num_bss_entries = NUM_BSS;
}
/* Add 4 bytes of pad for the offset */
diff --git a/epan/ftypes/ftype-double.c b/epan/ftypes/ftype-double.c
index 1e517d27bd..6c81838cb9 100644
--- a/epan/ftypes/ftype-double.c
+++ b/epan/ftypes/ftype-double.c
@@ -93,7 +93,7 @@ float_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
static void
float_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
{
- sprintf(buf, "%." STRINGIFY(FLT_DIG) "g", fv->value.floating);
+ sprintf(buf, "%." G_STRINGIFY(FLT_DIG) "g", fv->value.floating);
}
static int
@@ -111,7 +111,7 @@ double_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
static void
double_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
{
- sprintf(buf, "%." STRINGIFY(DBL_DIG) "g", fv->value.floating);
+ sprintf(buf, "%." G_STRINGIFY(DBL_DIG) "g", fv->value.floating);
}
static gboolean
diff --git a/epan/proto.c b/epan/proto.c
index 43dfd30310..5fced156f4 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -3852,13 +3852,13 @@ proto_custom_set(proto_tree* tree, const int field_id, gint occurrence,
case FT_FLOAT:
g_snprintf(result+offset_r, size-offset_r,
- "%." STRINGIFY(FLT_DIG) "g", fvalue_get_floating(&finfo->value));
+ "%." G_STRINGIFY(FLT_DIG) "g", fvalue_get_floating(&finfo->value));
offset_r = (int)strlen(result);
break;
case FT_DOUBLE:
g_snprintf(result+offset_r, size-offset_r,
- "%." STRINGIFY(DBL_DIG) "g", fvalue_get_floating(&finfo->value));
+ "%." G_STRINGIFY(DBL_DIG) "g", fvalue_get_floating(&finfo->value));
offset_r = (int)strlen(result);
break;
@@ -5272,13 +5272,13 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
case FT_FLOAT:
g_snprintf(label_str, ITEM_LABEL_LENGTH,
- "%s: %." STRINGIFY(FLT_DIG) "g",
+ "%s: %." G_STRINGIFY(FLT_DIG) "g",
hfinfo->name, fvalue_get_floating(&fi->value));
break;
case FT_DOUBLE:
g_snprintf(label_str, ITEM_LABEL_LENGTH,
- "%s: %." STRINGIFY(DBL_DIG) "g",
+ "%s: %." G_STRINGIFY(DBL_DIG) "g",
hfinfo->name, fvalue_get_floating(&fi->value));
break;
diff --git a/epan/strutil.h b/epan/strutil.h
index aac0bbdce9..e791b4df5a 100644
--- a/epan/strutil.h
+++ b/epan/strutil.h
@@ -239,10 +239,6 @@ WS_DLL_PUBLIC
const guint8 * epan_memmem(const guint8 *haystack, guint haystack_len,
const guint8 *needle, guint needle_len);
-/** Surround a string or a macro, resolved to a string, with double quotes */
-#define _STRINGIFY(a) # a
-#define STRINGIFY(a) _STRINGIFY(a)
-
/** Scan a string to make sure it's valid hex.
*
* @param string The string to validate