[SCM] Samba Shared Repository - branch master updated

Kai Blin kai at samba.org
Wed May 30 08:31:43 MDT 2012


>> I still disagree with the claim that the fact a macro called
>> "NT_STATUS_NOT_OK_RETURN" changes control flow is a surprise,
> 
> Yes agreed, but the benefit to readability that the extra ~2 lines of
> code added is worth it IMO. Conditional cleanup and gotos make such
> macros even worse.

After playing a little with macros for my editor, I'm actually starting
to agree. The code _is_ more obvious, and a simple one-liner in my
editor's config file takes care of the boilerplate. So I retract my
objection.

Does anybody know if the unlikely() condition on the macros has a huge
performance impact?

if (unlikely(!foo)) {
	return NT_STATUS_NO_MEMORY;
}

isn't terribly readable either, but then again especially in the "no
memory" case, we're probably about to die anyway...

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