removed some MSVC warnings (level 3)
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 5 Jan 2004 19:31:44 +0000 (19:31 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 5 Jan 2004 19:31:44 +0000 (19:31 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9561 f5534014-38df-0310-8fa8-9805f1628bb7

19 files changed:
capture-wpcap.c
capture.c
packet-atalk.c
packet-bgp.c
packet-cops.c
packet-dns.c
packet-gtp.c
packet-nbns.c
packet-ospf.c
packet-smb-common.c
packet-vines.c
plugins/artnet/packet-artnet.c
plugins/docsis/packet-rngrsp.c
plugins/giop/packet-coseventcomm.c
plugins/giop/packet-cosnaming.c
plugins/gryphon/packet-gryphon.c
prefs.c
tethereal.c
text2pcap.c

index ac43078d73d9b36e5d8ceb01e86fcbeed6007110..618dd58747070373ab272291bb5cdfed31a14dda 100644 (file)
@@ -3,7 +3,7 @@
  * time, so that we only need one Ethereal binary and one Tethereal binary
  * for Windows, regardless of whether WinPcap is installed or not.
  *
- * $Id: capture-wpcap.c,v 1.7 2003/12/21 12:18:59 ulfl Exp $
+ * $Id: capture-wpcap.c,v 1.8 2004/01/05 19:31:42 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -348,7 +348,7 @@ get_interface_list(int *err, char *err_str)
                                j = 0;
                                while (names[i] != 0) {
                                        if (j < MAX_WIN_IF_NAME_LEN)
-                                       ascii_name[j++] = names[i++];
+                                       ascii_name[j++] = (char) names[i++];
                                }
                                ascii_name[j] = '\0';
                                i++;
index 9f4260738da21ffd689149822b1a6a6980083b7f..47ac667b2b50289e63e946441fb3eb97bf6e02c5 100644 (file)
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
 /* capture.c
  * Routines for packet capture windows
  *
- * $Id: capture.c,v 1.220 2003/12/21 12:18:59 ulfl Exp $
+ * $Id: capture.c,v 1.221 2004/01/05 19:31:43 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -348,7 +348,9 @@ do_capture(const char *save_file)
     char sautostop_filesize[24];       /* need a constant for len of numbers */
     char sautostop_duration[24];       /* need a constant for len of numbers */
     char save_file_fd[24];
+#ifndef _WIN32
     char errmsg[1024+1];
+#endif
     int error;
     int argc;
     char **argv;
@@ -1395,14 +1397,14 @@ capture(gboolean *stats_known, struct pcap_stat *stats)
   char        errmsg[4096+1];
   gboolean    write_ok;
   gboolean    close_ok;
-  fd_set      set1;
-  struct timeval timeout;
   capture_info   capture_ui;
 
 #ifdef _WIN32
   WORD        wVersionRequested;
   WSADATA     wsaData;
 #else
+  fd_set      set1;
+  struct timeval timeout;
   static const char ppamsg[] = "can't find PPA for ";
   char       *libpcap_warn;
   int         sel_ret;
index 6ede79e757f28b34ae7339b619785961027bb8c8..e6fbc9afbad3f6777f9970606e18c9e8931e2904 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for AppleTalk packet disassembly: LLAP, DDP, NBP, ATP, ASP,
  * RTMP.
  *
- * $Id: packet-atalk.c,v 1.91 2003/11/16 23:17:16 guy Exp $
+ * $Id: packet-atalk.c,v 1.92 2004/01/05 19:31:43 ulfl Exp $
  *
  * Simon Wilkinson <sxw@dcs.ed.ac.uk>
  *
@@ -1089,7 +1089,7 @@ dissect_asp_reply_get_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
        }
        if (utf_ofs) {
                ofs = utf_ofs;
-               len  = tvb_get_ntohs(tvb, ofs);
+               len  = (guint8) tvb_get_ntohs(tvb, ofs);
                proto_tree_add_item(tree, hf_asp_server_utf8_name_len, tvb, ofs, 2, FALSE);
                ofs += 2;               
                proto_tree_add_item(tree, hf_asp_server_utf8_name, tvb, ofs, len, FALSE);
@@ -1165,7 +1165,7 @@ dissect_asp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   if (!aspinfo)
      return;
 
-  fn = aspinfo->command;
+  fn = (guint8) aspinfo->command;
 
   if (check_col(pinfo->cinfo, COL_INFO)) {
        if (aspinfo->reply)
@@ -1313,7 +1313,7 @@ dissect_atp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   if (!aspinfo)
      return;
 
-  fn = aspinfo->command;
+  fn = (guint8) aspinfo->command;
 
   if (check_col(pinfo->cinfo, COL_INFO)) {
        if (aspinfo->reply)
index fc4be86a990049e6c8d6a66cced260ccb712c0a5..478cfc3b81263baa968cc9dc7b23ebfc406fc18a 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for BGP packet dissection.
  * Copyright 1999, Jun-ichiro itojun Hagino <itojun@itojun.org>
  *
- * $Id: packet-bgp.c,v 1.82 2003/06/03 23:49:59 guy Exp $
+ * $Id: packet-bgp.c,v 1.83 2004/01/05 19:31:43 ulfl Exp $
  *
  * Supports:
  * RFC1771 A Border Gateway Protocol 4 (BGP-4)
@@ -896,7 +896,7 @@ decode_prefix_MP(proto_tree *tree, int hf_addr4, int hf_addr6,
         case SAFNUM_LAB_VPNUNICAST:
         case SAFNUM_LAB_VPNMULCAST:
         case SAFNUM_LAB_VPNUNIMULC:
-            plen =  tvb_get_ntohs(tvb,offset);
+            plen =  (guint8) tvb_get_ntohs(tvb,offset);
             rd_type=tvb_get_ntohs(tvb,offset+2);
             ce_id=tvb_get_ntohs(tvb,offset+10);
             labblk_off=tvb_get_ntohs(tvb,offset+12);
index 2e6c5158214e70de3b7a57a6506a7ab8ee454854..df10ba1c22bc7c128442dc853fb22807bf0b8ddc 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
  *
- * $Id: packet-cops.c,v 1.39 2003/12/21 05:51:32 jmayer Exp $
+ * $Id: packet-cops.c,v 1.40 2004/01/05 19:31:43 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -920,7 +920,7 @@ static guchar*format_asn_value (struct variable_list *variable, subid_t *variabl
   subtree = get_tree(variable_oid,variable_oid_length, subtree);
   
   if (subtree->type == 0)
-    variable->type=type_from_packet;
+    variable->type= (guint8)type_from_packet;
   
   buf_len = SPRINT_MAX_LEN; /*defined in NET-SNMP's snmp-impl.h*/
   buf = g_malloc(buf_len);
index f90159ed24c8fada1c6be1642fc9d963b829c4cc..c62d1a544a26255cbd3b8541454182a72d877110 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-dns.c
  * Routines for DNS packet disassembly
  *
- * $Id: packet-dns.c,v 1.116 2003/12/19 23:13:42 guy Exp $
+ * $Id: packet-dns.c,v 1.117 2004/01/05 19:31:43 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -2145,8 +2145,8 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
   /* To do: check for errs, etc. */
   id    = tvb_get_ntohs(tvb, offset + DNS_ID);
   flags = tvb_get_ntohs(tvb, offset + DNS_FLAGS);
-  opcode = (flags & F_OPCODE) >> OPCODE_SHIFT;
-  rcode = (flags & F_RCODE);
+  opcode = (guint16) ((flags & F_OPCODE) >> OPCODE_SHIFT);
+  rcode  = (guint16)  (flags & F_RCODE);
 
   if (check_col(pinfo->cinfo, COL_INFO)) {
     strcpy(buf, val_to_str(opcode, opcode_vals, "Unknown operation (%u)"));
index e7d8b891ec40472367f4ef3ef09ae880461d4b75..9193adda62d18b5159ea9379f4ddc82e4b8522bf 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright 2001, Michal Melerowicz <michal.melerowicz@nokia.com>
  *                 Nicolas Balkota <balkota@mac.com>
  *
- * $Id: packet-gtp.c,v 1.69 2003/11/29 03:55:31 guy Exp $
+ * $Id: packet-gtp.c,v 1.70 2004/01/05 19:31:43 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -3124,7 +3124,7 @@ decode_qos_umts(tvbuff_t *tvb, int offset, proto_tree *tree, gchar* qos_str, gui
                        retval = length + 1;
                        break;
                case 2:
-                       length = tvb_get_ntohs (tvb, offset + 1);
+                       length = (guint8) tvb_get_ntohs (tvb, offset + 1);
                        te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", qos_str);
                        ext_tree_qos = proto_item_add_subtree (te, ett_gtp_qos);
                        proto_tree_add_text (ext_tree_qos, tvb, offset + 1, 2, "Length: %u", length);
index 827d88183f80d3fc3260e9b0078df4b27f49f8c4..6c624fd74e74b9a5d034452fb9ce7de43eafa855 100644 (file)
@@ -3,7 +3,7 @@
  * to when it had only NBNS)
  * Guy Harris <guy@alum.mit.edu>
  *
- * $Id: packet-nbns.c,v 1.80 2002/09/12 00:10:58 tpot Exp $
+ * $Id: packet-nbns.c,v 1.81 2004/01/05 19:31:44 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -432,7 +432,7 @@ nbns_add_nbns_flags(column_info *cinfo, proto_tree *nbns_tree, tvbuff_t *tvb, in
        proto_tree *field_tree;
        proto_item *tf;
 
-       opcode = (flags & F_OPCODE) >> OPCODE_SHIFT;
+       opcode = (guint16) ((flags & F_OPCODE) >> OPCODE_SHIFT);
        strcpy(buf, val_to_str(opcode, opcode_vals, "Unknown operation"));
        if (flags & F_RESPONSE && !is_wack) {
                strcat(buf, " response");
@@ -1007,8 +1007,8 @@ dissect_nbns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        /* To do: check for runts, errs, etc. */
        id    = tvb_get_ntohs(tvb, offset + NBNS_ID);
        flags = tvb_get_ntohs(tvb, offset + NBNS_FLAGS);
-       opcode = (flags & F_OPCODE) >> OPCODE_SHIFT;
-       rcode = (flags & F_RCODE);
+       opcode = (guint16) ((flags & F_OPCODE) >> OPCODE_SHIFT);
+       rcode  = (guint16)  (flags & F_RCODE);
 
        if (check_col(pinfo->cinfo, COL_INFO)) {
                col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s",
@@ -1197,7 +1197,7 @@ dissect_nbdgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                break;
 
        case NBDS_ERROR:
-               header.error_code = tvb_get_ntohs(tvb, offset+10);
+               header.error_code = (guint8) tvb_get_ntohs(tvb, offset+10);
                break;
        }
 
index e931c88d1f4ddd5f71d1779b4648ecd3630abdad..5637ba777909dc838d218fb5f2bf0244a26f9ff4 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for OSPF packet disassembly
  * (c) Copyright Hannes R. Boehm <hannes@boehm.org>
  *
- * $Id: packet-ospf.c,v 1.78 2003/12/21 04:31:56 jmayer Exp $
+ * $Id: packet-ospf.c,v 1.79 2004/01/05 19:31:44 ulfl Exp $
  *
  * At this time, this module is able to analyze OSPF
  * packets as specified in RFC2328. MOSPF (RFC1584) and other
@@ -819,7 +819,7 @@ dissect_ospf_ls_req(tvbuff_t *tvb, int offset, proto_tree *tree, guint8 version)
                                    tvb, offset, 4, FALSE);
                break;
            case OSPF_VERSION_3:
-               reserved = tvb_get_ntohs(tvb, offset);
+               reserved = (guint8) tvb_get_ntohs(tvb, offset);
                proto_tree_add_text(ospf_lsr_tree, tvb, offset, 2,
                    (reserved == 0 ? "Reserved: %u" :  "Reserved: %u (incorrect, should be 0)"), reserved);
                ls_type = tvb_get_ntohs(tvb, offset+2);
@@ -1270,7 +1270,7 @@ dissect_ospf_v2_lsa(tvbuff_t *tvb, int offset, proto_tree *tree,
        /* again: flags should be secified in detail */
        proto_tree_add_text(ospf_lsa_tree, tvb, offset, 1, "Flags: 0x%02x",
                            tvb_get_guint8(tvb, offset));
-       nr_links = tvb_get_ntohs(tvb, offset + 2);
+       nr_links = (guint8) tvb_get_ntohs(tvb, offset + 2);
        proto_tree_add_text(ospf_lsa_tree, tvb, offset + 2, 2, "Number of Links: %u",
                            nr_links);
        offset += 4;
index 153e807210cfed1162143a2fe3f404d3bdc6ca83..3ed2710409287aece2b4da9d4a39a650d1acc7dc 100644 (file)
@@ -2,7 +2,7 @@
  * Common routines for smb packet dissection
  * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
  *
- * $Id: packet-smb-common.c,v 1.18 2003/06/12 08:33:30 guy Exp $
+ * $Id: packet-smb-common.c,v 1.19 2004/01/05 19:31:44 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -104,7 +104,7 @@ int display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_i
        charoffset = offset;
        p = str;
        while ((character = tvb_get_letohs(tvb, charoffset)) != '\0') {
-               *p++ = character;
+               *p++ = (char) character;
                charoffset += 2;
        }
        *p = '\0';
@@ -169,7 +169,7 @@ unicode_to_str(tvbuff_t *tvb, int offset, int *us_lenp, gboolean exactlen,
     }
     if (len > 0) {
       if ((uchar & 0xFF00) == 0)
-        *p++ = uchar;  /* ISO 8859-1 */
+        *p++ = (gchar) uchar;  /* ISO 8859-1 */
       else
         *p++ = '?';    /* not 8859-1 */
       len--;
index d8c7e03d539cfc0a4e11fb07c9d8ea448bedf5bf..45629900820e47144971ebbe46c4ba1d68f18f95 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-vines.c
  * Routines for Banyan VINES protocol packet disassembly
  *
- * $Id: packet-vines.c,v 1.61 2004/01/01 21:35:49 guy Exp $
+ * $Id: packet-vines.c,v 1.62 2004/01/05 19:31:44 ulfl Exp $
  *
  * Don Lafontaine <lafont02@cn.ca>
  *
@@ -939,7 +939,7 @@ dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                /*
                 * Non-sequenced ARP.
                 */
-               packet_type = tvb_get_ntohs(tvb, 0);
+               packet_type = (guint8) tvb_get_ntohs(tvb, 0);
                if (check_col(pinfo->cinfo, COL_INFO)) {
                        col_add_str(pinfo->cinfo, COL_INFO,
                            val_to_str(packet_type, vines_arp_packet_type_vals,
index ec4fcdf223e13ce54325b9cb2722b08282cc0bb4..cde3cd8bd2060c5a10799020e331bfe591939047 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-artnet.c
  * Routines for Art-Net packet disassembly
  *
- * $Id: packet-artnet.c,v 1.5 2003/11/17 20:57:11 guy Exp $
+ * $Id: packet-artnet.c,v 1.6 2004/01/05 19:28:54 ulfl Exp $
  *
  * Copyright (c) 2003 by Erwin Rol <erwin@erwinrol.com>
  *
@@ -997,22 +997,22 @@ dissect_artnet_video_data(tvbuff_t *tvb, guint offset, proto_tree *tree) {
                       offset, 2, FALSE);
   offset += 2;
 
-  pos_x = tvb_get_ntohs(tvb, offset);
+  pos_x = (guint8) tvb_get_ntohs(tvb, offset);
   proto_tree_add_uint(tree, hf_artnet_video_data_pos_x, tvb,
                       offset, 1, pos_x);
   offset += 1;
 
-  pos_y = tvb_get_ntohs(tvb, offset);
+  pos_y = (guint8) tvb_get_ntohs(tvb, offset);
   proto_tree_add_uint(tree, hf_artnet_video_data_pos_y, tvb,
                       offset, 1, pos_y);
   offset += 1;
 
-  len_x = tvb_get_ntohs(tvb, offset);
+  len_x = (guint8) tvb_get_ntohs(tvb, offset);
   proto_tree_add_uint(tree, hf_artnet_video_data_len_x, tvb,
                       offset, 1, len_x);
   offset += 1;
 
-  len_y = tvb_get_ntohs(tvb, offset);
+  len_y = (guint8) tvb_get_ntohs(tvb, offset);
   proto_tree_add_uint(tree, hf_artnet_video_data_len_y, tvb,
                       offset, 1, len_y);
   offset += 1;
index 24dbb53f678756e808852923f46f34fdfc1041c7..d066d45ff4828305791db9b708027b49038d281f 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for Ranging Response Message dissection
  * Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
  *
- * $Id: packet-rngrsp.c,v 1.6 2003/12/13 03:18:38 guy Exp $
+ * $Id: packet-rngrsp.c,v 1.7 2004/01/05 19:28:34 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -86,7 +86,7 @@ byte_to_signed (guint8 i)
     {
       val = i;
     }
-  return (val);
+  return (gint8) (val);
 }
 
 gint16
index fc41bfab5e1eeee3c61af8a1d6c5ed8eb933351e..5b098ab1fcae2b0959ff429b30e5a6b5b140fd1e 100644 (file)
@@ -152,7 +152,7 @@ static const char CosEventComm_PullConsumer_disconnect_pull_consumer_op[] = "dis
 
 static gboolean decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_ ) {
 
-    gboolean be _U_;                        /* big endianess */
+    /*gboolean be _U_;*/                        /* big endianess */
 
 
 
index b8e90e935fab8d6f32272ab11ad2deb69641c193..43f6c15cd31aba8a9ebbe223686614f39f21e08e 100644 (file)
@@ -289,7 +289,7 @@ static void decode_ex_CosNaming_NamingContext_CannotProceed(tvbuff_t *tvb _U_, p
 
 static gboolean decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_ ) {
 
-    gboolean be _U_;                        /* big endianess */
+    /*gboolean be _U_;*/                        /* big endianess */
 
 
 
index 785079d696ccecc5f02b71893c52fae00e201eba..9ea1d8378697b6960f6d6a50c564d38270032dbe 100644 (file)
@@ -3,7 +3,7 @@
  * By Steve Limkemann <stevelim@dgtech.com>
  * Copyright 1998 Steve Limkemann
  *
- * $Id: packet-gryphon.c,v 1.43 2003/11/04 18:37:32 guy Exp $
+ * $Id: packet-gryphon.c,v 1.44 2004/01/05 19:27:50 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -919,7 +919,7 @@ resp_time(tvbuff_t *tvb, int offset, proto_tree *pt)
      */
     ts.lng[1] = tvb_get_ntohl(tvb, offset);
     ts.lng[0] = tvb_get_ntohl(tvb, offset + 4);
-    timestamp = ts.lnglng / 100000L;
+    timestamp = (time_t) (ts.lnglng / 100000L);
     strncpy (date, ctime(&timestamp), sizeof(date));
     date[strlen(date)-1] = 0x00;
     proto_tree_add_text(pt, tvb, offset, 8, "Date/Time: %s", date);
diff --git a/prefs.c b/prefs.c
index baaf7754d77a26ba539853fa378662f0202bb38e..11a54174664166acfec6108a0dcee1be09651adf 100644 (file)
--- a/prefs.c
+++ b/prefs.c
@@ -1,7 +1,7 @@
 /* prefs.c
  * Routines for handling preferences
  *
- * $Id: prefs.c,v 1.119 2003/12/31 09:58:56 guy Exp $
+ * $Id: prefs.c,v 1.120 2004/01/05 19:31:44 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1311,9 +1311,9 @@ prefs_set_pref(char *prefarg)
 #define PRS_CAP_REAL_TIME     "capture.real_time_update"
 #define PRS_CAP_AUTO_SCROLL   "capture.auto_scroll"
 
-#define RED_COMPONENT(x)   ((((x) >> 16) & 0xff) * 65535 / 255)
-#define GREEN_COMPONENT(x) ((((x) >>  8) & 0xff) * 65535 / 255)
-#define BLUE_COMPONENT(x)   (((x)        & 0xff) * 65535 / 255)
+#define RED_COMPONENT(x)   (guint16) (((((x) >> 16) & 0xff) * 65535 / 255))
+#define GREEN_COMPONENT(x) (guint16) (((((x) >>  8) & 0xff) * 65535 / 255))
+#define BLUE_COMPONENT(x)  (guint16) ( (((x)        & 0xff) * 65535 / 255))
 
 static gchar *pr_formats[] = { "text", "postscript" };
 static gchar *pr_dests[]   = { "command", "file" };
index 04280099ba1d1b66eacb9abd8a370fa31578c429..d271cb308084827033684c996ee5615c17700741 100644 (file)
@@ -1,6 +1,6 @@
 /* tethereal.c
  *
- * $Id: tethereal.c,v 1.213 2004/01/03 18:40:07 sharpe Exp $
+ * $Id: tethereal.c,v 1.214 2004/01/05 19:31:44 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1598,7 +1598,6 @@ capture(int out_file_type)
   bpf_u_int32 netnum, netmask;
   struct bpf_program fcode;
   const char *set_linktype_err_str;
-  void        (*oldhandler)(int);
   int         err = 0;
   int         volatile volatile_err = 0;
   int         volatile inpkts = 0;
@@ -1607,6 +1606,7 @@ capture(int out_file_type)
   condition  *volatile cnd_stop_capturesize = NULL;
   condition  *volatile cnd_stop_timeout = NULL;
 #ifndef _WIN32
+  void        (*oldhandler)(int);
   static const char ppamsg[] = "can't find PPA for ";
   char       *libpcap_warn;
   volatile int pipe_fd = -1;
index 14deeccd85898bcd1ebd7b9e93a27b19818c18bc..b7cb2cef77c6ef853a5c4a84ea0d0a0458931255 100644 (file)
@@ -6,7 +6,7 @@
  *
  * (c) Copyright 2001 Ashok Narayanan <ashokn@cisco.com>
  *
- * $Id: text2pcap.c,v 1.27 2003/12/21 04:31:57 jmayer Exp $
+ * $Id: text2pcap.c,v 1.28 2004/01/05 19:31:44 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -352,7 +352,7 @@ write_byte (char *str)
     unsigned long num;
 
     num = parse_num(str, FALSE);
-    packet_buf[curr_offset] = num;
+    packet_buf[curr_offset] = (unsigned char) num;
     curr_offset ++;
     if (curr_offset >= max_offset) /* packet full */
            start_new_packet();
@@ -558,7 +558,7 @@ write_current_packet (void)
         /* Write IP header */
         if (hdr_ip) {
             HDR_IP.packet_length = g_htons(ip_length);
-            HDR_IP.protocol = hdr_ip_proto;
+            HDR_IP.protocol = (guint8) hdr_ip_proto;
             HDR_IP.hdr_checksum = 0;
             HDR_IP.hdr_checksum = in_checksum(&HDR_IP, sizeof(HDR_IP));
             fwrite(&HDR_IP, sizeof(HDR_IP), 1, output_file);
@@ -568,7 +568,7 @@ write_current_packet (void)
        pseudoh.src_addr    = HDR_IP.src_addr;
        pseudoh.dest_addr   = HDR_IP.dest_addr;
        pseudoh.zero        = 0;
-       pseudoh.protocol    = hdr_ip_proto;
+       pseudoh.protocol    = (guint8) hdr_ip_proto;
        pseudoh.length      = g_htons(proto_length);
 
         /* Write UDP header */