summaryrefslogtreecommitdiff
path: root/epan/column-utils.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/column-utils.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/column-utils.c')
-rw-r--r--epan/column-utils.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c
index 8953a01f51..71365dccf7 100644
--- a/epan/column-utils.c
+++ b/epan/column-utils.c
@@ -676,58 +676,58 @@ set_abs_date_time(const frame_data *fd, gchar *buf, gboolean local)
break;
case TS_PREC_FIXED_DSEC:
case TS_PREC_AUTO_DSEC:
- g_snprintf(buf, COL_MAX_LEN,"%04d-%02d-%02d %02d:%02d:%02d.%01ld",
+ g_snprintf(buf, COL_MAX_LEN,"%04d-%02d-%02d %02d:%02d:%02d.%01d",
tmp->tm_year + 1900,
tmp->tm_mon + 1,
tmp->tm_mday,
tmp->tm_hour,
tmp->tm_min,
tmp->tm_sec,
- (long)fd->abs_ts.nsecs / 100000000);
+ fd->abs_ts.nsecs / 100000000);
break;
case TS_PREC_FIXED_CSEC:
case TS_PREC_AUTO_CSEC:
- g_snprintf(buf, COL_MAX_LEN,"%04d-%02d-%02d %02d:%02d:%02d.%02ld",
+ g_snprintf(buf, COL_MAX_LEN,"%04d-%02d-%02d %02d:%02d:%02d.%02d",
tmp->tm_year + 1900,
tmp->tm_mon + 1,
tmp->tm_mday,
tmp->tm_hour,
tmp->tm_min,
tmp->tm_sec,
- (long)fd->abs_ts.nsecs / 10000000);
+ fd->abs_ts.nsecs / 10000000);
break;
case TS_PREC_FIXED_MSEC:
case TS_PREC_AUTO_MSEC:
- g_snprintf(buf, COL_MAX_LEN, "%04d-%02d-%02d %02d:%02d:%02d.%03ld",
+ g_snprintf(buf, COL_MAX_LEN, "%04d-%02d-%02d %02d:%02d:%02d.%03d",
tmp->tm_year + 1900,
tmp->tm_mon + 1,
tmp->tm_mday,
tmp->tm_hour,
tmp->tm_min,
tmp->tm_sec,
- (long)fd->abs_ts.nsecs / 1000000);
+ fd->abs_ts.nsecs / 1000000);
break;
case TS_PREC_FIXED_USEC:
case TS_PREC_AUTO_USEC:
- g_snprintf(buf, COL_MAX_LEN, "%04d-%02d-%02d %02d:%02d:%02d.%06ld",
+ g_snprintf(buf, COL_MAX_LEN, "%04d-%02d-%02d %02d:%02d:%02d.%06d",
tmp->tm_year + 1900,
tmp->tm_mon + 1,
tmp->tm_mday,
tmp->tm_hour,
tmp->tm_min,
tmp->tm_sec,
- (long)fd->abs_ts.nsecs / 1000);
+ fd->abs_ts.nsecs / 1000);
break;
case TS_PREC_FIXED_NSEC:
case TS_PREC_AUTO_NSEC:
- g_snprintf(buf, COL_MAX_LEN, "%04d-%02d-%02d %02d:%02d:%02d.%09ld",
+ g_snprintf(buf, COL_MAX_LEN, "%04d-%02d-%02d %02d:%02d:%02d.%09d",
tmp->tm_year + 1900,
tmp->tm_mon + 1,
tmp->tm_mday,
tmp->tm_hour,
tmp->tm_min,
tmp->tm_sec,
- (long)fd->abs_ts.nsecs);
+ fd->abs_ts.nsecs);
break;
default:
g_assert_not_reached();
@@ -1051,43 +1051,43 @@ set_abs_time(const frame_data *fd, gchar *buf, gboolean local)
break;
case TS_PREC_FIXED_DSEC:
case TS_PREC_AUTO_DSEC:
- g_snprintf(buf, COL_MAX_LEN,"%02d:%02d:%02d.%01ld",
+ g_snprintf(buf, COL_MAX_LEN,"%02d:%02d:%02d.%01d",
tmp->tm_hour,
tmp->tm_min,
tmp->tm_sec,
- (long)fd->abs_ts.nsecs / 100000000);
+ fd->abs_ts.nsecs / 100000000);
break;
case TS_PREC_FIXED_CSEC:
case TS_PREC_AUTO_CSEC:
- g_snprintf(buf, COL_MAX_LEN,"%02d:%02d:%02d.%02ld",
+ g_snprintf(buf, COL_MAX_LEN,"%02d:%02d:%02d.%02d",
tmp->tm_hour,
tmp->tm_min,
tmp->tm_sec,
- (long)fd->abs_ts.nsecs / 10000000);
+ fd->abs_ts.nsecs / 10000000);
break;
case TS_PREC_FIXED_MSEC:
case TS_PREC_AUTO_MSEC:
- g_snprintf(buf, COL_MAX_LEN,"%02d:%02d:%02d.%03ld",
+ g_snprintf(buf, COL_MAX_LEN,"%02d:%02d:%02d.%03d",
tmp->tm_hour,
tmp->tm_min,
tmp->tm_sec,
- (long)fd->abs_ts.nsecs / 1000000);
+ fd->abs_ts.nsecs / 1000000);
break;
case TS_PREC_FIXED_USEC:
case TS_PREC_AUTO_USEC:
- g_snprintf(buf, COL_MAX_LEN,"%02d:%02d:%02d.%06ld",
+ g_snprintf(buf, COL_MAX_LEN,"%02d:%02d:%02d.%06d",
tmp->tm_hour,
tmp->tm_min,
tmp->tm_sec,
- (long)fd->abs_ts.nsecs / 1000);
+ fd->abs_ts.nsecs / 1000);
break;
case TS_PREC_FIXED_NSEC:
case TS_PREC_AUTO_NSEC:
- g_snprintf(buf, COL_MAX_LEN, "%02d:%02d:%02d.%09ld",
+ g_snprintf(buf, COL_MAX_LEN, "%02d:%02d:%02d.%09d",
tmp->tm_hour,
tmp->tm_min,
tmp->tm_sec,
- (long)fd->abs_ts.nsecs);
+ fd->abs_ts.nsecs);
break;
default:
g_assert_not_reached();
@@ -1364,7 +1364,7 @@ col_set_fmt_time(const frame_data *fd, column_info *cinfo, const gint fmt, const
* applying/preparing/copying as filter)
*/
void
-col_set_time(column_info *cinfo, const gint el, const nstime_t *ts, char *fieldname)
+col_set_time(column_info *cinfo, const gint el, const nstime_t *ts, const char *fieldname)
{
int col;