A typo
V501 There are identical sub-expressions ‘stacking2->stacking’ to the left and to the right of the ‘>’ operator. ephysics_body.cpp 450
static int _ephysics_body_evas_stacking_sort_cb(const void *d1, const void *d2) { const EPhysics_Body_Evas_Stacking *stacking1, *stacking2; stacking1 = (const EPhysics_Body_Evas_Stacking *)d1; stacking2 = (const EPhysics_Body_Evas_Stacking *)d2; if (!stacking1) return 1; if (!stacking2) return -1; if (stacking1->stacking < stacking2->stacking) return -1; if (stacking2->stacking > stacking2->stacking) return 1; return 0; }
A Typo. The last comparison should be as follows:
if (stacking1->stacking > stacking2->stacking) return 1;
The error is in the comparison function, which echoes the topic of a recent article “Evil in the comparison functions“.
Please click here to see more bugs from this project.