[PATCH 1/1] snapshot: strip bit from struct cgit_snapshot_format

Christian Hesse list at eworm.de
Mon Jun 11 08:51:27 CEST 2018


John Keeping <john at keeping.me.uk> on Sat, 2018/06/09 12:16:
> I think this would be nicer if we introduce a BIT macro like Linux has,
> something like:
> 
> 	#define BIT(x)	(1U << (x))

Reasonable. ;)

> but even better, can't we have something like:
> 
> 	static inline unsigned cgit_snapshot_bit(
> 		const struct cgit_snapshot_format *f)
> 	{
> 		return BIT(f - &cgit_snapshot_formats[0]);
> 	}
> 
> and avoid needing the loop index completely?

Ok, finally got the idea. :-p
I will reply with an updated patch.
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20180611/068d49fe/attachment.asc>


More information about the CGit mailing list