platform: fix check in NMP_CLASS_IS_VALID

Maybe it was not wrong before, but this looks more
correct.
This commit is contained in:
Thomas Haller 2017-03-09 15:12:05 +01:00
parent 2972fd55bf
commit 3799874664

View file

@ -307,7 +307,7 @@ NMP_CLASS_IS_VALID (const NMPClass *klass)
{
return klass >= &_nmp_classes[0]
&& klass <= &_nmp_classes[G_N_ELEMENTS (_nmp_classes)]
&& ((((char *) klass) - ((char *) NULL)) % (&_nmp_classes[1] - &_nmp_classes[0])) == 0;
&& ((((char *) klass) - ((char *) _nmp_classes)) % (sizeof (_nmp_classes[0]))) == 0;
}
#define NMP_REF_COUNT_STACKINIT (G_MAXINT)