Il 17/10/2012 16:51, Markus Armbruster ha scritto:
>> >  /* Basic flow for negotiation
> The boilerplate pattern
> 
>     Error *local_err = NULL;
>     FOO(..., *local_err);
>     if (local_err) {
>         qerror_report_err(local_err);
>         error_free(local_err);
>     }
> 
> is spreading.  Not quite sure it's worth a macro.

Actually this should not spread, but this one should:

    Error *local_err = NULL;
    FOO(..., *local_err);
    if (local_err) {
        error_propagate(errp, local_err);
        return;
    }

Not quite sure how to macroize it though, at least without making the
code too ugly to see.

Paolo

Reply via email to