X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FApplication%2FShellSortTestApp%2FShellSortTestApp.c;fp=ShellPkg%2FApplication%2FShellSortTestApp%2FShellSortTestApp.c;h=093633ee2706f7580a5c6271ced81724cd4194f6;hp=21eacac5e341885325f8dfc446ff8a73b663f650;hb=47d20b54f9a65b08aa602a1866c1b59a69088dfc;hpb=c411b485b63a671a1e276700cff025c73997233c diff --git a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c b/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c index 21eacac5e3..093633ee27 100644 --- a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c +++ b/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c @@ -24,14 +24,19 @@ **/ INTN EFIAPI -Test(CONST VOID *b1, CONST VOID *b2) +Test ( + CONST VOID *b1, + CONST VOID *b2 + ) { - if (*(INTN*)b1 == *(INTN*)b2) { + if (*(INTN *)b1 == *(INTN *)b2) { return (0); } - if (*(INTN*)b1 < *(INTN*)b2) { - return(-1); + + if (*(INTN *)b1 < *(INTN *)b2) { + return (-1); } + return (1); } @@ -52,11 +57,11 @@ Test(CONST VOID *b1, CONST VOID *b2) INTN EFIAPI ShellAppMain ( - IN UINTN Argc, - IN CHAR16 **Argv + IN UINTN Argc, + IN CHAR16 **Argv ) { - INTN Array[10]; + INTN Array[10]; Array[0] = 2; Array[1] = 3; @@ -69,9 +74,9 @@ ShellAppMain ( 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]); + 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; }