summaryrefslogtreecommitdiff
path: root/epan/address_to_str.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-12-26 05:57:06 +0000
committerGuy Harris <guy@alum.mit.edu>2012-12-26 05:57:06 +0000
commit8ed7a73e22c049a2e013bb436e599bff41fc5b9b (patch)
treead4a4cc6fb4ff4d3e3ffe3a3f8e3d056e441ae46 /epan/address_to_str.c
parent8ede6b7dc09aa636f87147ab432a137c209e8aca (diff)
downloadwireshark-8ed7a73e22c049a2e013bb436e599bff41fc5b9b.tar.gz
Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
Diffstat (limited to 'epan/address_to_str.c')
-rw-r--r--epan/address_to_str.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/epan/address_to_str.c b/epan/address_to_str.c
index e805a8fa2e..933f239c94 100644
--- a/epan/address_to_str.c
+++ b/epan/address_to_str.c
@@ -84,13 +84,13 @@ char *bytes_to_hexstr_punct(char *out, const guint8 *ad, guint32 len, char punct
/* XXX FIXME
remove this one later when every call has been converted to ep_address_to_str()
*/
-gchar *
+const gchar *
ether_to_str(const guint8 *ad)
{
return bytestring_to_str(ad, 6, ':');
}
-gchar *
+const gchar *
tvb_ether_to_str(tvbuff_t *tvb, const gint offset)
{
return bytestring_to_str(tvb_get_ptr(tvb, offset, 6), 6, ':');
@@ -386,9 +386,9 @@ tipc_addr_to_str_buf( const guint8 *data, gchar *buf, int buf_len){
static void
ib_addr_to_str_buf( const address *addr, gchar *buf, int buf_len){
if (addr->len >= 16) { /* GID is 128bits */
- #define PREAMBLE_STR_LEN (sizeof("GID: ") - 1)
+ #define PREAMBLE_STR_LEN ((int)(sizeof("GID: ") - 1))
g_snprintf(buf,buf_len,"GID: ");
- if (buf_len < (int)PREAMBLE_STR_LEN ||
+ if (buf_len < PREAMBLE_STR_LEN ||
inet_ntop(AF_INET6, addr->data, buf + PREAMBLE_STR_LEN,
buf_len - PREAMBLE_STR_LEN) == NULL ) /* Returns NULL if no space and does not touch buf */
g_snprintf ( buf, buf_len, BUF_TOO_SMALL_ERR ); /* Let the unexpected value alert user */
@@ -403,13 +403,13 @@ ib_addr_to_str_buf( const address *addr, gchar *buf, int buf_len){
/* XXX FIXME
remove this one later when every call has been converted to ep_address_to_str()
*/
-gchar *
+const gchar *
fc_to_str(const guint8 *ad)
{
return bytestring_to_str (ad, 3, '.');
}
-gchar *
+const gchar *
tvb_fc_to_str(tvbuff_t *tvb, const gint offset)
{
return bytestring_to_str (tvb_get_ptr(tvb, offset, 3), 3, '.');
@@ -478,7 +478,7 @@ tvb_fcwwn_to_str(tvbuff_t *tvb, const gint offset)
/* XXX FIXME
remove this one later when every call has been converted to address_to_str()
*/
-gchar *
+const gchar *
ax25_to_str(const guint8 *ad)
{
return bytestring_to_str(ad, 7, ':');