#89 closed defect (fixed)
psListSort compare function prototype (plus psSort questions)
| Reported by: | Owned by: | eugene | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I needed to change the compare function prototype from:
int compare(void*,void*)
to
int compare(void,void)
since a psList has void* data elements and to use qsort (as required by the
ADD), I needed to convert the list to a psVector of void* elements and call
qsort of that (hence, the qsort compare function needed pointers to void*, i.e.,
void).
Also, the psSort function does not take a compare function, but maybe should to
make things match.
I've created a set of generic compare functions along with the psListSort to
handle sorting of numeric types. These could be used for psSort as well (which
may be better called psVectorSort?).

if we re-organize, as i specified in bug 75, to have psArray be our container of
void * elements and psVector only a numerical array, then:
should become psListToArray anyway).
compare function?
I agree with the name changes: psSort -> psVectorSort (but also psArraySort)