| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
If the sum of the weights of a random_var goes over INT_MAX, rescale
them rather than leaving the total as a negative number.
|
|
|
|
|
| |
Sometimes, they're there to emphasize a break between two sections of code,
which is good. In a majority of cases, though, they're just inconsistent.
|
|
|
|
|
|
| |
This commit converts ASSERT(a && b) to ASSERT(a); ASSERT(b);
Assertions of the form !(a && b) are left intact, since there isn't an
obvious readability gain over (!a || !b).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Convert conjunctive assertions into separate assertions. This ought to be correctness preserving. I ran the stress tests and didn't notice anything unusual. While I have confidence in it, if you are the slightest bit suspicious of this, please roll it back.
Found instances with `ASSERT(\([^(|]*\) && \([^)|]*\))`
Manually inspected each instance.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had to rename distance() (in coord.h) to distance2() because it conflicts
with the STL function to compare 2 iterators. Not a bad change given how it
returns the square of the distance anyway.
I also had to rename the message global variable (in message.cc) to buffer.
I tried to fix and improve the coding style has much as I could, but I
probably missed a few given how huge and tedious it is.
I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool
and util/levcomp.*, because I have no clue about those.
|
| |
|
|
|
|
| |
For way too paranoid and underinclusive values of "simple".
|
| |
|
|
|
|
|
|
| |
Two constants divide to the same value no matter the scale, using random_var
was just a waste of CPU. What we want is to allow partial values a percentage
of the time.
|
| |
|
|
Using these to get at random values is quite inefficient,
but it allows computing expected values for complicated
formulas like those used in fight.cc.
|