Changeset 6c441cf8 in mainline for kernel/generic/src/lib/sort.c
- Timestamp:
- 2008-02-27T11:49:17Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 56976a17
- Parents:
- fdb7795
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/lib/sort.c
rfdb7795 r6c441cf8 97 97 { 98 98 if (n > 4) { 99 int i = 0, j = n - 1;99 unsigned int i = 0, j = n - 1; 100 100 101 101 memcpy(pivot, data, e_size); 102 102 103 103 while (1) { 104 while ((cmp(data + i * e_size, pivot) < 0) && i < n) i++; 105 while ((cmp(data + j * e_size, pivot) >=0) && j > 0) j--; 106 if (i<j) { 104 while ((cmp(data + i * e_size, pivot) < 0) && (i < n)) 105 i++; 106 while ((cmp(data + j * e_size, pivot) >= 0) && (j > 0)) 107 j--; 108 109 if (i < j) { 107 110 memcpy(tmp, data + i * e_size, e_size); 108 111 memcpy(data + i * e_size, data + j * e_size, e_size);
Note:
See TracChangeset
for help on using the changeset viewer.