Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH v3] remove unused longindex #2173

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions example/classifier/odp_classifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,6 @@ static int parse_policy_ci_pass_count(appl_args_t *appl_args, char *optarg)
static int parse_args(int argc, char *argv[], appl_args_t *appl_args)
{
int opt;
int long_index;
size_t len;
int i;
int interface = 0;
Expand Down Expand Up @@ -1198,7 +1197,7 @@ static int parse_args(int argc, char *argv[], appl_args_t *appl_args)

while (ret == 0) {
opt = getopt_long(argc, argv, shortopts,
longopts, &long_index);
longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
4 changes: 2 additions & 2 deletions example/debug/odp_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void print_usage(void)

static int parse_options(int argc, char *argv[], test_global_t *global)
{
int opt, long_index;
int opt;
char *str;
uint32_t str_len = 0;

Expand All @@ -78,7 +78,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global)
int ret = 0;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions example/ipsec_api/odp_ipsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@ main(int argc, char *argv[])
static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
{
int opt;
int long_index;
char *token;
size_t len;
int rc = 0;
Expand Down Expand Up @@ -1216,7 +1215,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
printf("\nParsing command line options\n");

while (!rc) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (-1 == opt)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions example/ipsec_crypto/odp_ipsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,6 @@ main(int argc, char *argv[])
static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
{
int opt;
int long_index;
char *token;
size_t len;
int rc = 0;
Expand Down Expand Up @@ -1499,7 +1498,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
appl_args->mode = 0; /* turn off async crypto API by default */

while (!rc) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (-1 == opt)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions example/l3fwd/odp_l3fwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ static void print_usage(char *progname)
static void parse_cmdline_args(int argc, char *argv[], app_args_t *args)
{
int opt;
int long_index;
char *token, *local;
size_t len, route_index = 0;
int mem_failure = 0;
Expand All @@ -538,7 +537,7 @@ static void parse_cmdline_args(int argc, char *argv[], app_args_t *args)

while (1) {
opt = getopt_long(argc, argv, "+s:t:d:i:r:q:e:h",
longopts, &long_index);
longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
4 changes: 2 additions & 2 deletions example/packet/odp_packet_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static int parse_int_list(char *str, int integer[], int max_num)

static int parse_options(int argc, char *argv[], test_global_t *global)
{
int i, opt, long_index;
int i, opt;
char *name, *str;
int len, str_len, num;

Expand All @@ -128,7 +128,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global)
int ret = 0;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions example/packet/odp_pktio.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,6 @@ static void swap_pkt_addrs(odp_packet_t pkt_tbl[], unsigned len)
static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
{
int opt;
int long_index;
char *token;
size_t len;
int i;
Expand All @@ -605,7 +604,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
appl_args->time = 0; /**< loop forever */

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
4 changes: 2 additions & 2 deletions example/ping/odp_ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static void print_usage(void)

static int parse_options(int argc, char *argv[], test_global_t *global)
{
int i, opt, long_index;
int i, opt;
char *name, *str;
int len, str_len;

Expand All @@ -101,7 +101,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global)
int ret = 0;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions example/simple_pipeline/odp_simple_pipeline.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
char *token;
size_t len;
int opt;
int long_index;
int i;
int if_count = 0;
static const struct option longopts[] = {
Expand All @@ -588,7 +587,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
appl_args->extra_work = 0;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions example/switch/odp_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,6 @@ static void usage(char *progname)
static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
{
int opt;
int long_index;
char *token;
size_t len;
unsigned int i;
Expand All @@ -871,7 +870,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
appl_args->accuracy = 10; /* get and print pps stats second */

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions example/sysinfo/odp_sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,6 @@ static void parse_interfaces(appl_args_t *config, const char *optarg)
static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
{
int opt;
int long_index;
static const struct option longopts[] = {
{"interfaces", required_argument, NULL, 'i'},
{"help", no_argument, NULL, 'h'},
Expand All @@ -799,7 +798,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
static const char *shortopts = "i:h";

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions platform/linux-generic/test/pktio_ipc/ipc_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ odp_pktio_t create_pktio(odp_pool_t pool, int master_pid)
void parse_args(int argc, char *argv[])
{
int opt;
int long_index;
static struct option longopts[] = {
{"start-timeout", required_argument, NULL, 's'},
{"run-time", required_argument, NULL, 't'},
Expand All @@ -111,7 +110,7 @@ void parse_args(int argc, char *argv[])

while (1) {
opt = getopt_long(argc, argv, "+s:t:p:h",
longopts, &long_index);
longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
4 changes: 2 additions & 2 deletions test/miscellaneous/odp_dyn_workers.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static parse_result_t check_options(const global_config_t *config)

static parse_result_t parse_options(int argc, char **argv, global_config_t *config)
{
int opt, long_index;
int opt;

static const struct option longopts[] = {
{ "cpumasks", required_argument, NULL, 'c' },
Expand All @@ -361,7 +361,7 @@ static parse_result_t parse_options(int argc, char **argv, global_config_t *conf
init_options(config);

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break;
Expand Down
3 changes: 1 addition & 2 deletions test/performance/odp_atomic_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,6 @@ static int output_summary(test_global_t *global)
static int parse_options(int argc, char *argv[], test_options_t *test_options)
{
int opt;
int long_index;
int ret = 0;

static const struct option longopts[] = {
Expand All @@ -1167,7 +1166,7 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options)
test_options->private = 0;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break;
Expand Down
3 changes: 1 addition & 2 deletions test/performance/odp_bench_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ static void usage(char *progname)
static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
{
int opt;
int long_index;
static const struct option longopts[] = {
{"burst", required_argument, NULL, 'b'},
{"cache_size", required_argument, NULL, 'c'},
Expand All @@ -609,7 +608,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
appl_args->time = 0;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions test/performance/odp_bench_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,6 @@ static void usage(void)
static int parse_args(int argc, char *argv[])
{
int opt;
int long_index;
appl_args_t *appl_args = &gbl_args->appl;
static const struct option longopts[] = {
{"time", required_argument, NULL, 't'},
Expand All @@ -903,7 +902,7 @@ static int parse_args(int argc, char *argv[])
appl_args->rounds = ROUNDS;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions test/performance/odp_bench_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,6 @@ static void usage(char *progname)
static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
{
int opt;
int long_index;
static const struct option longopts[] = {
{"burst", required_argument, NULL, 'b'},
{"cache_size", required_argument, NULL, 'c'},
Expand All @@ -1576,7 +1575,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
appl_args->time = 0;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions test/performance/odp_bench_pktio_sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,6 @@ static int parse_args(int argc, char *argv[])
{
int i;
int opt;
int long_index;
static const struct option longopts[] = {
{"interface", required_argument, NULL, 'i'},
{"in_mode", required_argument, NULL, 'm'},
Expand All @@ -901,7 +900,7 @@ static int parse_args(int argc, char *argv[])
gbl_args->opt.num_pmr = 1;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions test/performance/odp_bench_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ static void usage(void)
static int parse_args(int argc, char *argv[])
{
int opt;
int long_index;
static const struct option longopts[] = {
{"clk_src", required_argument, NULL, 's'},
{"time", required_argument, NULL, 't'},
Expand All @@ -353,7 +352,7 @@ static int parse_args(int argc, char *argv[])
gbl_args->opt.rounds = ROUNDS;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions test/performance/odp_cpu_bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ static void usage(char *progname)
static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
{
int opt;
int long_index;

static const struct option longopts[] = {
{"accuracy", required_argument, NULL, 'a'},
Expand All @@ -396,7 +395,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
appl_args->time = 10; /* Loop forever if time to run is 0 */

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
3 changes: 1 addition & 2 deletions test/performance/odp_crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ static void print_usage(void)
static int parse_options(int argc, char *argv[])
{
int opt;
int long_index;
int ret = 0;

static const struct option longopts[] = {
Expand All @@ -79,7 +78,7 @@ static int parse_options(int argc, char *argv[])
options = options_def;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break;
Expand Down
3 changes: 1 addition & 2 deletions test/performance/odp_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,6 @@ int main(int argc, char *argv[])
static void parse_args(int argc, char *argv[], crypto_args_t *cargs)
{
int opt;
int long_index;
static const struct option longopts[] = {
{"algorithm", optional_argument, NULL, 'a'},
{"debug", no_argument, NULL, 'd'},
Expand All @@ -1410,7 +1409,7 @@ static void parse_args(int argc, char *argv[], crypto_args_t *cargs)
cargs->schedule = 0;

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break; /* No more options */
Expand Down
4 changes: 2 additions & 2 deletions test/performance/odp_dma_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ static parse_result_t check_options(prog_config_t *config)

static parse_result_t parse_options(int argc, char **argv, prog_config_t *config)
{
int opt, long_index;
int opt;
static const struct option longopts[] = {
{ "trs_type", required_argument, NULL, 't' },
{ "num_in_seg", required_argument, NULL, 'i' },
Expand All @@ -574,7 +574,7 @@ static parse_result_t parse_options(int argc, char **argv, prog_config_t *config
init_config(config);

while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
opt = getopt_long(argc, argv, shortopts, longopts, NULL);

if (opt == -1)
break;
Expand Down
Loading