Re: [PATCH 1/3] lib/string_helpers: Consolidate yesno() implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]<

 



On Wed, 19 Jan 2022 21:22:57 +0200
Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:

> On Wed, Jan 19, 2022 at 04:38:26PM +0000, David Laight wrote:
> > > > > > +static inline const char *yesno(bool v) { return v ? "yes" : "no"; }  
> > > 
> > > 	return "yes\0no" + v * 4;
> > > 
> > > :-)  
> > 
> > except '"no\0\0yes" + v * 4' works a bit better.  
> 
> Is it a C code obfuscation contest?
> 

	return '/'/'/';

-- Steve



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux