Commit 1fc6dfc
committed
Split assertion per expressions
Expressions joined with `&&` are better asserted separately, so that
it is clear from the failure message which expression is false.
Also, `unsigned long` may not be enough for `ptrdiff_t`, e.g., Windows.
Saying that `ptrdiff_t` can be larger than `SIZE_MAX` means that
`PTRDIFF_MAX` is larger than `SIZE_MAX` and `ptrdiff_t` is sufficient
to represent `SIZE_MAX`, otherwise if `PTRDIFF_MAX` is smaller than
`SIZE_MAX`, `diff` will always be smaller than `SIZE_MAX` as well.
`diff` could be equal to `SIZE_MAX` only if `PTRDIFF_MAX` is equal to
`SIZE_MAX` and these assertions would pass, but I don't think there is
any platform where that is the case.1 parent a46edfd commit 1fc6dfc
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6169 | 6169 | | |
6170 | 6170 | | |
6171 | 6171 | | |
6172 | | - | |
| 6172 | + | |
| 6173 | + | |
| 6174 | + | |
| 6175 | + | |
6173 | 6176 | | |
6174 | 6177 | | |
6175 | 6178 | | |
| |||
0 commit comments