From af34f014f33e39af5f77e3bcdd66f05b3bd9aa39 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 17 Mar 2018 12:41:24 +0100 Subject: [PATCH] Avoid "optarg" as an identifier On SylixOS, it is defined as a macro. --- common.c | 14 +++++++------- pciutils.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common.c b/common.c index 9cd72be..c5a3c8f 100644 --- a/common.c +++ b/common.c @@ -99,34 +99,34 @@ set_pci_option(struct pci_access *pacc, char *arg) } int -parse_generic_option(int i, struct pci_access *pacc, char *optarg) +parse_generic_option(int i, struct pci_access *pacc, char *arg) { switch (i) { #ifdef PCI_HAVE_PM_INTEL_CONF case 'H': - if (!strcmp(optarg, "1")) + if (!strcmp(arg, "1")) pacc->method = PCI_ACCESS_I386_TYPE1; - else if (!strcmp(optarg, "2")) + else if (!strcmp(arg, "2")) pacc->method = PCI_ACCESS_I386_TYPE2; else - die("Unknown hardware configuration type %s", optarg); + die("Unknown hardware configuration type %s", arg); break; #endif #ifdef PCI_HAVE_PM_DUMP case 'F': - pci_set_param(pacc, "dump.name", optarg); + pci_set_param(pacc, "dump.name", arg); pacc->method = PCI_ACCESS_DUMP; break; #endif case 'A': - set_pci_method(pacc, optarg); + set_pci_method(pacc, arg); break; case 'G': pacc->debugging++; break; case 'O': - set_pci_option(pacc, optarg); + set_pci_option(pacc, arg); break; default: return 0; diff --git a/pciutils.h b/pciutils.h index 1de2b01..3c5fac6 100644 --- a/pciutils.h +++ b/pciutils.h @@ -1,7 +1,7 @@ /* * The PCI Utilities -- Declarations * - * Copyright (c) 1997--2016 Martin Mares + * Copyright (c) 1997--2018 Martin Mares * * Can be freely distributed and used under the terms of the GNU GPL. */ @@ -23,7 +23,7 @@ void die(char *msg, ...) NONRET PCI_PRINTF(1,2); void *xmalloc(size_t howmuch); void *xrealloc(void *ptr, size_t howmuch); char *xstrdup(const char *str); -int parse_generic_option(int i, struct pci_access *pacc, char *optarg); +int parse_generic_option(int i, struct pci_access *pacc, char *arg); #ifdef PCI_HAVE_PM_INTEL_CONF #define GENOPT_INTEL "H:" -- 2.39.2