Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: src/platform/vboot_reference/vboot_firmware/lib/cgptlib/quick_sort.c

Issue 2303003: Moved cgptlib into vboot_firmware (Closed) Base URL: ssh://gitrw.chromium.org/chromiumos
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/platform/vboot_reference/vboot_firmware/lib/cgptlib/include/quick_sort.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 #include "quick_sort.h" 5 #include "quick_sort.h"
6 #include <stdint.h> 6 #include <stdint.h>
7 #include "utility.h" 7 #include "utility.h"
8 8
9 /* Make sure we won't overflow the buffer. */ 9 /* Make sure we won't overflow the buffer. */
10 #define SAFE_SIZE(size) \ 10 #define SAFE_SIZE(size) \
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 pivot = (left + right) / 2; 50 pivot = (left + right) / 2;
51 pivot = Partition(compare_function, elements, size, left, right, pivot); 51 pivot = Partition(compare_function, elements, size, left, right, pivot);
52 RecursiveQuickSort(elements, left, pivot - 1, size, compare_function); 52 RecursiveQuickSort(elements, left, pivot - 1, size, compare_function);
53 RecursiveQuickSort(elements, pivot + 1, right, size, compare_function); 53 RecursiveQuickSort(elements, pivot + 1, right, size, compare_function);
54 } 54 }
55 55
56 void QuickSort(void *elements, int number_of_elements, int size, 56 void QuickSort(void *elements, int number_of_elements, int size,
57 int (*compare_function)(const void *a, const void *b)) { 57 int (*compare_function)(const void *a, const void *b)) {
58 RecursiveQuickSort(elements, 0, number_of_elements - 1, size, compare_function ); 58 RecursiveQuickSort(elements, 0, number_of_elements - 1, size, compare_function );
59 } 59 }
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/vboot_firmware/lib/cgptlib/include/quick_sort.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698