diff options
| author | kx <kx@radix.pro> | 2024-06-04 06:43:08 +0300 |
|---|---|---|
| committer | kx <kx@radix.pro> | 2024-06-04 06:43:08 +0300 |
| commit | 7e2ccccace24636f29ddc210b94606abd4c7e42b (patch) | |
| tree | 545d43ea12671048956cafeb12303e84d601e571 /ShellPkg/Application/ShellSortTestApp | |
| parent | 27b044605cd5f6b33a3d231576003850b3fe305b (diff) | |
| download | edk2-trunk.tar.xz | |
Renormalized end-of-lines from master@27b044605cd5f6b33a3d231576003850b3fe305btrunk
Diffstat (limited to 'ShellPkg/Application/ShellSortTestApp')
| -rw-r--r-- | ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c | 164 | ||||
| -rw-r--r-- | ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf | 74 |
2 files changed, 119 insertions, 119 deletions
diff --git a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c b/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c index 093633ee27..979c05b8a1 100644 --- a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c +++ b/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c @@ -1,82 +1,82 @@ -/** @file
- This is a test application that demonstrates how to use the sorting functions.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <Uefi.h>
-#include <Library/UefiLib.h>
-#include <Library/DebugLib.h>
-#include <Library/ShellCEntryLib.h>
-#include <Library/SortLib.h>
-
-/**
- Test comparator.
-
- @param[in] b1 The first INTN
- @param[in] b2 The other INTN
-
- @retval 0 They are the same.
- @retval -1 b1 is less than b2
- @retval 1 b1 is greater then b2
-**/
-INTN
-EFIAPI
-Test (
- CONST VOID *b1,
- CONST VOID *b2
- )
-{
- if (*(INTN *)b1 == *(INTN *)b2) {
- return (0);
- }
-
- if (*(INTN *)b1 < *(INTN *)b2) {
- return (-1);
- }
-
- return (1);
-}
-
-/**
- UEFI application entry point which has an interface similar to a
- standard C main function.
-
- The ShellCEntryLib library instance wrappers the actual UEFI application
- entry point and calls this ShellAppMain function.
-
- @param Argc Argument count
- @param Argv The parsed arguments
-
- @retval 0 The application exited normally.
- @retval Other An error occurred.
-
-**/
-INTN
-EFIAPI
-ShellAppMain (
- IN UINTN Argc,
- IN CHAR16 **Argv
- )
-{
- INTN Array[10];
-
- Array[0] = 2;
- Array[1] = 3;
- Array[2] = 4;
- Array[3] = 1;
- Array[4] = 5;
- Array[5] = 6;
- Array[6] = 7;
- Array[7] = 8;
- Array[8] = 1;
- Array[9] = 5;
-
- Print (L"Array = %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\r\n", Array[0], Array[1], Array[2], Array[3], Array[4], Array[5], Array[6], Array[7], Array[8], Array[9]);
- PerformQuickSort (Array, 10, sizeof (INTN), Test);
- Print (L"POST-SORT\r\n");
- Print (L"Array = %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\r\n", Array[0], Array[1], Array[2], Array[3], Array[4], Array[5], Array[6], Array[7], Array[8], Array[9]);
- return 0;
-}
+/** @file + This is a test application that demonstrates how to use the sorting functions. + + Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include <Uefi.h> +#include <Library/UefiLib.h> +#include <Library/DebugLib.h> +#include <Library/ShellCEntryLib.h> +#include <Library/SortLib.h> + +/** + Test comparator. + + @param[in] b1 The first INTN + @param[in] b2 The other INTN + + @retval 0 They are the same. + @retval -1 b1 is less than b2 + @retval 1 b1 is greater then b2 +**/ +INTN +EFIAPI +Test ( + CONST VOID *b1, + CONST VOID *b2 + ) +{ + if (*(INTN *)b1 == *(INTN *)b2) { + return (0); + } + + if (*(INTN *)b1 < *(INTN *)b2) { + return (-1); + } + + return (1); +} + +/** + UEFI application entry point which has an interface similar to a + standard C main function. + + The ShellCEntryLib library instance wrappers the actual UEFI application + entry point and calls this ShellAppMain function. + + @param Argc Argument count + @param Argv The parsed arguments + + @retval 0 The application exited normally. + @retval Other An error occurred. + +**/ +INTN +EFIAPI +ShellAppMain ( + IN UINTN Argc, + IN CHAR16 **Argv + ) +{ + INTN Array[10]; + + Array[0] = 2; + Array[1] = 3; + Array[2] = 4; + Array[3] = 1; + Array[4] = 5; + Array[5] = 6; + Array[6] = 7; + Array[7] = 8; + Array[8] = 1; + Array[9] = 5; + + Print (L"Array = %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\r\n", Array[0], Array[1], Array[2], Array[3], Array[4], Array[5], Array[6], Array[7], Array[8], Array[9]); + PerformQuickSort (Array, 10, sizeof (INTN), Test); + Print (L"POST-SORT\r\n"); + Print (L"Array = %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\r\n", Array[0], Array[1], Array[2], Array[3], Array[4], Array[5], Array[6], Array[7], Array[8], Array[9]); + return 0; +} diff --git a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf b/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf index 399b997230..9b2c12377b 100644 --- a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf +++ b/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf @@ -1,37 +1,37 @@ -## @file
-# This is the shell sorting testing application
-#
-# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = ShellSortTestApp
- FILE_GUID = 079E8E98-AE93-4b9a-8A71-1DC869F23E09
- MODULE_TYPE = UEFI_APPLICATION
- VERSION_STRING = 1.0
- ENTRY_POINT = ShellCEntryLib
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC
-#
-
-[Sources]
- ShellSortTestApp.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- ShellCEntryLib
- UefiLib
- SortLib
-
+## @file +# This is the shell sorting testing application +# +# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION = 0x00010006 + BASE_NAME = ShellSortTestApp + FILE_GUID = 079E8E98-AE93-4b9a-8A71-1DC869F23E09 + MODULE_TYPE = UEFI_APPLICATION + VERSION_STRING = 1.0 + ENTRY_POINT = ShellCEntryLib + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 EBC +# + +[Sources] + ShellSortTestApp.c + +[Packages] + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + ShellCEntryLib + UefiLib + SortLib + |
