# HG changeset patch # User Paul Boddie # Date 1627834472 -7200 # Node ID 9cc264c6583a41c1ad19572b8a9084d1381a47a2 # Parent d87ef36176f11cf7f4a247736a46f0e61d630250 Made a template for the client function body epilogue, also fixing it so that the message used is freed. diff -r d87ef36176f1 -r 9cc264c6583a client.c --- a/client.c Sun Aug 01 18:12:58 2021 +0200 +++ b/client.c Sun Aug 01 18:14:32 2021 +0200 @@ -1,7 +1,7 @@ /* * Client code generation. * - * Copyright (C) 2019, 2020 Paul Boddie + * Copyright (C) 2019, 2020, 2021 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -146,9 +146,9 @@ ITEM_CLASS, fp); } - /* Return success. */ + /* Generate the epilogue. */ - fprintf(fp, "\n return L4_EOK;\n"); + fputs(client_function_body_epilogue, fp); /* Free allocated strings. */ diff -r d87ef36176f1 -r 9cc264c6583a templates.h --- a/templates.h Sun Aug 01 18:12:58 2021 +0200 +++ b/templates.h Sun Aug 01 18:14:32 2021 +0200 @@ -1,7 +1,7 @@ /* * Template output. * - * Copyright (C) 2019, 2020 Paul Boddie + * Copyright (C) 2019, 2020, 2021 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -52,6 +52,10 @@ " if (err)\n" \ " return err;\n" +#define client_function_body_epilogue \ +"\n ipc_message_free(&msg);\n" \ +" return L4_EOK;\n" + /* Client interface definitions for C++. */ #define client_interface_prologue_cpp \