public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable
@ 2018-10-08  7:56 Dongao Guo
  2018-10-08  9:51 ` Gary Lin
  2018-10-10  0:55 ` Gao, Liming
  0 siblings, 2 replies; 4+ messages in thread
From: Dongao Guo @ 2018-10-08  7:56 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao


comment unused variable to avoid warning,and modify inf build option.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dongao Guo <dongao.guo@intel.com>
---
 .../RegularExpressionDxe/Oniguruma/regexec.c       | 28 +++++++++++-----------
 .../RegularExpressionDxe/RegularExpressionDxe.inf  |  3 ---
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c 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* user_data)
   OnigType type;
   OnigValue val;
   char buf[20];
-  FILE* fp;
+ // FILE* fp;
 
-  fp = OutFp;
+ // fp = OutFp;
 
   r = onig_get_arg_by_callout_args(args, 0, &type, &val);
   if (r != ONIG_NORMAL) return r;
@@ -5633,11 +5633,11 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data)
   }
 
   num       = onig_get_callout_num_by_callout_args(args);
-  start     = onig_get_start_by_callout_args(args);
-  right     = onig_get_right_range_by_callout_args(args);
-  current   = onig_get_current_by_callout_args(args);
-  string    = onig_get_string_by_callout_args(args);
-  strend    = onig_get_string_end_by_callout_args(args);
+ // start     = onig_get_start_by_callout_args(args);
+ // right     = onig_get_right_range_by_callout_args(args);
+ // current   = onig_get_current_by_callout_args(args);
+ // string    = onig_get_string_by_callout_args(args);
+ // strend    = onig_get_string_end_by_callout_args(args);
   reg       = onig_get_regex_by_callout_args(args);
   tag_start = onig_get_callout_tag_start(reg, num);
   tag_end   = onig_get_callout_tag_end(reg, num);
@@ -5653,7 +5653,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data)
     for (i = 0; i < tag_len; i++) buf[i] = tag_start[i];
     buf[tag_len] = '\0';
   }
-
+/*
   fprintf(fp, "ONIG-MONITOR: %-4s %s at: %d [%d - %d] len: %d\n",
           buf,
           in == ONIG_CALLOUT_IN_PROGRESS ? "=>" : "<=",
@@ -5662,7 +5662,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data)
           (int )(right   - string),
           (int )(strend  - string));
   //fflush(fp);
-
+*/
   return ONIG_CALLOUT_SUCCESS;
 }
 
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
index 16e91bd..98fb8db 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
@@ -106,6 +106,3 @@
 
   # Oniguruma: signed and unsigned mismatch/cast
   MSFT:*_*_*_CC_FLAGS = /wd4018 /wd4245 /wd4389
