Re: [PATCH 4/3] Introduce 'convert_path_to_git()'
- From
- Jens 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.