git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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?

Previous: Johannes SchindelinNext: Jeff King
Message 2 of 7 in “hashmap: adjust documentation to reflect reality”
  1. hashmap: adjust documentation to reflect realityJohannes Schindelin, Nov 29, 2017
  2. Jonathan NiederNov 30, 2017
  3. Jeff KingNov 30, 2017
  4. Junio C HamanoDec 3, 2017
  5. Stefan BellerDec 4, 2017
  6. Johannes SchindelinDec 7, 2017
  7. Jeff KingDec 8, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.