diff options
author | Gerald Combs <gerald@wireshark.org> | 2021-04-16 11:24:52 -0700 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-04-16 20:09:42 +0000 |
commit | e513ed41d2c12e5196762911e62a4e9a9206d40e (patch) | |
tree | 420772900bdb6237b26041713525e5f75dbaff15 /wiretap | |
parent | c92637bcd82071d7a263597c2d7cbd95b481ee54 (diff) |
Wiretap: Fix some compiler warnings.
Make various _dump_can_write_encap and _dump_open routines static. Add a
couple of casts.
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/commview.c | 6 | ||||
-rw-r--r-- | wiretap/erf.c | 4 | ||||
-rw-r--r-- | wiretap/lanalyzer.c | 4 | ||||
-rw-r--r-- | wiretap/libpcap.c | 2 | ||||
-rw-r--r-- | wiretap/log3gpp.c | 2 | ||||
-rw-r--r-- | wiretap/netscaler.c | 10 | ||||
-rw-r--r-- | wiretap/netxray.c | 8 | ||||
-rw-r--r-- | wiretap/pcapng.c | 10 | ||||
-rw-r--r-- | wiretap/snoop.c | 4 |
9 files changed, 26 insertions, 24 deletions
diff --git a/wiretap/commview.c b/wiretap/commview.c index f6aae5be91..2fc9381400 100644 --- a/wiretap/commview.c +++ b/wiretap/commview.c @@ -392,7 +392,8 @@ commview_read_header(commview_header_t *cv_hdr, FILE_T fh, int *err, /* Returns 0 if we can write out the specified encapsulation type * into a CommView format file. */ -int commview_dump_can_write_encap(int encap) +static int +commview_dump_can_write_encap(int encap) { switch (encap) { @@ -410,7 +411,8 @@ int commview_dump_can_write_encap(int encap) /* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on failure */ -gboolean commview_dump_open(wtap_dumper *wdh, int *err _U_, gchar **err_info _U_) +static gboolean +commview_dump_open(wtap_dumper *wdh, int *err _U_, gchar **err_info _U_) { wdh->subtype_write = commview_dump; diff --git a/wiretap/erf.c b/wiretap/erf.c index 672661532a..483b9d4b32 100644 --- a/wiretap/erf.c +++ b/wiretap/erf.c @@ -2011,7 +2011,7 @@ static gboolean erf_dump( return TRUE; } -int erf_dump_can_write_encap(int encap) +static int erf_dump_can_write_encap(int encap) { if(encap == WTAP_ENCAP_PER_PACKET) @@ -2023,7 +2023,7 @@ int erf_dump_can_write_encap(int encap) return 0; } -int erf_dump_open(wtap_dumper *wdh, int *err _U_, gchar **err_info _U_) +static int erf_dump_open(wtap_dumper *wdh, int *err _U_, gchar **err_info _U_) { erf_dump_t *dump_priv; gchar *s; diff --git a/wiretap/lanalyzer.c b/wiretap/lanalyzer.c index a3e6bdc274..368b441cda 100644 --- a/wiretap/lanalyzer.c +++ b/wiretap/lanalyzer.c @@ -771,7 +771,7 @@ static gboolean lanalyzer_dump(wtap_dumper *wdh, * Returns 0 if we could write the specified encapsulation type, * an error indication otherwise. *---------------------------------------------------*/ -int lanalyzer_dump_can_write_encap(int encap) +static int lanalyzer_dump_can_write_encap(int encap) { /* Per-packet encapsulations aren't supported. */ if (encap == WTAP_ENCAP_PER_PACKET) @@ -790,7 +790,7 @@ int lanalyzer_dump_can_write_encap(int encap) * Returns TRUE on success, FALSE on failure; sets "*err" to an * error code on failure *---------------------------------------------------*/ -gboolean lanalyzer_dump_open(wtap_dumper *wdh, int *err, gchar **err_info _U_) +static gboolean lanalyzer_dump_open(wtap_dumper *wdh, int *err, gchar **err_info _U_) { int jump; void *tmp; diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c index c86b0e8966..15e8a04e6d 100644 --- a/wiretap/libpcap.c +++ b/wiretap/libpcap.c @@ -1015,7 +1015,7 @@ typedef struct { /* Returns 0 if we could write the specified encapsulation type, an error indication otherwise. */ -int libpcap_dump_can_write_encap(int encap) +static int libpcap_dump_can_write_encap(int encap) { /* Per-packet encapsulations aren't supported. */ if (encap == WTAP_ENCAP_PER_PACKET) diff --git a/wiretap/log3gpp.c b/wiretap/log3gpp.c index ba526301ef..a23bb9039a 100644 --- a/wiretap/log3gpp.c +++ b/wiretap/log3gpp.c @@ -93,7 +93,7 @@ void register_log3gpp(void); /***************************************************************************/ /* Free log3gpp-specific capture info from file that was open for reading */ /***************************************************************************/ -void log3gpp_close(wtap* wth) +static void log3gpp_close(wtap* wth) { log3gpp_t* log3gpp = (log3gpp_t*)wth->priv; /* Also free this capture info */ diff --git a/wiretap/netscaler.c b/wiretap/netscaler.c index 76df5c27f2..d1490fe193 100644 --- a/wiretap/netscaler.c +++ b/wiretap/netscaler.c @@ -2026,7 +2026,7 @@ typedef struct { /* Returns 0 if we could write the specified encapsulation type, ** an error indication otherwise. */ -int nstrace_10_dump_can_write_encap(int encap) +static int nstrace_10_dump_can_write_encap(int encap) { if (encap == WTAP_ENCAP_NSTRACE_1_0) return 0; @@ -2037,7 +2037,7 @@ int nstrace_10_dump_can_write_encap(int encap) /* Returns 0 if we could write the specified encapsulation type, ** an error indication otherwise. */ -int nstrace_20_dump_can_write_encap(int encap) +static int nstrace_20_dump_can_write_encap(int encap) { if (encap == WTAP_ENCAP_NSTRACE_2_0) return 0; @@ -2047,7 +2047,7 @@ int nstrace_20_dump_can_write_encap(int encap) /* Returns 0 if we could write the specified encapsulation type, ** an error indication otherwise. */ -int nstrace_30_dump_can_write_encap(int encap) +static int nstrace_30_dump_can_write_encap(int encap) { if (encap == WTAP_ENCAP_NSTRACE_3_0) return 0; @@ -2057,7 +2057,7 @@ int nstrace_30_dump_can_write_encap(int encap) /* Returns 0 if we could write the specified encapsulation type, ** an error indication otherwise. */ -int nstrace_35_dump_can_write_encap(int encap) +static int nstrace_35_dump_can_write_encap(int encap) { if (encap == WTAP_ENCAP_NSTRACE_3_5) return 0; @@ -2467,7 +2467,7 @@ static const struct file_type_subtype_info nstrace_3_5_info = { nstrace_35_dump_can_write_encap, nstrace_35_dump_open, NULL }; -void register_netscaler(void) +void register_nstrace(void) { nstrace_1_0_file_type_subtype = wtap_register_file_type_subtype(&nstrace_1_0_info); nstrace_2_0_file_type_subtype = wtap_register_file_type_subtype(&nstrace_2_0_info); diff --git a/wiretap/netxray.c b/wiretap/netxray.c index ed759bf232..e450d703d7 100644 --- a/wiretap/netxray.c +++ b/wiretap/netxray.c @@ -1716,7 +1716,7 @@ wtap_encap_to_netxray_1_1_encap(int encap) /* Returns 0 if we could write the specified encapsulation type, an error indication otherwise. */ -int +static int netxray_dump_can_write_encap_1_1(int encap) { /* Per-packet encapsulations aren't supported. */ @@ -1731,7 +1731,7 @@ netxray_dump_can_write_encap_1_1(int encap) /* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on failure */ -gboolean +static gboolean netxray_dump_open_1_1(wtap_dumper *wdh, int *err, gchar **err_info _U_) { netxray_dump_t *netxray; @@ -1902,7 +1902,7 @@ wtap_encap_to_netxray_2_0_encap(int encap) /* Returns 0 if we could write the specified encapsulation type, an error indication otherwise. */ -int +static int netxray_dump_can_write_encap_2_0(int encap) { /* Per-packet encapsulations aren't supported. */ @@ -1917,7 +1917,7 @@ netxray_dump_can_write_encap_2_0(int encap) /* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on failure */ -gboolean +static gboolean netxray_dump_open_2_0(wtap_dumper *wdh, int *err, gchar **err_info _U_) { netxray_dump_t *netxray; diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index 5d6e97fc0d..dc9e25a4d1 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -131,7 +131,7 @@ typedef struct pcapng_name_resolution_block_s { /* * Minimum Sysdig size = minimum block size + packed size of sysdig_event_phdr. - * Minimum Sysdig event v2 header size = minimum block size + packed size of sysdig_event_v2_phdr (which, in addition + * Minimum Sysdig event v2 header size = minimum block size + packed size of sysdig_event_v2_phdr (which, in addition * to sysdig_event_phdr, includes the nparams 32bit value). */ #define SYSDIG_EVENT_HEADER_SIZE ((16 + 64 + 64 + 32 + 16)/8) /* CPU ID + TS + TID + Event len + Event type */ @@ -579,7 +579,7 @@ pcapng_process_string_option(wtapng_block_t *wblock, * will fail on the second and later occurrences of the option; * we silently ignore the failure. */ - wtap_block_add_string_option(wblock->block, ohp->option_code, option_content, ohp->option_length); + wtap_block_add_string_option(wblock->block, ohp->option_code, (const char *)option_content, ohp->option_length); } } @@ -1255,7 +1255,7 @@ pcapng_read_decryption_secrets_block(FILE_T fh, pcapng_block_header_t *bh, *err_info = g_strdup_printf("%s: secrets block is too large: %u", G_STRFUNC, dsb_mand->secrets_len); return FALSE; } - dsb_mand->secrets_data = (char *)g_malloc0(dsb_mand->secrets_len); + dsb_mand->secrets_data = (guint8 *)g_malloc0(dsb_mand->secrets_len); if (!wtap_read_bytes(fh, dsb_mand->secrets_data, dsb_mand->secrets_len, err, err_info)) { pcapng_debug("%s: failed to read DSB", G_STRFUNC); return FALSE; @@ -5070,7 +5070,7 @@ static gboolean pcapng_dump_finish(wtap_dumper *wdh, int *err, /* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on failure */ -gboolean +static gboolean pcapng_dump_open(wtap_dumper *wdh, int *err, gchar **err_info _U_) { guint i; @@ -5120,7 +5120,7 @@ pcapng_dump_open(wtap_dumper *wdh, int *err, gchar **err_info _U_) /* Returns 0 if we could write the specified encapsulation type, an error indication otherwise. */ -int pcapng_dump_can_write_encap(int wtap_encap) +static int pcapng_dump_can_write_encap(int wtap_encap) { pcapng_debug("pcapng_dump_can_write_encap: encap = %d (%s)", wtap_encap, diff --git a/wiretap/snoop.c b/wiretap/snoop.c index b2f207b589..89de11c32b 100644 --- a/wiretap/snoop.c +++ b/wiretap/snoop.c @@ -818,7 +818,7 @@ static const int wtap_encap[] = { /* Returns 0 if we could write the specified encapsulation type, an error indication otherwise. */ -int snoop_dump_can_write_encap(int encap) +static int snoop_dump_can_write_encap(int encap) { /* Per-packet encapsulations aren't supported. */ if (encap == WTAP_ENCAP_PER_PACKET) @@ -832,7 +832,7 @@ int snoop_dump_can_write_encap(int encap) /* Returns TRUE on success, FALSE on failure; sets "*err" to an error code on failure */ -gboolean snoop_dump_open(wtap_dumper *wdh, int *err, gchar **err_info _U_) +static gboolean snoop_dump_open(wtap_dumper *wdh, int *err, gchar **err_info _U_) { struct snoop_hdr file_hdr; |