Correction to last commit

This commit is contained in:
Campbell Barton 2014-06-25 04:22:14 +10:00
parent df1c400420
commit d411e1548c
Notes: blender-bot 2023-02-14 10:26:03 +01:00
Referenced by issue #40800, If Viewport shading is 'Rendered', B3D crashes after browsing to file for texture node and connecting to any shader node.
4 changed files with 5 additions and 5 deletions

View File

@ -341,7 +341,7 @@ int buildNavMeshData(const int nverts, const float *verts,
trisMapping[i] = i;
context.recastData = recastData;
context.trisToFacesMap = trisToFacesMap;
BLI_qsort_r(trisMapping, ntris, sizeof(int), &context, compareByData);
BLI_qsort_r(trisMapping, ntris, sizeof(int), compareByData, &context);
/* search first valid triangle - triangle of convex polygon */
validTriStart = -1;

View File

@ -1344,7 +1344,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
}
if (orig_index) {
BLI_qsort_r(particle_element, totpart, sizeof(int), orig_index, distribute_compare_orig_index);
BLI_qsort_r(particle_element, totpart, sizeof(int), distribute_compare_orig_index, orig_index);
}
}

View File

@ -42,7 +42,7 @@
/* Quick sort reentrant */
typedef int (*BLI_sort_cmp_t)(const void *a, const void *b, void *ctx);
void BLI_qsort_r(void *a, size_t n, size_t es, void *thunk, BLI_sort_cmp_t cmp)
void BLI_qsort_r(void *a, size_t n, size_t es, BLI_sort_cmp_t cmp, void *thunk)
#ifdef __GNUC__
__attribute__((nonnull(1, 5)))
#endif

View File

@ -89,7 +89,7 @@ BLI_INLINE char *med3(char *a, char *b, char *c, BLI_sort_cmp_t cmp, void *thunk
*
* \note Follows BSD arg order (incompatible with glibc).
*/
void BLI_qsort_r(void *a, size_t n, size_t es, void *thunk, BLI_sort_cmp_t cmp)
void BLI_qsort_r(void *a, size_t n, size_t es, BLI_sort_cmp_t cmp, void *thunk)
{
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
int d, r, swaptype, swap_cnt;
@ -166,7 +166,7 @@ loop:
r = min(pd - pc, pn - pd - es);
vecswap(pb, pn - r, r);
if ((r = pb - pa) > es)
BLI_qsort_r(a, r / es, es, thunk, cmp);
BLI_qsort_r(a, r / es, es, cmp, thunk);
if ((r = pd - pc) > es) {
/* Iterate rather than recurse to save stack space */
a = pn - r;