VirtualBox

Ignore:
Timestamp:
Apr 14, 2023 3:17:44 PM (21 months ago)
Author:
vboxsync
Message:

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c

    r80721 r99404  
    1111#include "EditStatusBar.h"
    1212
    13 EDITOR_MENU_ITEM   *MenuItems;
    14 MENU_ITEM_FUNCTION *ControlBasedMenuFunctions;
    15 UINTN                 NumItems;
     13EDITOR_MENU_ITEM    *MenuItems;
     14MENU_ITEM_FUNCTION  *ControlBasedMenuFunctions;
     15UINTN               NumItems;
    1616
    1717/**
     
    2323  )
    2424{
    25   SHELL_FREE_NON_NULL(MenuItems);
     25  SHELL_FREE_NON_NULL (MenuItems);
    2626}
    2727
     
    4141  CONST EDITOR_MENU_ITEM  *ItemsWalker;
    4242
    43   for (NumItems = 0, ItemsWalker = Items ; ItemsWalker != NULL && ItemsWalker->Function != NULL ; ItemsWalker++,NumItems++);
    44 
    45   MenuItems = AllocateZeroPool((NumItems+1) * sizeof(EDITOR_MENU_ITEM));
     43  for (NumItems = 0, ItemsWalker = Items; ItemsWalker != NULL && ItemsWalker->Function != NULL; ItemsWalker++, NumItems++) {
     44  }
     45
     46  MenuItems = AllocateZeroPool ((NumItems+1) * sizeof (EDITOR_MENU_ITEM));
    4647  if (MenuItems == NULL) {
    4748    return EFI_OUT_OF_RESOURCES;
    4849  }
    49   CopyMem(MenuItems, Items, (NumItems+1) * sizeof(EDITOR_MENU_ITEM));
     50
     51  CopyMem (MenuItems, Items, (NumItems+1) * sizeof (EDITOR_MENU_ITEM));
    5052  return EFI_SUCCESS;
    5153}
     
    6668  return EFI_SUCCESS;
    6769}
     70
    6871/**
    6972  Refresh function for the menu bar.
     
    7679EFI_STATUS
    7780MenuBarRefresh (
    78   IN CONST UINTN LastRow,
    79   IN CONST UINTN LastCol
     81  IN CONST UINTN  LastRow,
     82  IN CONST UINTN  LastCol
    8083  )
    8184{
    8285  EDITOR_MENU_ITEM  *Item;
    83   UINTN                 Col;
    84   UINTN                 Row;
    85   UINTN                 Width;
    86   CHAR16                *NameString;
    87   CHAR16                *FunctionKeyString;
     86  UINTN             Col;
     87  UINTN             Row;
     88  UINTN             Width;
     89  CHAR16            *NameString;
     90  CHAR16            *FunctionKeyString;
    8891
    8992  //
     
    98101  EditorClearLine (LastRow - 2, LastCol, LastRow);
    99102  EditorClearLine (LastRow - 1, LastCol, LastRow);
    100   EditorClearLine (LastRow    , LastCol, LastRow);
    101 
     103  EditorClearLine (LastRow, LastCol, LastRow);
    102104
    103105  //
     
    105107  //
    106108  for (Item = MenuItems; Item != NULL && Item->Function != NULL; Item++) {
    107 
    108 
    109     NameString = HiiGetString(gShellDebug1HiiHandle, Item->NameToken, NULL);
    110 
    111 
    112     Width             = MAX ((StrLen (NameString) + 6), 20);
     109    NameString = HiiGetString (gShellDebug1HiiHandle, Item->NameToken, NULL);
     110
     111    Width = MAX ((StrLen (NameString) + 6), 20);
    113112    if (((Col + Width) > LastCol)) {
    114113      Row++;
     
    116115    }
    117116
    118     FunctionKeyString = HiiGetString(gShellDebug1HiiHandle, Item->FunctionKeyToken, NULL);
     117    FunctionKeyString = HiiGetString (gShellDebug1HiiHandle, Item->FunctionKeyToken, NULL);
    119118
    120119    ShellPrintEx ((INT32)(Col) - 1, (INT32)(Row) - 1, L"%E%s%N  %H%s%N  ", FunctionKeyString, NameString);
     
    139138EFI_STATUS
    140139MenuBarDispatchFunctionKey (
    141   IN CONST EFI_INPUT_KEY   *Key
    142   )
    143 {
    144   UINTN                 Index;
    145 
    146   Index     = Key->ScanCode - SCAN_F1;
     140  IN CONST EFI_INPUT_KEY  *Key
     141  )
     142{
     143  UINTN  Index;
     144
     145  Index = Key->ScanCode - SCAN_F1;
    147146
    148147  //
     
    168167EFI_STATUS
    169168MenuBarDispatchControlHotKey (
    170   IN CONST EFI_KEY_DATA   *KeyData
    171   )
    172 {
    173   UINT16                  ControlIndex;
     169  IN CONST EFI_KEY_DATA  *KeyData
     170  )
     171{
     172  UINT16  ControlIndex;
    174173
    175174  //
     
    179178
    180179  if (((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) ||
    181       (KeyData->KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID)) {
     180      (KeyData->KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID))
     181  {
    182182    //
    183183    // For consoles that don't support/report shift state,
     
    187187  } else if (((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) &&
    188188             ((KeyData->KeyState.KeyShiftState & (EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) != 0) &&
    189              ((KeyData->KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) == 0)) {
     189             ((KeyData->KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) == 0))
     190  {
    190191    //
    191192    // For consoles that supports/reports shift state,
     
    198199    }
    199200  }
    200   if ((SCAN_CONTROL_Z < ControlIndex)
    201     ||(NULL == ControlBasedMenuFunctions[ControlIndex]))
     201
     202  if (  (SCAN_CONTROL_Z < ControlIndex)
     203     || (NULL == ControlBasedMenuFunctions[ControlIndex]))
    202204  {
    203       return EFI_NOT_FOUND;
     205    return EFI_NOT_FOUND;
    204206  }
    205207
     
    207209  return EFI_SUCCESS;
    208210}
    209 
    210 
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette