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

[PATCH] hashmap.h: Use 'unsigned int' for hash-codes everywhere

From
Karsten Blees <karsten.blees@gmail.com>
Date
Dec 18, 2013, 13:41 UTC
Message-ID
<52B1A607.5000509@gmail.com>
In-Reply-To
<xmqq7gbd29vw.fsf@gitster.dls.corp.google.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
---
Am 09.12.2013 18:48, schrieb Junio C Hamano:
Show 9 quoted lines
> Karsten Blees <karsten.blees@gmail.com> writes:
> 
>>> * kb/fast-hashmap (2013-11-18) 14 commits
>>>   (merged to 'next' on 2013-12-06 at f90be3d) 
>>
>> Damn, a day too late :-) I found these two glitches today...is a
>> fixup patch OK or should I do a reroll (or separate patch on top)?
> 
> A separate patch on top would be the most appropriate.
OK, this one's a no-brainer I think. See $gmane/239430 for the latest proposal on the struct packing front.
 Documentation/technical/api-hashmap.txt | 2 +-
 hashmap.h                               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/technical/api-hashmap.txt b/Documentation/technical/api-hashmap.txt
index b2280f1..42ca234 100644
--- a/Documentation/technical/api-hashmap.txt
+++ b/Documentation/technical/api-hashmap.txt
@@ -80,7 +80,7 @@ prevent expensive resizing. If 0, the table is dynamically resized.
 If `free_entries` is true, each hashmap_entry in the map is freed as well
 (using stdlib's free()).
 
-`void hashmap_entry_init(void *entry, int hash)`::
+`void hashmap_entry_init(void *entry, unsigned int hash)`::
 
 	Initializes a hashmap_entry structure.
 +
diff --git a/hashmap.h b/hashmap.h
index f5b3b61..a816ad4 100644
--- a/hashmap.h
+++ b/hashmap.h
@@ -43,7 +43,7 @@ extern void hashmap_free(struct hashmap *map, int free_entries);
 
 /* hashmap_entry functions */
 
-static inline void hashmap_entry_init(void *entry, int hash)
+static inline void hashmap_entry_init(void *entry, unsigned int hash)
 {
 	struct hashmap_entry *e = entry;
 	e->hash = hash;
-- 
1.8.5.1.276.g562b27a
Previous: Junio C HamanoNext: Junio C Hamano
Message 22 of 23 in “What's cooking in git.git (Dec 2013, #02; Fri, 6)”
  1. Junio C HamanoDec 6, 2013
  2. Felipe ContrerasDec 7, 2013
  3. Felipe ContrerasDec 7, 2013
  4. Junio C HamanoDec 9, 2013
  5. Thomas RastDec 7, 2013
  6. Jeff KingDec 9, 2013
  7. Junio C HamanoDec 9, 2013
  8. Matthieu MoyDec 7, 2013
  9. Karsten BleesDec 7, 2013
  10. Thomas RastDec 7, 2013
  11. Karsten BleesDec 7, 2013
  12. Thomas RastDec 8, 2013
  13. Karsten BleesDec 9, 2013
  14. Jonathan NiederDec 9, 2013
  15. Karsten BleesDec 9, 2013
  16. Jonathan NiederDec 9, 2013
  17. Karsten BleesDec 18, 2013
  18. Karsten BleesDec 18, 2013
  19. Karsten BleesDec 18, 2013
  20. Junio C HamanoDec 9, 2013
  21. Junio C HamanoDec 9, 2013
  22. hashmap.h: Use 'unsigned int' for hash-codes everywhereKarsten Blees, Dec 18, 2013
  23. Junio C HamanoDec 18, 2013

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.