EFL Core Libraries


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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.