From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=dongao.guo@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AF75321A07A92 for ; Mon, 8 Oct 2018 18:49:02 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2018 18:49:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,358,1534834800"; d="scan'208";a="98573626" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga002.jf.intel.com with ESMTP; 08 Oct 2018 18:47:12 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Oct 2018 18:47:00 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Oct 2018 18:47:00 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.60]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.183]) with mapi id 14.03.0319.002; Tue, 9 Oct 2018 09:46:11 +0800 From: "Guo, Dongao" To: Gary Lin CC: "edk2-devel@lists.01.org" , "Gao, Liming" Thread-Topic: [edk2] [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable Thread-Index: AQHUXty/gP0z/+Ebt0O1bLygMowHhqUUlS0AgAGQi4A= Date: Tue, 9 Oct 2018 01:46:10 +0000 Message-ID: <77793CFC1A8C874A87FB311BFE8348660B8AAA90@SHSMSX101.ccr.corp.intel.com> References: <1538985408-16028-1-git-send-email-dongao.guo@intel.com> <20181008095138.GA18925@GaryWorkstation> In-Reply-To: <20181008095138.GA18925@GaryWorkstation> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDczMWE3ZGMtZGEzMS00MTRiLWIxMzEtNmNlMDkxM2M5NzRmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoic0pWS1Q2SU4yaWgzRVRaY3Q0ejFaZUJESXZvTGxtdXpKcjRKTWJWajh0RnV1ZE9JeFVTMXE4WWdmT2laVTRFSCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2018 01:49:02 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This code is based on oniguruma,a opensource regular expression project. So I want to keep the origin code as much as possible.And I distinguish my = changing by comment them out instead of removing. Actually the function is unused. Thanks, Dongao. -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Gary= Lin Sent: Monday, October 8, 2018 5:52 PM To: Guo, Dongao Cc: edk2-devel@lists.01.org; Gao, Liming Subject: Re: [edk2] [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused v= ariable On Mon, Oct 08, 2018 at 03:56:48PM +0800, Dongao Guo wrote: >=20 > comment unused variable to avoid warning,and modify inf build option. >=20 Why not just remove the variables altogether instead of commenting them out= ? Is it on purpose? Gary Lin > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Dongao Guo > --- > .../RegularExpressionDxe/Oniguruma/regexec.c | 28 +++++++++++-----= ------ > .../RegularExpressionDxe/RegularExpressionDxe.inf | 3 --- > 2 files changed, 14 insertions(+), 17 deletions(-) >=20 > diff --git=20 > a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c=20 > b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c > index 7b0fda0..26e7a31 100644 > --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c > +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c > @@ -5603,11 +5603,11 @@ onig_builtin_monitor(OnigCalloutArgs* args, void*= user_data) > int r; > int num; > size_t tag_len; > - const UChar* start; > - const UChar* right; > - const UChar* current; > - const UChar* string; > - const UChar* strend; > + // const UChar* start; > + // const UChar* right; > + // const UChar* current; > + // const UChar* string; > + // const UChar* strend; > const UChar* tag_start; > const UChar* tag_end; > regex_t* reg; > @@ -5615,9 +5615,9 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* u= ser_data) > OnigType type; > OnigValue val; > char buf[20]; > - FILE* fp; > + // FILE* fp; > =20 > - fp =3D OutFp; > + // fp =3D OutFp; > =20 > r =3D onig_get_arg_by_callout_args(args, 0, &type, &val); > if (r !=3D ONIG_NORMAL) return r; > @@ -5633,11 +5633,11 @@ onig_builtin_monitor(OnigCalloutArgs* args, void*= user_data) > } > =20 > num =3D onig_get_callout_num_by_callout_args(args); > - start =3D onig_get_start_by_callout_args(args); > - right =3D onig_get_right_range_by_callout_args(args); > - current =3D onig_get_current_by_callout_args(args); > - string =3D onig_get_string_by_callout_args(args); > - strend =3D onig_get_string_end_by_callout_args(args); > + // start =3D onig_get_start_by_callout_args(args); > + // right =3D onig_get_right_range_by_callout_args(args); > + // current =3D onig_get_current_by_callout_args(args); > + // string =3D onig_get_string_by_callout_args(args); > + // strend =3D onig_get_string_end_by_callout_args(args); > reg =3D onig_get_regex_by_callout_args(args); > tag_start =3D onig_get_callout_tag_start(reg, num); > tag_end =3D onig_get_callout_tag_end(reg, num); > @@ -5653,7 +5653,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* u= ser_data) > for (i =3D 0; i < tag_len; i++) buf[i] =3D tag_start[i]; > buf[tag_len] =3D '\0'; > } > - > +/* > fprintf(fp, "ONIG-MONITOR: %-4s %s at: %d [%d - %d] len: %d\n", > buf, > in =3D=3D ONIG_CALLOUT_IN_PROGRESS ? "=3D>" : "<=3D", @@ -5662= ,7=20 > +5662,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data) > (int )(right - string), > (int )(strend - string)); > //fflush(fp); > - > +*/ > return ONIG_CALLOUT_SUCCESS; > } > =20 > diff --git=20 > a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf=20 > b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf > index 16e91bd..98fb8db 100644 > ---=20 > a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf > +++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe > +++ .inf > @@ -106,6 +106,3 @@ > =20 > # Oniguruma: signed and unsigned mismatch/cast > MSFT:*_*_*_CC_FLAGS =3D /wd4018 /wd4245 /wd4389 > - > - # Oniguruma: error: variable 'fp' set but not used > - GCC:*_*_*_CC_FLAGS =3D -Wno-error=3Dunused-but-set-variable > -- > 1.9.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel >=20 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel