summaryrefslogtreecommitdiff
path: root/epan/ftypes
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-01-18 19:27:31 +0000
committerEvan Huus <eapache@gmail.com>2013-01-18 19:27:31 +0000
commit21b5dc01072216440d0f67b8f29b912423ce5ef3 (patch)
tree74a97c44ca59dc9a954c86303c1721cd026cd4a0 /epan/ftypes
parent6b3308d11373c4ef1d44380f55a26150fae1032c (diff)
downloadwireshark-21b5dc01072216440d0f67b8f29b912423ce5ef3.tar.gz
Make the buffer argument to FvalueToStringRepr functions volatile
and use that to fix a -Wclobbered error that bleeding-edge GCC throws on tvbuff types. Also remove a variable that looked like it was being used to hide the error before GCC got clever. svn path=/trunk/; revision=47153
Diffstat (limited to 'epan/ftypes')
-rw-r--r--epan/ftypes/ftype-tvbuff.c12
-rw-r--r--epan/ftypes/ftypes.h2
2 files changed, 6 insertions, 8 deletions
diff --git a/epan/ftypes/ftype-tvbuff.c b/epan/ftypes/ftype-tvbuff.c
index ea734c6580..19a330831b 100644
--- a/epan/ftypes/ftype-tvbuff.c
+++ b/epan/ftypes/ftype-tvbuff.c
@@ -140,11 +140,10 @@ val_repr_len(fvalue_t *fv, ftrepr_t rtype)
}
static void
-val_to_repr(fvalue_t *fv, ftrepr_t rtype, char *buf)
+val_to_repr(fvalue_t *fv, ftrepr_t rtype, char * volatile buf)
{
guint length;
const guint8 *c;
- char *write_cursor;
unsigned int i;
g_assert(rtype == FTREPR_DFILTER);
@@ -152,16 +151,15 @@ val_to_repr(fvalue_t *fv, ftrepr_t rtype, char *buf)
TRY {
length = tvb_length(fv->value.tvb);
c = tvb_get_ptr(fv->value.tvb, 0, length);
- write_cursor = buf;
for (i = 0; i < length; i++) {
if (i == 0) {
- sprintf(write_cursor, "%02x", *c++);
- write_cursor += 2;
+ sprintf((char *)buf, "%02x", *c++);
+ buf += 2;
}
else {
- sprintf(write_cursor, ":%02x", *c++);
- write_cursor += 3;
+ sprintf((char *)buf, ":%02x", *c++);
+ buf += 3;
}
}
}
diff --git a/epan/ftypes/ftypes.h b/epan/ftypes/ftypes.h
index 7d58b66f9b..3f9907ece6 100644
--- a/epan/ftypes/ftypes.h
+++ b/epan/ftypes/ftypes.h
@@ -187,7 +187,7 @@ typedef void (*LogFunc)(const char*,...);
typedef gboolean (*FvalueFromUnparsed)(fvalue_t*, char*, gboolean, LogFunc);
typedef gboolean (*FvalueFromString)(fvalue_t*, char*, LogFunc);
-typedef void (*FvalueToStringRepr)(fvalue_t*, ftrepr_t, char*);
+typedef void (*FvalueToStringRepr)(fvalue_t*, ftrepr_t, char*volatile);
typedef int (*FvalueStringReprLen)(fvalue_t*, ftrepr_t);
typedef void (*FvalueSetFunc)(fvalue_t*, gpointer, gboolean);