distribute() should not accept negative number of groups nor rates. It's fingerprint should be changed to:
void distribute(int number, unsigned groups, const unsigned *ratios, int *result);
I assume that this change would silence clang analyzer warning we're getting about the function - seems to me that the path leading to the problem can be taken only when 'groups' is negative.
distribute() should not accept negative number of groups nor rates. It's fingerprint should be changed to:
void distribute(int number, unsigned groups, const unsigned *ratios, int *result);
I assume that this change would silence clang analyzer warning we're getting about the function - seems to me that the path leading to the problem can be taken only when 'groups' is negative.