[edk2,2/4] ShellPkg/UefiShellDebug1CommandsLib: remove unused but set variable

Message ID 1458800900-11913-3-git-send-email-ard.biesheuvel@linaro.org
State Accepted
Commit e36ed7a84b2768443de22371f0aad5cf502328b1
Headers show

Commit Message

Ard Biesheuvel March 24, 2016, 6:28 a.m.
Remove variable FStartRow that is declared, assigned but never referenced.
This fixes a warning emitted by GCC when -Wunused-but-set-variable is in
effect.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c | 4 ----
 1 file changed, 4 deletions(-)

-- 
1.9.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Laszlo Ersek March 24, 2016, 8 a.m. | #1
On 03/24/16 07:28, Ard Biesheuvel wrote:
> Remove variable FStartRow that is declared, assigned but never referenced.

> This fixes a warning emitted by GCC when -Wunused-but-set-variable is in

> effect.

> 

> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c | 4 ----

>  1 file changed, 4 deletions(-)

> 

> diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c

> index fb0c76e2e9db..5acd8d49f765 100644

> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c

> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c

> @@ -759,7 +759,6 @@ FileBufferRefresh (

>  

>    UINTN                   StartRow;

>    UINTN                   EndRow;

> -  UINTN                   FStartRow;

>    UINTN                   Tmp;

>  

>    Orig                  = MainEditor.ColorAttributes;

> @@ -832,8 +831,6 @@ FileBufferRefresh (

>          EndRow    = Tmp;

>        }

>  

> -      FStartRow = StartRow;

> -

>        StartRow  = 2 + StartRow - FileBuffer.LowVisibleRange.Row;

>        EndRow    = 2 + EndRow - FileBuffer.LowVisibleRange.Row;

>  

> @@ -841,7 +838,6 @@ FileBufferRefresh (

>        //

>        // not mouse selection actions

>        //

> -      FStartRow = FileBuffer.LowVisibleRange.Row;

>        StartRow  = 2;

>        EndRow    = (MainEditor.ScreenSize.Row - 1);

>      }

> 


Ah, so this fixes up a new issue; namely the one you reported in the

  [edk2] [PATCH] ShellPkg: Make the USB mouse behavior in 'edit'
                 consistent with 'hexedit'.

thread.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Patch

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
index fb0c76e2e9db..5acd8d49f765 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
@@ -759,7 +759,6 @@  FileBufferRefresh (
 
   UINTN                   StartRow;
   UINTN                   EndRow;
-  UINTN                   FStartRow;
   UINTN                   Tmp;
 
   Orig                  = MainEditor.ColorAttributes;
@@ -832,8 +831,6 @@  FileBufferRefresh (
         EndRow    = Tmp;
       }
 
-      FStartRow = StartRow;
-
       StartRow  = 2 + StartRow - FileBuffer.LowVisibleRange.Row;
       EndRow    = 2 + EndRow - FileBuffer.LowVisibleRange.Row;
 
@@ -841,7 +838,6 @@  FileBufferRefresh (
       //
       // not mouse selection actions
       //
-      FStartRow = FileBuffer.LowVisibleRange.Row;
       StartRow  = 2;
       EndRow    = (MainEditor.ScreenSize.Row - 1);
     }