mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
Address /W4 compiler warnings for Windows (#4910)
This commit is contained in:
parent
cb90a8356b
commit
186f4289e9
50 changed files with 279 additions and 272 deletions
|
|
@ -44,11 +44,13 @@ unsigned int RNG_SFMT::rand(int min, int max)
|
|||
return max;
|
||||
|
||||
// This is actually not used in Cockatrice:
|
||||
// Someone wants rand() % -foo, so we compute -rand(0, +foo)
|
||||
// This is the only time where min > max is (sort of) legal.
|
||||
// Someone wants rand() % -foo, so we should compute -rand(0, +foo)
|
||||
// But this method returns an unsigned int, so it doesn't really make
|
||||
// a difference.
|
||||
// This is the only time when min > max is (sort of) legal.
|
||||
// Not handling this will cause the application to crash.
|
||||
if (min == 0 && max < 0) {
|
||||
return -cdf(0, -max);
|
||||
return cdf(0, -max);
|
||||
}
|
||||
|
||||
// No special cases are left, except !(min > max) which is caught in the cdf itself.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue