sort array with comparator function inside NULLC
| 31 | |
| 32 | // sort array with comparator function inside NULLC |
| 33 | void BubbleSortArray(NULLCArray arr, NULLCFuncPtr comparator) |
| 34 | { |
| 35 | int *elem = (int*)arr.ptr; |
| 36 | |
| 37 | for(unsigned int k = 0; k < arr.len; k++) |
| 38 | { |
| 39 | for(unsigned int l = arr.len-1; l > k; l--) |
| 40 | { |
| 41 | nullcCallFunction(comparator, elem[l], elem[l-1]); |
| 42 | if(nullcGetResultInt()) |
| 43 | { |
| 44 | int tmp = elem[l]; |
| 45 | elem[l] = elem[l-1]; |
| 46 | elem[l-1] = tmp; |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | // function calls internal function |
| 53 | void RecallerCS(int x) |
nothing calls this directly
no test coverage detected