Skip to content

Commit

Permalink
Rename parameter if_index to stop clang warning:
Browse files Browse the repository at this point in the history
capture_opts.c:1017:61: error: declaration of 'index' shadows a global declaration [-Werror=shadow]

Change-Id: Ie409b4fa7abeb85e460bea398735cdc98d9034b1
Reviewed-on: https://code.wireshark.org/review/3041
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
  • Loading branch information
Graham Bloice committed Jul 14, 2014
1 parent 5607620 commit e11db2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions capture_opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,11 +1014,11 @@ capture_opts_output_to_pipe(const char *save_file, gboolean *is_pipe)
}

void
capture_opts_del_iface(capture_options *capture_opts, guint index)
capture_opts_del_iface(capture_options *capture_opts, guint if_index)
{
interface_options interface_opts;

interface_opts = g_array_index(capture_opts->ifaces, interface_options, index);
interface_opts = g_array_index(capture_opts->ifaces, interface_options, if_index);
/* XXX - check if found? */

g_free(interface_opts.name);
Expand All @@ -1034,7 +1034,7 @@ capture_opts_del_iface(capture_options *capture_opts, guint index)
g_free(interface_opts.auth_password);
}
#endif
capture_opts->ifaces = g_array_remove_index(capture_opts->ifaces, index);
capture_opts->ifaces = g_array_remove_index(capture_opts->ifaces, if_index);
}


Expand Down
8 changes: 4 additions & 4 deletions capture_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define __CAPTURE_OPTS_H__

#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h> /* for gid_t */
# include <sys/types.h> /* for gid_t */
#endif

#include <caputils/capture_ifinfo.h>
Expand Down Expand Up @@ -76,7 +76,7 @@ extern "C" {

#if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
#define LONGOPT_BUFFER_SIZE \
{(char *)"buffer-size", required_argument, NULL, 'B'},
{(char *)"buffer-size", required_argument, NULL, 'B'},
#define OPTSTRING_B "B:"
#else
#define LONGOPT_BUFFER_SIZE
Expand Down Expand Up @@ -105,7 +105,7 @@ extern "C" {
{(char *)"linktype", required_argument, NULL, 'y'},

#define OPTSTRING_CAPTURE_COMMON \
"a:" OPTSTRING_A "b:" OPTSTRING_B "c:Df:i:" OPTSTRING_I "Lps:y:"
"a:" OPTSTRING_A "b:" OPTSTRING_B "c:Df:i:" OPTSTRING_I "Lps:y:"

#ifdef HAVE_PCAP_REMOTE
/* Type of capture source */
Expand Down Expand Up @@ -339,7 +339,7 @@ capture_opts_default_iface_if_necessary(capture_options *capture_opts,
const char *capture_device);

extern void
capture_opts_del_iface(capture_options *capture_opts, guint index);
capture_opts_del_iface(capture_options *capture_opts, guint if_index);

extern void
collect_ifaces(capture_options *capture_opts);
Expand Down

0 comments on commit e11db2e

Please sign in to comment.