| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
.cc, moving its contents into the new stepdown.cc and strings.cc.
(The latter also got many donations from libutil.h.)
Down with stuff! Up the new flesh!
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This fixes all the instances caught by unbrace.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we encounter a K<char>: keymap definition with an invalid character
(not '0' through '5'), we don't set the key and don't switch to keymap
mode, but we did change the keymap context. If we were in keymap mode
already, this leads to us making an out-of-bounds access to the Keymaps
array when we later parse the A: line and try to add the macro.
Now the bad K?: line is completely ignored; this means we replace
the action of the previous map or macro, but that's better than
crashing (and happened already if the previous thing was a macro).
An example of a keymap that would cause a crash (the first line is not
necessary if another keymap immediately preceded this one):
K:x
K~:y
A:z
|
|
|
|
|
| |
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.
|
|
|
|
| |
See Mantis for discussion.
|
|
|
|
|
|
|
|
|
| |
Also simplify quite a few cases.
It turns out in >90% cases of non-literals the argument had .c_str(),
which meant it was pointlessly malloc()ed and converted from and to
std::string. I believe a sprintf is faster, so even the argument of
miniscule speed-up doesn't apply.
|
| |
|
| |
|
|
|
|
|
| |
map or set.count() can test the presence of a given key and return 0 or 1
outright.
|
| |
|
|
|
|
|
|
| |
While this is not explicitly mentioned as a rule in coding_conventions,
all examples listed there apply it as well. The dungeon.cc chunk did
overflow max. columns before already, but could still be looked at.
|
| |
|
|
|
|
|
|
| |
Committing separately as I'm not sure whether checking, for example,
ASSERT_RANGE(level, 1, 28) is that nice. Perhaps 27 + 1 could be better?
Perhaps some other syntax?
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
They're static strings, there's no point in having functions just to malloc
and pass them around.
|
|
|
|
|
|
|
| |
They have I<->ı and İ<->i.
Fortunately, people are quite unlikely to type capital letters in response
to prompts, perhaps save for the stat gain one.
|
|
|
|
|
|
|
|
|
|
| |
For most header files, this only saves on having to recompile a
small number of source files, but there are also a few headers
where small changes would now take significantly less time.
This is most obvious for the Tiles build for which the dependencies
have been greatly reduced, so that the only additional includes
when compared to console are strictly library or tile related.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This is incomplete, partially because of me getting bored, partially because
of doubts about the point of leaving simple addition/etc in parentheses.
|
|
|
|
|
|
|
|
|
|
|
| |
This prevents the player from moving around if a spell fails to cast
for, say, lack of mana.
It also adds in a few additional zero_turns_taken() checks to
spl-cast.cc so that repeating casting a spell doesn't continue when the
player, for example, runs out of mana.
Fixes #1540.
|
| |
|
|
|
|
| |
For way too paranoid and underinclusive values of "simple".
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This is nowhere close to completeness, I got tired early through that
massive file, pushing it to see if you guys have any comments about what
is the best way to proceed.
In particular, I think command tags and item glyphs could be done a better
way.
|
|
|
|
| |
Also, it's not vulnerable to changes to the underlying types.
|
|
|
|
|
| |
Looks like get_XXX_path and the like in files.cc could use some drastic
simplification, or perhaps even a nuking and rewrite.
|
|
|
|
|
| |
This mostly reverts 78d8ab06 which replaced Commonwealth "targetting" with US
"targeting", although there's also "cancelLing", "levelLing", "travelLing".
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Pre-increment looks worse than post-increment, but on a C++ object the
latter forces an allocation plus copy that is completely unnecessary but the
compiler doesn't know that yet.
Note that I did change some of our iterators to return void rather than the old
or new value for exactly this performance reason before, breaking the expected
behaviour. If that's an issue, tell me, we can use preincrements instead which
have very little penalty.
|
|
|
|
|
| |
On some STL structures size() is slow. I did not bother limitting sed,
so innocent bystanders got pulled into the machine, but there's no loss.
|
| |
|
| |
|
|\
| |
| |
| |
| | |
There are some issues left, like incorrect wrapping in some cases, but
we can fix them later.
|
| |\ |
|
| |\ \
| | | |
| | | |
| | | | |
Conflicts galore...
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
It also allows using non-ASCII characters inside, but save for arguments to
lua functions, this is not really meaningful.
|
| | | | |
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | | |
"File:" is shown in your editor's status bar.
"Written by:" was used only for the first person who changed a file. We got
git for that now, and pre-DCSS history is so woefully inaccurate it doesn't
really matter.
|
| |/
|/| |
|
| |
| |
| |
| | |
was defined, deleted, etc. Never leave the prompt dangling without an acknowledgement.
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
| |
I did review it manually to find places where they made sense (like some
tables), but for a massive sed job like this there might be places that
I missed.
|