[Trivial] Constify a few things
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 24 Apr 2009 12:16:01 +0000 (12:16 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 24 Apr 2009 12:16:01 +0000 (12:16 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28144 f5534014-38df-0310-8fa8-9805f1628bb7

wiretap/dbs-etherwatch.c
wiretap/nettl.c
wiretap/netxray.c
wiretap/ngsniffer.c
wiretap/radcom.c
wiretap/vms.c

index 221d6a4fc5f9d4fadf22adb1757634fca342abfd..38305fd3d655f73fd7c872e2852af4fff9ce67cf 100644 (file)
@@ -327,7 +327,7 @@ parse_dbs_etherwatch_packet(wtap *wth, FILE_T fh, guint8* buf, int *err,
        struct tm tm;
        char mon[4];
        gchar *p;
-       static gchar months[] = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
+       static const gchar months[] = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
        int     count, line_count;
 
        eth_hdr_len = 0;
index 0b758ae7f5191866a29b5c62c4d70e0a8e136874..2bccaca99c6f7020f6ef8bb4566a32e4ef7e4d18 100644 (file)
 #define MAGIC_SIZE     12
 
 /* HP-UX 9.x */
-static guint8 nettl_magic_hpux9[MAGIC_SIZE] = {
+static const guint8 nettl_magic_hpux9[MAGIC_SIZE] = {
     0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xD0, 0x00
 };
 /* HP-UX 10.x and 11.x */
-static guint8 nettl_magic_hpux10[MAGIC_SIZE] = {
+static const guint8 nettl_magic_hpux10[MAGIC_SIZE] = {
     0x54, 0x52, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80
 };
 
index 7a000b16f7aecd32dc1bd9b59a3721a627374fe4..4518701e5939cd55f2d7cd5e72c2f01be1acd004 100644 (file)
@@ -194,7 +194,7 @@ struct netxray_hdr {
  *  CAPTYPE_ATM?  If so, what should the table for ATM captures with
  *  that captype be?
  */
-static double TpS[] = { 1e6, 1193000.0, 1193182.0 };
+static const double TpS[] = { 1e6, 1193000.0, 1193182.0 };
 #define NUM_NETXRAY_TIMEUNITS (sizeof TpS / sizeof TpS[0])
 
 /*
@@ -219,7 +219,7 @@ static double TpS[] = { 1e6, 1193000.0, 1193182.0 };
  * (Based upon captures reviewed realtick does not contain the 
  *   correct TpS values for the 'gigpod' captype).
  */
-static double TpS_gigpod[] = { 1e9, 0.0, 31250000.0 };
+static const double TpS_gigpod[] = { 1e9, 0.0, 31250000.0 };
 #define NUM_NETXRAY_TIMEUNITS_GIGPOD (sizeof TpS_gigpod / sizeof TpS_gigpod[0])
 
 /*
@@ -227,7 +227,7 @@ static double TpS_gigpod[] = { 1e9, 0.0, 31250000.0 };
  *  (Based upon captures reviewed realtick does not contain the 
  *   correct TpS values for the 'otherpod' captype).
  */
-static double TpS_otherpod[] = { 1e6, 0.0, 1250000.0 }; 
+static const double TpS_otherpod[] = { 1e6, 0.0, 1250000.0 }; 
 #define NUM_NETXRAY_TIMEUNITS_OTHERPOD (sizeof TpS_otherpod / sizeof TpS_otherpod[0])
 
 /*
@@ -235,7 +235,7 @@ static double TpS_otherpod[] = { 1e6, 0.0, 1250000.0 };
  * (Based upon captures reviewed realtick does not contain the 
  *   correct TpS values for the 'otherpod2' captype).
  */
-static double TpS_otherpod2[] = { 1e6, 0.0, 0.0 }; 
+static const double TpS_otherpod2[] = { 1e6, 0.0, 0.0 }; 
 #define NUM_NETXRAY_TIMEUNITS_OTHERPOD2 (sizeof TpS_otherpod2 / sizeof TpS_otherpod2[0])
 
 /*
@@ -243,7 +243,7 @@ static double TpS_otherpod2[] = { 1e6, 0.0, 0.0 };
  * (Based upon captures reviewed realtick does not contain the 
  *   correct TpS values for the 'gigpod2' captype).
  */
-static double TpS_gigpod2[] = { 1e9, 0.0, 20000000.0 };
+static const double TpS_gigpod2[] = { 1e9, 0.0, 20000000.0 };
 #define NUM_NETXRAY_TIMEUNITS_GIGPOD2 (sizeof TpS_gigpod2 / sizeof TpS_gigpod2[0])
 
 /* Version number strings. */
index 912eccf25ab2499c5063344f83184af5b5d95201..e6cdf42f8795b4b61ac88191311bec7e5edf02bb 100644 (file)
@@ -447,7 +447,7 @@ struct frame6_rec {
  * so that interpretation is probably wrong.  Perhaps the interpretation
  * of V.timeunit depends on the version number of the file?
  */
-static guint32 Psec[] = {
+static const guint32 Psec[] = {
        15000000,               /* 15.0 usecs = 15000000 psecs */
          838096,               /* .838096 usecs = 838096 psecs */
        15000000,               /* 15.0 usecs = 15000000 psecs */
index 16ccd6bb40253c1e3591489bb2ac35d91c7a98c8..9abacf79faed3457a34f8a58efb3fa365dc1e6a9 100644 (file)
@@ -50,15 +50,15 @@ struct unaligned_frame_date {
 
 /* Found at the beginning of the file. Bytes 2 and 3 (D2:00) seem to be
  * different in some captures */
-static guint8 radcom_magic[8] = {
+static const guint8 radcom_magic[8] = {
        0x42, 0xD2, 0x00, 0x34, 0x12, 0x66, 0x22, 0x88
 };
 
-static guint8 encap_magic[4] = {
+static const guint8 encap_magic[4] = {
     0x00, 0x42, 0x43, 0x09
 };
 
-static guint8 active_time_magic[11] = {
+static const guint8 active_time_magic[11] = {
        0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65
 };
 
index 2a271753f993447e16a451c72d03230d00cdc4e6..51f4683cf2e166e88863e271264ac8fa572c8385 100644 (file)
@@ -370,9 +370,9 @@ parse_vms_rec_hdr(wtap *wth, FILE_T fh, int *err, gchar **err_info)
     int           pktnum;
     int           csec = 101;
     struct tm tm;
-    char mon[4] = {'J', 'A', 'N', 0};
+    const char mon[4] = {'J', 'A', 'N', 0};
     gchar *p;
-    static gchar months[] = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
+    static const gchar months[] = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
 
     tm.tm_year = 1970;
     tm.tm_hour = 1;
@@ -517,7 +517,7 @@ parse_single_hex_dump_line(char* rec, guint8 *buf, long byte_offset,
     int        i;
     char        *s;
     int        value;
-    static int offsets[16] = {39,37,35,33,28,26,24,22,17,15,13,11,6,4,2,0};
+    static const int offsets[16] = {39,37,35,33,28,26,24,22,17,15,13,11,6,4,2,0};
     char lbuf[3] = {0,0,0};