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

Re: [PATCH 4/3] Introduce 'convert_path_to_git()'

From
JKJens Kilian <jjk@acm.org>
Date
May 19, 2009, 12:20 UTC
Message-ID
<loom.20090519T120452-71@post.gmane.org>
In-Reply-To
<7vy6sxpn2q.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster <at> pobox.com> writes:
> "Ugly" is not quite the word I am looking for.  "My gut feels that there
> has to be a way to write this more cleanly, but I am frustrated that I
> cannot come up with one" might be the word...
How about this:
#include <stdio.h>

#define MAGIC(type) ((~(type)0 / (type)0xff) << 7) #define TEST(type) printf(#type " %llx\n", (unsigned long long)MAGIC(type))

int
main(void)
{
/*TEST(unsigned char);  Doesn't work, and I'm too lazy to find out why. */
  TEST(unsigned int);
  TEST(unsigned long);
  TEST(unsigned long long);
  return 0;
}
HTH,
    Jens.
Previous: Linus TorvaldsNext: John Koleszar
Message 12 of 13 in “dir.c: clean up handling of 'path' parameter in read_directory_recursive()”
  1. 1/3 dir.c: clean up handling of 'path' parameter in read_directory_recursive()Linus Torvalds, May 14, 2009
  2. 2/3 Add 'fill_directory()' helper function for directory traversalLinus Torvalds, May 14, 2009
  3. 3/3 read_directory(): infrastructure for pathname character set conversionLinus Torvalds, May 14, 2009
  4. Linus TorvaldsMay 14, 2009
  5. Johannes SchindelinMay 14, 2009
  6. Aaron CohenMay 14, 2009
  7. Linus TorvaldsMay 14, 2009
  8. Linus TorvaldsMay 14, 2009
  9. 4/3 Introduce 'convert_path_to_git()'Linus Torvalds, May 15, 2009
  10. Junio C HamanoMay 16, 2009
  11. Linus TorvaldsMay 16, 2009
  12. Jens KilianMay 19, 2009
  13. John KoleszarMay 19, 2009

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.