connection: Refactor 'add_gateway'
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | connection: Simplify exception handling in 'add_gateway'.src/ | +24 | 0 replies | |
| 2/3 | connection: Change the function signature of 'add_gateway'.src/ | +18 | 0 replies | |
| 3/3 | connection: Document 'add_gateway'.src/ | +53 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] connection: Refactor 'add_gateway'
This refactors the 'add_gateway' function by:
1. Leveraging early parameter checking, the 'g_autofree' pointer decoration, and the 'g_steal_pointer' macro to simplify exception handling.
2. Changing the function signature by migrating the return type to a double-pointer parameter and changing the return type to an 'int' for error status.
This allows passing the full range of failure errors to the caller and allows the caller to pass those errors directly along as their own return status.
In addition, this documents the function.
Grant Erickson (3):
connection: Simplify exception handling in 'add_gateway'.
connection: Change the function signature of 'add_gateway'.
connection: Document 'add_gateway'.
src/connection.c | 124 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 92 insertions(+), 32 deletions(-)
Signature · 1 line
2.42.0