[PATCH] Improve lib/param handling and remove another unused script

Michael Adam obnox at samba.org
Wed Jan 29 08:44:51 MST 2014


On 2014-01-29 at 13:42 +0100, Stefan (metze) Metzmacher wrote:
> Am 29.01.2014 13:34, schrieb Michael Adam:
> > @@ -1417,10 +1417,20 @@ mark_non_default:
> >  	if (on_globals && (lp_ctx->flags[parmnum] & FLAG_DEFAULT)) {
> >  		lp_ctx->flags[parmnum] &= ~FLAG_DEFAULT;
> >  		/* we have to also unset FLAG_DEFAULT on aliases */
> > -		for (i=parmnum-1;i>=0 && parm_table[i].offset == parm_table[parmnum].offset;i--) {
> > +		for (i = parmnum-1;
> > +		     i >= 0 &&
> > +		     parm_table[i].p_class == parm_table[parmnum].p_class &&
> > +		     parm_table[i].offset == parm_table[parmnum].offset;
> > +		     i--)
> > +		{
> >  			lp_ctx->flags[i] &= ~FLAG_DEFAULT;
> >  		}
> > -		for (i=parmnum+1;i<NUMPARAMETERS && parm_table[i].offset == parm_table[parmnum].offset;i++) {
> > +		for (i = parmnum+1;
> > +		     i < NUMPARAMETERS &&
> > +		     parm_table[i].p_class == parm_table[parmnum].p_class &&
> > +		     parm_table[i].offset == parm_table[parmnum].offset;
> > +		     i++)
> > +		{
> >  			lp_ctx->flags[i] &= ~FLAG_DEFAULT;
> >  		}
> >  	}
> 
> What about adding a macro like
> 
> PARM_TABLE_EQUAL(a, b) ((a->p_class == b->p_class) && (a->offset == b->offset))


Good idea, could be useful in a couple of places.
Will send update ...

Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 215 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140129/de939f86/attachment.pgp>


More information about the samba-technical mailing list