aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-07-13 00:55:58 +0000
committerGuy Harris <guy@alum.mit.edu>2001-07-13 00:55:58 +0000
commitf7b50ca7544eb3776486375fb15b416a5e88d87b (patch)
tree7296d508f19728911cce7937d426784768575b2e /wiretap
parent82a553e9c9275c9074b087b63e976ef63259dba9 (diff)
From Joerg Mayer:
* gcc 3.0 warning fixes: - text2pcap.c: The number of characters to scan should probably not be 0 - wiretap/csids.c: using preincrement on a variable used on both sides of an assignment might be undefined by the C99(?) standard * turn on additional warnings for epan and wiretap too - epan/configure.in - wiretap/configure.in * Fix some warnings (missing includes, signed/unsigned, missing initializers) found by turning on the warnings - all other files :-) svn path=/trunk/; revision=3709
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/ascend-grammar.y4
-rw-r--r--wiretap/ascend.c4
-rw-r--r--wiretap/configure.in4
-rw-r--r--wiretap/csids.c20
-rw-r--r--wiretap/etherpeek.c6
-rw-r--r--wiretap/file.c6
-rw-r--r--wiretap/i4b_trace.h4
-rw-r--r--wiretap/libpcap.c6
-rw-r--r--wiretap/netmon.c4
-rw-r--r--wiretap/wtap.c6
10 files changed, 35 insertions, 29 deletions
diff --git a/wiretap/ascend-grammar.y b/wiretap/ascend-grammar.y
index 08d989ee11..4577c935dd 100644
--- a/wiretap/ascend-grammar.y
+++ b/wiretap/ascend-grammar.y
@@ -1,7 +1,7 @@
%{
/* ascend-grammar.y
*
- * $Id: ascend-grammar.y,v 1.18 2001/04/09 03:32:34 gerald Exp $
+ * $Id: ascend-grammar.y,v 1.19 2001/07/13 00:55:57 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -86,7 +86,7 @@ extern int at_eof;
int yyparse(void);
void yyerror(char *);
-int bcur = 0, bcount;
+unsigned int bcur = 0, bcount;
guint32 start_time, secs, usecs, caplen, wirelen;
ascend_pkthdr *header;
struct ascend_phdr *pseudo_header;
diff --git a/wiretap/ascend.c b/wiretap/ascend.c
index 7155815403..04a34783cf 100644
--- a/wiretap/ascend.c
+++ b/wiretap/ascend.c
@@ -1,6 +1,6 @@
/* ascend.c
*
- * $Id: ascend.c,v 1.23 2001/03/10 06:33:57 guy Exp $
+ * $Id: ascend.c,v 1.24 2001/07/13 00:55:57 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -116,7 +116,7 @@ static void ascend_close(wtap *wth);
static int ascend_seek(wtap *wth, int max_seek)
{
int byte, bytes_read = 0, date_off = -1, cur_off, packet_off;
- int x_level = 0, r_level = 0, w1_level = 0, w2_level = 0;
+ unsigned int r_level = 0, x_level = 0, w1_level = 0, w2_level = 0;
while (((byte = file_getc(wth->fh)) != EOF) && bytes_read < max_seek) {
if (byte == ascend_xmagic[x_level]) {
diff --git a/wiretap/configure.in b/wiretap/configure.in
index b9d42b581b..88c23375c8 100644
--- a/wiretap/configure.in
+++ b/wiretap/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.27 2001/06/27 07:47:50 guy Exp $
+# $Id: configure.in,v 1.28 2001/07/13 00:55:57 guy Exp $
dnl
dnl Process this file with autoconf 2.13 or later to produce a
dnl configure script; 2.12 doesn't generate a "configure" script that
@@ -29,7 +29,7 @@ AC_SUBST(FLEX_PATH)
# If we're running gcc, add '-Wall' to CFLAGS.
AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS)
if test x$GCC != x ; then
- CFLAGS="-Wall $CFLAGS"
+ CFLAGS="-Wall -W -Wno-unused $CFLAGS"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
diff --git a/wiretap/csids.c b/wiretap/csids.c
index d50ae18c3f..7196b0ea92 100644
--- a/wiretap/csids.c
+++ b/wiretap/csids.c
@@ -1,6 +1,6 @@
/* csids.c
*
- * $Id: csids.c,v 1.6 2001/03/10 06:33:57 guy Exp $
+ * $Id: csids.c,v 1.7 2001/07/13 00:55:58 guy Exp $
*
* Copyright (c) 2000 by Mike Hall <mlh@io.com>
* Copyright (c) 2000 by Cisco Systems
@@ -180,9 +180,12 @@ static gboolean csids_read(wtap *wth, int *err, int *data_offset)
if( wth->capture.csids->byteswapped == TRUE ) {
guint16* swap = (guint16*)buf;
- *(++swap) = BSWAP16(*swap); /* the ip len */
- *(++swap) = BSWAP16(*swap); /* ip id */
- *(++swap) = BSWAP16(*swap); /* ip flags and fragoff */
+ swap++;
+ *(swap) = BSWAP16(*swap); /* the ip len */
+ swap++;
+ *(swap) = BSWAP16(*swap); /* ip id */
+ swap++;
+ *(swap) = BSWAP16(*swap); /* ip flags and fragoff */
}
return TRUE;
@@ -228,9 +231,12 @@ csids_seek_read (wtap *wth,
if( wth->capture.csids->byteswapped == TRUE ) {
guint16* swap = (guint16*)pd;
- *(++swap) = BSWAP16(*swap); /* the ip len */
- *(++swap) = BSWAP16(*swap); /* ip id */
- *(++swap) = BSWAP16(*swap); /* ip flags and fragoff */
+ swap++;
+ *(swap) = BSWAP16(*swap); /* the ip len */
+ swap++;
+ *(swap) = BSWAP16(*swap); /* ip id */
+ swap++;
+ *(swap) = BSWAP16(*swap); /* ip flags and fragoff */
}
return 0;
diff --git a/wiretap/etherpeek.c b/wiretap/etherpeek.c
index 5a6181b55f..32102eba20 100644
--- a/wiretap/etherpeek.c
+++ b/wiretap/etherpeek.c
@@ -2,7 +2,7 @@
* Routines for opening etherpeek files
* Copyright (c) 2001, Daniel Thompson <d.thompson@gmx.net>
*
- * $Id: etherpeek.c,v 1.3 2001/03/10 06:33:57 guy Exp $
+ * $Id: etherpeek.c,v 1.4 2001/07/13 00:55:58 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -210,7 +210,7 @@ static gboolean etherpeek_read_m7(wtap *wth, int *err, int *data_offset)
{
etherpeek_m7_packet_t ep_pkt;
double t;
- int i;
+ unsigned int i;
g_assert(sizeof(ep_pkt) == ETHERPEEK_M7_PKT_SIZE);
wtap_file_read_expected_bytes(&ep_pkt, sizeof(ep_pkt), wth->fh, err);
@@ -265,7 +265,7 @@ static gboolean etherpeek_read_m7(wtap *wth, int *err, int *data_offset)
static gboolean etherpeek_read_m56(wtap *wth, int *err, int *data_offset)
{
etherpeek_m56_packet_t ep_pkt;
- int i;
+ unsigned int i;
g_assert(sizeof(ep_pkt) == ETHERPEEK_M56_PKT_SIZE);
wtap_file_read_expected_bytes(&ep_pkt, sizeof(ep_pkt), wth->fh, err);
diff --git a/wiretap/file.c b/wiretap/file.c
index 6eba00d993..62b5dcdbea 100644
--- a/wiretap/file.c
+++ b/wiretap/file.c
@@ -1,6 +1,6 @@
/* file.c
*
- * $Id: file.c,v 1.66 2001/03/10 06:33:57 guy Exp $
+ * $Id: file.c,v 1.67 2001/07/13 00:55:58 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -149,7 +149,7 @@ wtap* wtap_open_offline(const char *filename, int *err, gboolean do_random)
{
struct stat statb;
wtap *wth;
- int i;
+ unsigned int i;
/* First, make sure the file is valid */
if (stat(filename, &statb) < 0) {
@@ -252,7 +252,7 @@ success:
}
/* Table of the file types we know about. */
-const static struct file_type_info {
+static const struct file_type_info {
const char *name;
const char *short_name;
int (*can_write_encap)(int, int);
diff --git a/wiretap/i4b_trace.h b/wiretap/i4b_trace.h
index 59684e1dd2..66ef59d876 100644
--- a/wiretap/i4b_trace.h
+++ b/wiretap/i4b_trace.h
@@ -27,7 +27,7 @@
* i4b_trace.h - header file for trace data read device
* ----------------------------------------------------
*
- * $Id: i4b_trace.h,v 1.1 1999/12/12 22:40:09 gram Exp $
+ * $Id: i4b_trace.h,v 1.2 2001/07/13 00:55:58 guy Exp $
*
* last edit-date: [Sun Feb 14 10:39:26 1999]
*
@@ -40,7 +40,7 @@
* structure of the header at the beginning of every trace mbuf
*---------------------------------------------------------------------------*/
typedef struct {
- int length; /* length of the following mbuf */
+ unsigned int length; /* length of the following mbuf */
int unit; /* controller unit number */
int type; /* type of channel */
#define TRC_CH_I 0 /* Layer 1 INFO's */
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c
index b85d518e38..294bb95d66 100644
--- a/wiretap/libpcap.c
+++ b/wiretap/libpcap.c
@@ -1,6 +1,6 @@
/* libpcap.c
*
- * $Id: libpcap.c,v 1.48 2001/03/15 09:11:03 guy Exp $
+ * $Id: libpcap.c,v 1.49 2001/07/13 00:55:58 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -867,7 +867,7 @@ libpcap_close(wtap *wth)
int wtap_pcap_encap_to_wtap_encap(int encap)
{
- int i;
+ unsigned int i;
for (i = 0; i < NUM_PCAP_ENCAPS; i++) {
if (pcap_to_wtap_map[i].dlt_value == encap)
@@ -878,7 +878,7 @@ int wtap_pcap_encap_to_wtap_encap(int encap)
static int wtap_wtap_encap_to_pcap_encap(int encap)
{
- int i;
+ unsigned int i;
/*
* Special-case WTAP_ENCAP_FDDI and WTAP_ENCAP_FDDI_BITSWAPPED;
diff --git a/wiretap/netmon.c b/wiretap/netmon.c
index f0f266f315..a0b489a71f 100644
--- a/wiretap/netmon.c
+++ b/wiretap/netmon.c
@@ -1,6 +1,6 @@
/* netmon.c
*
- * $Id: netmon.c,v 1.37 2001/03/10 06:33:57 guy Exp $
+ * $Id: netmon.c,v 1.38 2001/07/13 00:55:58 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -126,7 +126,7 @@ int netmon_open(wtap *wth, int *err)
int frame_table_size;
guint32 *frame_table;
#ifdef WORDS_BIGENDIAN
- int i;
+ unsigned int i;
#endif
/* Read in the string that should be at the start of a Network
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index 63475d73b0..db9bbae293 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -1,6 +1,6 @@
/* wtap.c
*
- * $Id: wtap.c,v 1.53 2001/07/05 00:34:42 guy Exp $
+ * $Id: wtap.c,v 1.54 2001/07/13 00:55:58 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -55,7 +55,7 @@ wtap_file_encap(wtap *wth)
}
/* Table of the encapsulation types we know about. */
-const static struct encap_type_info {
+static const struct encap_type_info {
const char *name;
const char *short_name;
} encap_table[WTAP_NUM_ENCAP_TYPES] = {
@@ -183,7 +183,7 @@ const char
*wtap_strerror(int err)
{
static char errbuf[128];
- int wtap_errlist_index;
+ unsigned int wtap_errlist_index;
if (err < 0) {
#ifdef HAVE_LIBZ