[PATCH] libbb print_flags() -380 bytes

Roy Marples roy at marples.name
Fri Jun 6 17:25:22 PDT 2008


On Friday 06 June 2008 19:58:34 Natanael Copa wrote:
> Bernhard Fischer wrote:
> >> Index: include/libbb.h
> >> ===================================================================
> >> --- include/libbb.h	(revision 22223)
> >> +++ include/libbb.h	(working copy)
> >> @@ -1304,7 +1304,14 @@
> >> /* "sh" */
> >> #define DEFAULT_SHELL_SHORT_NAME     (bb_default_login_shell+6)
> >>
> >> +struct mask_string {
> >> +	int mask;
> >> +	const char *string;
> >> +};
> >
> > typedef this, please.
>
> I tend to agree with the linux coding style there but ok.
> http://www.linuxjournal.com/article/5780 (look for "typedef is evil")

And if you must typedef, the BSD style works well here. Basically the typedef 
is the name of the structure but in upper case. (BSD also discourages 
typedefs)

struct mask_string {
   int mask;
   const char *string;
} MASK_STRING;

So

struct mask_string ms;
and
MASK_STRING ms;
are equivalent.

Thanks

Roy


More information about the busybox mailing list