[SCM] Samba Shared Repository - branch master updated

Kai Blin kai at samba.org
Wed May 30 04:35:44 MDT 2012


On 2012-05-30 07:59, Volker Lendecke wrote:

>>        via  6a1ad76 s4-dns: Use W_ERROR_HAVE_NO_MEMORY in create_response_rr
> 
> Where is the rule laid down that we must use those macros?

I'm not aware of any rule, but the rest of the DNS server code is using
that macro, so I thought consistency was a good thing.

> I find them completely obnoxious to use. Doing a return or
> goto from something that looks like a function call is just
> wrong to me. To save precious screen space, I would rather
> go and introduce a special rule to say
> 
> if (ptr == NULL) { return WERR_NOMEM };

This is not about screen space for me, it's about having to write less
boilerplate code. Code completion works better on the macro.

> in one line. I know we have tons of uses of those, but I
> would like to start a discussion about banning them.

If you want to ban them, go ahead. I don't feel strongly enough about
this either way. As I said, my change was mostly to keep the
allocation-error checks consistent, and it was easier to change this way
around.

Cheers,
Kai

-- 
Kai Blin
Worldforge developer http://www.worldforge.org/
Wine developer http://wiki.winehq.org/KaiBlin
Samba team member http://www.samba.org/samba/team/


More information about the samba-technical mailing list