7 Commits

Author SHA1 Message Date
5f5b284c0b Use C99 bool within source modules.
This is the main bulk of this boolification work, but although it's
making the largest actual change, it should also be the least
disruptive to anyone interacting with this code base downstream of me,
because it doesn't modify any interface between modules: all the
inter-module APIs were updated one by one in the previous commits.
This just cleans up the code within each individual source file to use
bool in place of int where I think that makes things clearer.
2018-11-13 21:48:24 +00:00
33b55db48e Adopt C99 bool in the tree234 API.
The only affected function here is splitpos234, which I don't think
these puzzles are even using at the moment.
2018-11-13 21:48:24 +00:00
b7e0d854fe Patch from Ben Hutchings: explicitly initialise something which some
gccs complained about.

[originally from svn r8923]
2010-04-18 15:07:52 +00:00
9c95ea2619 Add a precautionary pair of initialisations to placate optimisers,
and asserts to check that the preinitialised values are never
actually used.

[originally from svn r8745]
2009-11-10 19:11:03 +00:00
c06e371f55 Rather to my surprise given the amount of testing this code has had,
Kevin Lyles spotted a tree234 bug! copytree234() segfaulted when
asked to copy a tree containing no elements, due to failing to allow
for the case that t->root might be NULL. Fixed, and added a
regression test.

[originally from svn r7092]
2007-01-11 09:26:09 +00:00
2bef4dfb50 Yikes! I've only just noticed that this copy of tree234.c was still
using unwrappered malloc/free, leaving plenty of openings for out-
of-memory segfaults. Switch to using Puzzles's memory management,
which I should have done right at the start but can only assume I
forgot about.

[originally from svn r6388]
2005-10-12 17:57:40 +00:00
96dbb537ee Initial checkin of a portable framework for writing small GUI puzzle
games.

[originally from svn r4138]
2004-04-25 14:27:58 +00:00