Re: [PATCH] hashmap: adjust documentation to reflect reality
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Nov 30, 2017, 00:16 UTC
- Message-ID
- <20171130001612.GE15098@aiede.mtv.corp.google.com>
- In-Reply-To
- <466dd5331907754ca5c25cc83173ca895220ca81.1511999045.git.johannes.schindelin@gmx.de>
Johannes Schindelin wrote:
Show 15 quoted lines
> The hashmap API is just complicated enough that even at least one > long-time Git contributor has to look up how to use it every time he > finds a new use case. When that happens, it is really useful if the > provided example code is correct... > > While at it, "fix a memory leak", avoid statements before variable > declarations, fix a const -> no-const cast, several %l specifiers (which > want to be %ld), avoid using an undefined constant, call scanf() > correctly, use FLEX_ALLOC_STR() where appropriate, and adjust the style > here and there. > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > --- > hashmap.h | 60 +++++++++++++++++++++++++++++------------------------------- > 1 file changed, 29 insertions(+), 31 deletions(-)
Yay, thanks for this.
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Follow-on idea for the interested: would making a test that extracts this sample code from hashmap.h and confirms it still works be a crazy idea?