[PATCH 0/3] drop the SPOOLSS_BUFFER_OK macro
ddiss at suse.de
Fri Dec 19 11:07:47 MST 2014
-----BEGIN PGP SIGNED MESSAGE-----
On Fri, 19 Dec 2014 18:50:57 +0100, Guenther Deschner wrote:
> Sorry David, NAK on these as well :)
> The macros have been invented just for the purpose of avoiding to put
> manual checks everywhere. If you see a problem with the macros we
> should better fix them but please let's not go down the road again of
> putting all these checks back in the spoolss server explicitly.
I don't understand your objection here. This change makes the code a
whole lot easier to read, and reduces the overhead of the bounds
checking into a single comparison, rather than two or three per
operation. In doing so it only adds 43 lines of code total...
> > #define SPOOLSS_BUFFER_OK(val_true,val_false) ((r->in.offered >=
> > *r->out.needed)?val_true:val_false)
Adding @offered and @needed arguments would make the macro less evil,
but it still wouldn't help with readability or efficiency. Please
take another look at the patches.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-----END PGP SIGNATURE-----
More information about the samba-technical