-
-  # Oniguruma: error: variable 'fp' set but not used
-  GCC:*_*_*_CC_FLAGS = -Wno-error=unused-but-set-variable
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable
  2018-10-08  7:56 [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable Dongao Guo
@ 2018-10-08  9:51 ` Gary Lin
  2018-10-09  1:46   ` Guo, Dongao
  2018-10-10  0:55 ` Gao, Liming
  1 sibling, 1 reply; 4+ messages in thread
From: Gary Lin @ 2018-10-08  9:51 UTC (permalink / raw)
  To: Dongao Guo; +Cc: edk2-devel, Liming Gao

On Mon, Oct 08, 2018 at 03:56:48PM +0800, Dongao Guo wrote:
> 
> comment unused variable to avoid warning,and modify inf build option.
> 
Why not just remove the variables altogether instead of commenting them out?
Is it on purpose?

Gary Lin

> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dongao Guo <dongao.guo@intel.com>
> ---
>  .../RegularExpressionDxe/Oniguruma/regexec.c       | 28 +++++++++++-----------
>  .../RegularExpressionDxe/RegularExpressionDxe.inf  |  3 ---
>  2 files changed, 14 insertions(+), 17 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c 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* user_data)
>    OnigType type;
>    OnigValue val;
>    char buf[20];
> -  FILE* fp;
> + // FILE* fp;
>  
> -  fp = OutFp;
> + // fp = OutFp;
>  
>    r = onig_get_arg_by_callout_args(args, 0, &type, &val);
>    if (r != ONIG_NORMAL) return r;
> @@ -5633,11 +5633,11 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data)
>    }
>  
>    num       = onig_get_callout_num_by_callout_args(args);
> -  start     = onig_get_start_by_callout_args(args);
> -  right     = onig_get_right_range_by_callout_args(args);
> -  current   = onig_get_current_by_callout_args(args);
> -  string    = onig_get_string_by_callout_args(args);
> -  strend    = onig_get_string_end_by_callout_args(args);
> + // start     = onig_get_start_by_callout_args(args);
> + // right     = onig_get_right_range_by_callout_args(args);
> + // current   = onig_get_current_by_callout_args(args);
> + // string    = onig_get_string_by_callout_args(args);
> + // strend    = onig_get_string_end_by_callout_args(args);
>    reg       = onig_get_regex_by_callout_args(args);
>    tag_start = onig_get_callout_tag_start(reg, num);
>    tag_end   = onig_get_callout_tag_end(reg, num);
> @@ -5653,7 +5653,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data)
>      for (i = 0; i < tag_len; i++) buf[i] = tag_start[i];
>      buf[tag_len] = '\0';
>    }
> -
> +/*
>    fprintf(fp, "ONIG-MONITOR: %-4s %s at: %d [%d - %d] len: %d\n",
>            buf,
>            in == ONIG_CALLOUT_IN_PROGRESS ? "=>" : "<=",
> @@ -5662,7 +5662,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data)
>            (int )(right   - string),
>            (int )(strend  - string));
>    //fflush(fp);
> -
> +*/
>    return ONIG_CALLOUT_SUCCESS;
>  }
>  
> diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
> index 16e91bd..98fb8db 100644
> --- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
> +++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
> @@ -106,6 +106,3 @@
>  
>    # Oniguruma: signed and unsigned mismatch/cast
>    MSFT:*_*_*_CC_FLAGS = /wd4018 /wd4245 /wd4389
> -
> -  # Oniguruma: error: variable 'fp' set but not used
> -  GCC:*_*_*_CC_FLAGS = -Wno-error=unused-but-set-variable
> -- 
> 1.9.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable
  2018-10-08  9:51 ` Gary Lin
@ 2018-10-09  1:46   ` Guo, Dongao
  0 siblings, 0 replies; 4+ messages in thread
From: Guo, Dongao @ 2018-10-09  1:46 UTC (permalink / raw)
  To: Gary Lin; +Cc: edk2-devel@lists.01.org, Gao, Liming

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 <dongao.guo@intel.com>
Cc: edk2-devel@lists.01.org; Gao, Liming <liming.gao@intel.com>
Subject: Re: [edk2] [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable

On Mon, Oct 08, 2018 at 03:56:48PM +0800, Dongao Guo wrote:
> 
> comment unused variable to avoid warning,and modify inf build option.
> 
Why not just remove the variables altogether instead of commenting them out?
Is it on purpose?

Gary Lin

> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dongao Guo <dongao.guo@intel.com>
> ---
>  .../RegularExpressionDxe/Oniguruma/regexec.c       | 28 +++++++++++-----------
>  .../RegularExpressionDxe/RegularExpressionDxe.inf  |  3 ---
>  2 files changed, 14 insertions(+), 17 deletions(-)
> 
> diff --git 
> a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c 
> 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* user_data)
>    OnigType type;
>    OnigValue val;
>    char buf[20];
> -  FILE* fp;
> + // FILE* fp;
>  
> -  fp = OutFp;
> + // fp = OutFp;
>  
>    r = onig_get_arg_by_callout_args(args, 0, &type, &val);
>    if (r != ONIG_NORMAL) return r;
> @@ -5633,11 +5633,11 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data)
>    }
>  
>    num       = onig_get_callout_num_by_callout_args(args);
> -  start     = onig_get_start_by_callout_args(args);
> -  right     = onig_get_right_range_by_callout_args(args);
> -  current   = onig_get_current_by_callout_args(args);
> -  string    = onig_get_string_by_callout_args(args);
> -  strend    = onig_get_string_end_by_callout_args(args);
> + // start     = onig_get_start_by_callout_args(args);
> + // right     = onig_get_right_range_by_callout_args(args);
> + // current   = onig_get_current_by_callout_args(args);
> + // string    = onig_get_string_by_callout_args(args);
> + // strend    = onig_get_string_end_by_callout_args(args);
>    reg       = onig_get_regex_by_callout_args(args);
>    tag_start = onig_get_callout_tag_start(reg, num);
>    tag_end   = onig_get_callout_tag_end(reg, num);
> @@ -5653,7 +5653,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data)
>      for (i = 0; i < tag_len; i++) buf[i] = tag_start[i];
>      buf[tag_len] = '\0';
>    }
> -
> +/*
>    fprintf(fp, "ONIG-MONITOR: %-4s %s at: %d [%d - %d] len: %d\n",
>            buf,
>            in == ONIG_CALLOUT_IN_PROGRESS ? "=>" : "<=", @@ -5662,7 
> +5662,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void* user_data)
>            (int )(right   - string),
>            (int )(strend  - string));
>    //fflush(fp);
> -
> +*/
>    return ONIG_CALLOUT_SUCCESS;
>  }
>  
> diff --git 
> a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf 
> b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
> index 16e91bd..98fb8db 100644
> --- 
> a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
> +++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe
> +++ .inf
> @@ -106,6 +106,3 @@
>  
>    # Oniguruma: signed and unsigned mismatch/cast
>    MSFT:*_*_*_CC_FLAGS = /wd4018 /wd4245 /wd4389
> -
> -  # Oniguruma: error: variable 'fp' set but not used
> -  GCC:*_*_*_CC_FLAGS = -Wno-error=unused-but-set-variable
> --
> 1.9.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable
  2018-10-08  7:56 [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable Dongao Guo
  2018-10-08  9:51 ` Gary Lin
@ 2018-10-10  0:55 ` Gao, Liming
  1 sibling, 0 replies; 4+ messages in thread
From: Gao, Liming @ 2018-10-10  0:55 UTC (permalink / raw)
  To: Guo, Dongao, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Guo, Dongao
>Sent: Monday, October 08, 2018 3:57 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused
>variable
>
>
>comment unused variable to avoid warning,and modify inf build option.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Dongao Guo <dongao.guo@intel.com>
>---
> .../RegularExpressionDxe/Oniguruma/regexec.c       | 28 +++++++++++--------
>---
> .../RegularExpressionDxe/RegularExpressionDxe.inf  |  3 ---
> 2 files changed, 14 insertions(+), 17 deletions(-)
>
>diff --git
>a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regexec.c
>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*
>user_data)
>   OnigType type;
>   OnigValue val;
>   char buf[20];
>-  FILE* fp;
>+ // FILE* fp;
>
>-  fp = OutFp;
>+ // fp = OutFp;
>
>   r = onig_get_arg_by_callout_args(args, 0, &type, &val);
>   if (r != ONIG_NORMAL) return r;
>@@ -5633,11 +5633,11 @@ onig_builtin_monitor(OnigCalloutArgs* args,
>void* user_data)
>   }
>
>   num       = onig_get_callout_num_by_callout_args(args);
>-  start     = onig_get_start_by_callout_args(args);
>-  right     = onig_get_right_range_by_callout_args(args);
>-  current   = onig_get_current_by_callout_args(args);
>-  string    = onig_get_string_by_callout_args(args);
>-  strend    = onig_get_string_end_by_callout_args(args);
>+ // start     = onig_get_start_by_callout_args(args);
>+ // right     = onig_get_right_range_by_callout_args(args);
>+ // current   = onig_get_current_by_callout_args(args);
>+ // string    = onig_get_string_by_callout_args(args);
>+ // strend    = onig_get_string_end_by_callout_args(args);
>   reg       = onig_get_regex_by_callout_args(args);
>   tag_start = onig_get_callout_tag_start(reg, num);
>   tag_end   = onig_get_callout_tag_end(reg, num);
>@@ -5653,7 +5653,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void*
>user_data)
>     for (i = 0; i < tag_len; i++) buf[i] = tag_start[i];
>     buf[tag_len] = '\0';
>   }
>-
>+/*
>   fprintf(fp, "ONIG-MONITOR: %-4s %s at: %d [%d - %d] len: %d\n",
>           buf,
>           in == ONIG_CALLOUT_IN_PROGRESS ? "=>" : "<=",
>@@ -5662,7 +5662,7 @@ onig_builtin_monitor(OnigCalloutArgs* args, void*
>user_data)
>           (int )(right   - string),
>           (int )(strend  - string));
>   //fflush(fp);
>-
>+*/
>   return ONIG_CALLOUT_SUCCESS;
> }
>
>diff --git
>a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.in
>f
>b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.in
>f
>index 16e91bd..98fb8db 100644
>---
>a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.in
>f
>+++
>b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.in
>f
>@@ -106,6 +106,3 @@
>
>   # Oniguruma: signed and unsigned mismatch/cast
>   MSFT:*_*_*_CC_FLAGS = /wd4018 /wd4245 /wd4389
>-
>-  # Oniguruma: error: variable 'fp' set but not used
>-  GCC:*_*_*_CC_FLAGS = -Wno-error=unused-but-set-variable
>--
>1.9.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-10  0:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-08  7:56 [PATCH] MdeModulePkg/RegularExpressionDxe:omit unused variable Dongao Guo
2018-10-08  9:51 ` Gary Lin
2018-10-09  1:46   ` Guo, Dongao
2018-10-10  0:55 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox