On 14/01/2020 16:48, Ian Jackson wrote:
> Andrew Cooper writes ("[PATCH 01/12] libxc/save: Shrink code volume where
> possible"):
>> A property of how the error handling (0 on success, nonzero otherwise)
>> allows these calls to be chained together with the ternary operatior.
> I'm quite
Ian Jackson writes ("Re: [PATCH 01/12] libxc/save: Shrink code volume where
possible"):
> Maybe it would be better to have
> #define MUST(call) ({ rc = (call); if (rc) goto error; })
> and write
> MUST( write_one_vcpu_basic(ctx, i) );
This is not uncommon. BIND9 does something like it:
Andrew Cooper writes ("[PATCH 01/12] libxc/save: Shrink code volume where
possible"):
> A property of how the error handling (0 on success, nonzero otherwise)
> allows these calls to be chained together with the ternary operatior.
I'm quite surprised to find a suggestion like this coming from
A property of how the error handling (0 on success, nonzero otherwise)
allows these calls to be chained together with the ternary operatior.
No functional change, but far less boilerplate code.
Signed-off-by: Andrew Cooper
---
CC: Ian Jackson
CC: Wei Liu
---
tools/libxc/xc_sr_save.c