From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by dpdk.org (Postfix) with ESMTP id A3CD48DAC for ; Sat, 3 Oct 2015 12:15:21 +0200 (CEST) Received: by lbcao8 with SMTP id ao8so37446317lbc.3 for ; Sat, 03 Oct 2015 03:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=khsvEKXm/P9G42/T11wr7bhUZw8xDcX4fWX507DkaZQ=; b=Or8Pne4VQ6Q2vlMEYrMaN20XFEmVKUe1vM7rPROykniUeyzXYXkBgHBozS2vKurOhj EkZJbGrgadFEtDoV71zUGSGn89toOLqpsrKqJ86PDHKoJW4Nd5oBHkK2yu98mbMnF60h i+ynKeaA2e6MhyFu/uwTt51WzUTOPHqUq2VeWKLi2te3ecm7AiSx4e3bOGH0WL0Vd0sl MyEPLPSg7Rr+NsenU16Z1aJyRsk0hWHakeZOEBbTavDqCHgqDRsQCMDruMdh6ug3nM89 05kjo9tlJZZmy4IASq3g/+SHUXzLEXV9Bs13xOJs4rdq+WchgtDuoJV0IVcqVVWGk/L3 2Jqg== X-Received: by 10.25.26.71 with SMTP id a68mr4923378lfa.109.1443867321057; Sat, 03 Oct 2015 03:15:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.173.179 with HTTP; Sat, 3 Oct 2015 03:14:41 -0700 (PDT) In-Reply-To: <1443509581-27823-1-git-send-email-christoph.gysin@gmail.com> References: <1443509581-27823-1-git-send-email-christoph.gysin@gmail.com> From: Christoph Gysin Date: Sat, 3 Oct 2015 13:14:41 +0300 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH] eal: fix C++ build (struct member: virtual) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2015 10:15:21 -0000 I added the Signed-off, is there anything else missing? Any chance to get this merged? On Tue, Sep 29, 2015 at 9:53 AM, Christoph Gysin wrote: > 'virtual' is a keyword and can't be used if the code is to compile with > C++ compilers. > > If rte_devargs.h was included in C++ code, compilation with clang++ > failed with an error. g++ did not fail, but only because of a bug > that treats it as an anonymous struct with a decl-specifier which it > ignores. > > This simply renames the member to 'virt'. > > Signed-off-by: Christoph Gysin > --- > app/test/test_devargs.c | 4 ++-- > lib/librte_eal/common/eal_common_dev.c | 4 ++-- > lib/librte_eal/common/eal_common_devargs.c | 8 ++++---- > lib/librte_eal/common/include/rte_devargs.h | 2 +- > 4 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c > index f7fc59c..049f32d 100644 > --- a/app/test/test_devargs.c > +++ b/app/test/test_devargs.c > @@ -91,8 +91,8 @@ test_devargs(void) > if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, "eth_ring1,k1=val,k2=val2") < 0) > goto fail; > devargs = TAILQ_FIRST(&devargs_list); > - if (strncmp(devargs->virtual.drv_name, "eth_ring1", > - sizeof(devargs->virtual.drv_name)) != 0) > + if (strncmp(devargs->virt.drv_name, "eth_ring1", > + sizeof(devargs->virt.drv_name)) != 0) > goto fail; > if (!devargs->args || strcmp(devargs->args, "k1=val,k2=val2") != 0) > goto fail; > diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c > index 4089d66..a8a4146 100644 > --- a/lib/librte_eal/common/eal_common_dev.c > +++ b/lib/librte_eal/common/eal_common_dev.c > @@ -107,10 +107,10 @@ rte_eal_dev_init(void) > if (devargs->type != RTE_DEVTYPE_VIRTUAL) > continue; > > - if (rte_eal_vdev_init(devargs->virtual.drv_name, > + if (rte_eal_vdev_init(devargs->virt.drv_name, > devargs->args)) { > RTE_LOG(ERR, EAL, "failed to initialize %s device\n", > - devargs->virtual.drv_name); > + devargs->virt.drv_name); > return -1; > } > } > diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c > index ec56165..5d075d0 100644 > --- a/lib/librte_eal/common/eal_common_devargs.c > +++ b/lib/librte_eal/common/eal_common_devargs.c > @@ -107,9 +107,9 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) > break; > case RTE_DEVTYPE_VIRTUAL: > /* save driver name */ > - ret = snprintf(devargs->virtual.drv_name, > - sizeof(devargs->virtual.drv_name), "%s", buf); > - if (ret < 0 || ret >= (int)sizeof(devargs->virtual.drv_name)) > + ret = snprintf(devargs->virt.drv_name, > + sizeof(devargs->virt.drv_name), "%s", buf); > + if (ret < 0 || ret >= (int)sizeof(devargs->virt.drv_name)) > goto fail; > > break; > @@ -169,7 +169,7 @@ rte_eal_devargs_dump(FILE *f) > devargs->args); > else if (devargs->type == RTE_DEVTYPE_VIRTUAL) > fprintf(f, " VIRTUAL %s %s\n", > - devargs->virtual.drv_name, > + devargs->virt.drv_name, > devargs->args); > else > fprintf(f, " UNKNOWN %s\n", devargs->args); > diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h > index 7084ae2..53c59f5 100644 > --- a/lib/librte_eal/common/include/rte_devargs.h > +++ b/lib/librte_eal/common/include/rte_devargs.h > @@ -86,7 +86,7 @@ struct rte_devargs { > struct { > /** Driver name. */ > char drv_name[32]; > - } virtual; > + } virt; > }; > /** Arguments string as given by user or "" for no argument. */ > char *args; > -- > 2.5.3 > -- echo mailto: NOSPAM !#$.'<*>'|sed 's. ..'|tr "<*> !#:2" org@fr33z3