1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00
Commit Graph

21 Commits

Author SHA1 Message Date
Simon Tatham
b2d0bd0da4 tree234.c: new search234() system.
This is a thing I've been meaning to set up for a while: it's a
pull-based search system (that is, the caller takes each step of the
search manually, rather than providing a callback), which lets the
caller inspect every step of the search, including the index of each
candidate element in the tree. This allows flexible kinds of query
that play the element and its index off against each other.

I've also rewritten the existing findrelpos234() search function using
the new one as a primitive, because that simplifies it a lot!
2018-09-19 23:08:28 +01:00
Simon Tatham
ff7418af73 tree234.c: minor fixes to the test suite.
Added a missing #include of string.h; arranged that the test program
reports the number of errors detected at the end so I don't have to
search its entire output for "ERROR"; made the test program return a
nonzero exit status if any error was found.
2018-09-19 23:08:28 +01:00
Simon Tatham
98cbe6963b Another format-string fix.
Oops - I found this in an editor autosave file after pushing the
previous commit. I meant it to be part of the previous commit. Oh
well, better late than never.
2017-06-20 19:02:13 +01:00
Simon Tatham
84fed5c620 Fixes for the tree234 unit test: break its dependencies on half of the
rest of PuTTY, and fix a couple of format string type mismatches
pointed out by gcc.

[originally from svn r9911]
2013-07-11 17:24:32 +00:00
Jacob Nevins
cd94e3bc3c Patch from Colin Watson intended to give a clean Unix compile with GCC 4.
(Since we choose to compile with -Werror, this is particularly important.)

I haven't yet checked that the resulting source actually compiles cleanly with
GCC 4, hence not marking `gcc4-warnings' as fixed just yet.

[originally from svn r7041]
2006-12-30 23:00:14 +00:00
Simon Tatham
d36a4c3685 Introduced wrapper macros snew(), snewn() and sresize() for the
malloc functions, which automatically cast to the same type they're
allocating the size of. Should prevent any future errors involving
mallocing the size of the wrong structure type, and will also make
life easier if we ever need to turn the PuTTY core code from real C
into C++-friendly C. I haven't touched the Mac frontend in this
checkin because I couldn't compile or test it.

[originally from svn r3014]
2003-03-29 16:14:26 +00:00
Simon Tatham
3730ada5ce Run entire source base through GNU indent to tidy up the varying
coding styles of the various contributors! Woohoo!

[originally from svn r1098]
2001-05-06 14:35:20 +00:00
Simon Tatham
059998d17b Remove diagnostics and attempt to work around VC compiler bug :-(
[originally from svn r1096]
2001-05-03 10:10:53 +00:00
Simon Tatham
56a5e6fdf3 Extra diagnostics in the hope that we can track down the problem with
the nightlies. I must remember to take it all out again when we do!

[originally from svn r1095]
2001-05-02 14:45:25 +00:00
Simon Tatham
3abea3d4ea Having now compiled the last few days' changes with MSVC, it's turned
up a bunch of warnings, mostly unused variables. All fixed.

[originally from svn r1058]
2001-04-17 08:24:29 +00:00
Simon Tatham
7cd4f98ef6 countnode234() should politely return 0 when passed NULL. Was
breaking delpos234(empty_tree, 0).

[originally from svn r1054]
2001-04-16 21:24:38 +00:00
Simon Tatham
03c9b6107b Replace PuTTY's 2-3-4 tree implementation with the shiny new counted
one, in preparation for using it to speed up scrollback.

[originally from svn r1053]
2001-04-16 17:18:24 +00:00
Simon Tatham
d5240d4157 Make memory management uniform: _everything_ now goes through the
smalloc() macros and thence to the safemalloc() functions in misc.c.
This should allow me to plug in a debugging allocator and track
memory leaks and segfaults and things.

[originally from svn r818]
2000-12-12 10:33:13 +00:00
Simon Tatham
c1e5815add Make the new test suite's comment more accurate :-)
[originally from svn r663]
2000-10-02 13:57:41 +00:00
Simon Tatham
4a2ea18a51 Deletion case 2c can shift the root; case 3b is not the only case that
can do that. The bad case happens when you have a root node containing
only one actual element, and its two child nodes have only one element
each, and you try to delete the element in the root.

[originally from svn r660]
2000-10-02 11:47:30 +00:00
Simon Tatham
8084172c18 Shiny new test harness for the 2-3-4 tree
[originally from svn r658]
2000-10-02 11:46:10 +00:00
Simon Tatham
aa203391c2 Keep parent pointers valid during deletion
[originally from svn r645]
2000-09-28 09:48:49 +00:00
Simon Tatham
c9557bfc40 Fix tree corruption in the "really easy" case on deletion
[originally from svn r632]
2000-09-26 11:16:33 +00:00
Simon Tatham
2c76bd5b3a Fix a small bug in 2-3-4 tree enumeration
[originally from svn r630]
2000-09-26 10:05:48 +00:00
Simon Tatham
74a50d2d55 Delete should be void not void *; also use correct compare fn in find.
[originally from svn r594]
2000-09-15 10:48:42 +00:00
Simon Tatham
68ee8531fb 2-3-4 tree routines
[originally from svn r590]
2000-09-14 15:02:50 +00:00