[PATCH] pidl: Fix python generated code

Jeremy Allison jra at samba.org
Tue Jun 20 16:34:08 UTC 2017


On Tue, Jun 20, 2017 at 05:11:14PM +0200, Volker Lendecke via samba-technical wrote:
> On Tue, Jun 20, 2017 at 09:49:06AM -0400, jim via samba-technical wrote:
> > Why not change the comparison to "<=" from "<" and avoid the "+1" change?
> > 
> > On 6/20/2017 9:36 AM, Volker Lendecke via samba-technical wrote:
> > >-	$self->pidl("if (ndr_table_$iface\.num_calls < $fn->{OPNUM}) {");
> > >+	$self->pidl("if (ndr_table_$iface\.num_calls < " . ($fn->{OPNUM}+1) .
> > >+		    ") {");
> 
> To me the array bounds check with the "<" easier to understand, but
> that's a matter of taste. If someone stronly feels about it, I'm fine
> with <= too of course. With any sane compiler it should not make any
> difference in generated code.

RB+. I find the < easier to understand.




More information about the samba-technical mailing list