[PATCH 6/6] Move wbc global variables into global context instead

Matthew Newton mcn4 at leicester.ac.uk
Tue Feb 24 06:34:06 MST 2015


On Tue, Feb 24, 2015 at 12:22:29PM +0100, Volker Lendecke wrote:
> On Mon, Feb 23, 2015 at 01:21:05AM +0000, Matthew Newton wrote:
> > -wbcErr wbcCtxEndpwent(struct wbcContext *ctx)
> > +wbcErr wbcCtxEndpwent(struct wbcContext *_ctx)
> >  {
> >  	wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
> > +	struct wbcContext *ctx;
> > +
> > +	ctx = _ctx;
> > +	if (!ctx) {
> > +		ctx = &wbcGlobalCtx;
> > +	}
> 
> Can you explain the reason behind the _ctx and ctx?

Not really :) - it was trying to make it clear that it was
modifying the value it was being passed, but agree it looks a bit
clunky.

I'll just redefine ctx, which isn't const anyway:

  wbcErr wbcCtxEndpwent(struct wbcContext *ctx)
  {
	  wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;

	  if (!ctx) {
		  ctx = &wbcGlobalCtx;
	  }

Will update the patches and re-send.

Thanks!

Matthew


-- 
Matthew Newton, Ph.D. <mcn4 at le.ac.uk>

Systems Specialist, Infrastructure Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom

For IT help contact helpdesk extn. 2253, <ithelp at le.ac.uk>


More information about the samba-technical mailing list