aboutsummaryrefslogtreecommitdiff
path: root/PuzzleApplet.java
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-10-01 09:15:24 +0100
committerSimon Tatham <anakin@pobox.com>2017-10-01 10:38:01 +0100
commit9f6114e27236105d64e23e063a17db84389059ba (patch)
tree11108cacf6f03beed5b20718fc7f6bacea70ff22 /PuzzleApplet.java
parentb9b73adb53b3ffb09a2e8c9682351bf892634470 (diff)
downloadpuzzles-9f6114e27236105d64e23e063a17db84389059ba.zip
puzzles-9f6114e27236105d64e23e063a17db84389059ba.tar.gz
puzzles-9f6114e27236105d64e23e063a17db84389059ba.tar.bz2
puzzles-9f6114e27236105d64e23e063a17db84389059ba.tar.xz
Style tweaks to the newgame_undo patch.
I've renamed the new midend variables to match my usual naming convention of using 'size' for the total buffer size and 'len' for the amount of currently used space (and a couple of other variables to match those in turn), partly for consistency and also because the name 'midend_undo_used' made me half-expect it to be a boolean. The buffer itself is called 'midend_undo_buf', again to avoid making it sound like a function or flag. Buffer growth is still geometric but less aggressive (factor of 5/4 each time instead of 2), in the hope of wasting less memory on low-RAM platforms; newgame_undo_deserialise_read should have been static, and now is; newgame_undo_buf is initialised using NULL rather than 0 so it doesn't look like an integer, and is freed with the rest of the midend. And I think we _should_ enforce by assertion that midend_deserialise didn't return an error, because there's no reason it ever should in this situation (unlike when reading from a file, where the user might have provided the wrong file or a corrupted one). This immediately allowed me to spot a bug in the existing deserialisation code :-)
Diffstat (limited to 'PuzzleApplet.java')
0 files changed, 0 insertions, 0 deletions