summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/macro.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove stuffNicholas Feinberg2014-07-291-1/+1
| | | | | | | .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!
* Move redraw functions from stuff.cc -> output.ccNicholas Feinberg2014-07-281-0/+1
|
* Move get_ch() from stuff.cc to macro.ccNicholas Feinberg2014-07-271-0/+14
|
* Rename 'mesclr()' to 'clear_messages()'reaverb2014-06-221-1/+1
|
* Chance function(void) to function()reaverb2014-05-241-2/+2
|
* Formatting fixes (add braces).Neil Moore2014-05-121-0/+2
| | | | This fixes all the instances caught by unbrace.
* Avoid a crash parsing bad keymap lines in macro files.Neil Moore2014-04-241-2/+3
| | | | | | | | | | | | | | | | | | | 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
* Drop double newlines where they seem to serve no purpose.Adam Borowski2013-12-211-2/+0
| | | | | 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.
* Fix spelling of "targeting" (#7837)Chris Campbell2013-12-101-5/+5
| | | | See Mantis for discussion.
* Replace `mpr(s, ch)` with `mprf(ch, s)`Adam Borowski2013-11-291-8/+7
| | | | | | | | | 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.
* More formatting fixes for return (...);Neil Moore2013-11-151-1/+1
|
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-9/+9
|
* Don't allocate pointless iterators.Adam Borowski2013-11-151-3/+3
| | | | | map or set.count() can test the presence of a given key and return 0 or 1 outright.
* Reformat multi-line array literals.Adam Borowski2013-10-051-2/+4
|
* Pad some ternary operators with spaces on the leftChris Oelmueller2013-07-281-1/+1
| | | | | | 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.
* Fix lots of typosChris Oelmueller2013-07-231-1/+1
|
* ASSERT_RANGEs other than >= <.Adam Borowski2013-06-081-2/+1
| | | | | | 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?
* Refactor ASSERT(a && b) -> ASSERT(a); ASSERT(b);Brendan Hickey2013-04-281-1/+2
| | | | | | | 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.
* Simplify handling of version info.Adam Borowski2013-03-141-1/+1
| | | | | They're static strings, there's no point in having functions just to malloc and pass them around.
* Fix prompts asking for 'I' in Turkish locales.Adam Borowski2012-11-221-2/+2
| | | | | | | 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.
* Remove unnecessary includes from header files.Jay3.14152012-10-231-0/+1
| | | | | | | | | | 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.
* Use std namespace.Raphael Langella2012-08-261-54/+53
| | | | | | | | | | | | | 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.
* Drop a bunch of parentheses from return statements.Adam Borowski2012-08-081-3/+3
| | | | | This is incomplete, partially because of me getting bored, partially because of doubts about the point of leaving simple addition/etc in parentheses.
* Stop key replay properly on failure to cast spells, evoke items, etc.Steve Melenchuk2012-08-051-1/+2
| | | | | | | | | | | 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.
* Some more return deparenthesization.Adam Borowski2012-07-051-7/+7
|
* Remove parentheses around return (simple_function_call).Adam Borowski2012-07-051-2/+2
| | | | For way too paranoid and underinclusive values of "simple".
* String scalars are scalars, too.Adam Borowski2012-07-051-1/+1
|
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-21/+21
|
* Fix a bunch of webtiles-in-console message regressions.Adam Borowski2012-06-221-0/+1
| | | | | | | | | 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.
* Use ARRAYSZ() instead of sizeof division, for readability.Adam Borowski2012-06-191-1/+1
| | | | Also, it's not vulnerable to changes to the underlying types.
* Make another bunch of functions static or deleted.Adam Borowski2012-03-211-7/+9
| | | | | Looks like get_XXX_path and the like in files.cc could use some drastic simplification, or perhaps even a nuking and rewrite.
* Get rid of USisms in spelling of -ll- and -tt-.Adam Borowski2012-01-251-5/+5
| | | | | This mostly reverts 78d8ab06 which replaced Commonwealth "targetting" with US "targeting", although there's also "cancelLing", "levelLing", "travelLing".
* Make a bunch of functions static, delete some unused junk.Adam Borowski2011-11-111-7/+0
|
* cppcheck: use ++p not p++ for complex types (like iterators).Adam Borowski2011-07-051-4/+4
| | | | | | | | | | | 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.
* cppcheck: fix inefficient checking for emptiness.Adam Borowski2011-07-051-6/+6
| | | | | 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.
* Fix check if the line is empty before accessing it.Hurcan Solter2011-06-121-1/+1
|
* Let sendkeys() input not yet injected into the macro buffer inhibit ready().Adam Borowski2011-05-231-0/+5
|
* Merge branch 'unicode'.Adam Borowski2011-04-011-14/+18
|\ | | | | | | | | There are some issues left, like incorrect wrapping in some cases, but we can fix them later.
| * Merge branch 'master' into unicodeAdam Borowski2011-03-131-2/+7
| |\
| * \ Merge branch 'master' into unicodeAdam Borowski2011-01-111-30/+58
| |\ \ | | | | | | | | | | | | Conflicts galore...
| * | | Rename TextFileReader to FileLineInput I didn't notice, use it for config files.Adam Borowski2010-12-161-1/+1
| | | |
| * | | Fix an use of fstream, allow macro files to be in dirs with non-ASCII paths.Adam Borowski2010-12-161-4/+3
| | | | | | | | | | | | | | | | | | | | It also allows using non-ASCII characters inside, but save for arguments to lua functions, this is not really meaningful.
| * | | Convert ofstream to fopen() for macro files.Adam Borowski2010-12-161-10/+15
| | | |
* | | | Make file headers doxygen-friendly, drop useless fields.Adam Borowski2011-03-281-5/+4
| |_|/ |/| | | | | | | | | | | | | | | | | "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.
* | | Explicitly describe uppercase keys as such in the tutorial.Johanna Ploog2011-01-121-2/+7
| |/ |/|
* | More feedback at the macro prompt: make it clear exactly what macro/keymap ↵Darshan Shaligram2011-01-101-23/+55
| | | | | | | | was defined, deleted, etc. Never leave the prompt dangling without an acknowledgement.
* | Fix clashes between typedefs and variables.Adam Borowski2011-01-071-3/+3
| |
* | Remove some unused logic (thanks gcc-4.6).Adam Borowski2011-01-071-4/+0
|/
* Make an inlined function static.Adam Borowski2010-12-011-1/+1
|
* Massive spacing fixes: "( spaces after parentheses )".Adam Borowski2010-10-151-19/+19
| | | | | | 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.