]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c
ShellPkg: Fix EFIAPI usage inconsistencies
[mirror_edk2.git] / ShellPkg / Application / ShellSortTestApp / ShellSortTestApp.c
... / ...
CommitLineData
1/** @file\r
2 This is a test application that demonstrates how to use the sorting functions.\r
3\r
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include <Uefi.h>\r
16#include <Library/UefiLib.h>\r
17#include <Library/DebugLib.h>\r
18#include <Library/ShellCEntryLib.h>\r
19#include <Library/SortLib.h>\r
20\r
21INTN\r
22EFIAPI\r
23Test(CONST VOID*b1, CONST VOID*b2)\r
24{\r
25 if (*(INTN*)b1 == *(INTN*)b2) {\r
26 return (0);\r
27 }\r
28 if (*(INTN*)b1 < *(INTN*)b2) {\r
29 return(-1);\r
30 }\r
31 return (1);\r
32}\r
33\r
34/**\r
35 UEFI application entry point which has an interface similar to a\r
36 standard C main function.\r
37\r
38 The ShellCEntryLib library instance wrappers the actual UEFI application\r
39 entry point and calls this ShellAppMain function.\r
40\r
41 @param ImageHandle The image handle of the UEFI Application.\r
42 @param SystemTable A pointer to the EFI System Table.\r
43\r
44 @retval 0 The application exited normally.\r
45 @retval Other An error occurred.\r
46\r
47**/\r
48INTN\r
49EFIAPI\r
50ShellAppMain (\r
51 IN UINTN Argc,\r
52 IN CHAR16 **Argv\r
53 )\r
54{\r
55 INTN Array[10] = {2,3,4,1,5,6,7,8,1,5};\r
56 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]);\r
57 PerformQuickSort(Array, 10, sizeof(INTN), Test);\r
58 Print(L"POST-SORT\r\n");\r
59 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]);\r
60 return 0;\r
61}\r