1.1 --- a/common.c Wed Mar 16 00:03:07 2022 +0100
1.2 +++ b/common.c Sat Jun 04 23:30:36 2022 +0200
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * Common routines.
1.6 *
1.7 - * Copyright (C) 2019, 2020 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2019, 2020, 2022 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -361,7 +361,8 @@
1.13
1.14 /* Return any operator needed to access the given parameter as a local name. */
1.15
1.16 -char *access_name(struct parameter *param, enum component_role component)
1.17 +char *access_name(struct parameter *param, enum component_role component,
1.18 + int writing)
1.19 {
1.20 /* In the client, employ the dereferencing operator for "inout" and "out"
1.21 word parameters since the parameters will employ pointer types. */
1.22 @@ -370,11 +371,18 @@
1.23 (param->cls & WORD_CLASS))
1.24 return "*";
1.25
1.26 + /* In the client, employ the dereferencing operator for written "inout"
1.27 + item parameters since the parameters will employ pointer types. */
1.28 +
1.29 + if ((component == CLIENT_ROLE) && (param->specifier & OUT_PARAMETER) &&
1.30 + (param->cls & ITEM_CLASS) && writing)
1.31 + return "*";
1.32 +
1.33 /* In the server, when importing items from the message, the address of the
1.34 - variable to hold the capability value must be used. */
1.35 + variable to hold the item must be used. */
1.36
1.37 if ((component == SERVER_ROLE) && (param->specifier & IN_PARAMETER) &&
1.38 - (param->cls & ITEM_CLASS))
1.39 + (param->cls & ITEM_CLASS) && !writing)
1.40 return "&";
1.41
1.42 return "";
2.1 --- a/common.h Wed Mar 16 00:03:07 2022 +0100
2.2 +++ b/common.h Sat Jun 04 23:30:36 2022 +0200
2.3 @@ -1,7 +1,7 @@
2.4 /*
2.5 * Common routines.
2.6 *
2.7 - * Copyright (C) 2019, 2020 Paul Boddie <paul@boddie.org.uk>
2.8 + * Copyright (C) 2019, 2020, 2022 Paul Boddie <paul@boddie.org.uk>
2.9 *
2.10 * This program is free software; you can redistribute it and/or
2.11 * modify it under the terms of the GNU General Public License as
2.12 @@ -83,7 +83,7 @@
2.13
2.14 /* Message access details. */
2.15
2.16 -char *access_name(struct parameter *param, enum component_role component);
2.17 +char *access_name(struct parameter *param, enum component_role component, int writing);
2.18 char *item_type_name(struct parameter *param);
2.19 char *reference_message(enum component_role component, enum function_role function);
2.20 char *structure_prefix(enum specifier direction);
3.1 --- a/message.c Wed Mar 16 00:03:07 2022 +0100
3.2 +++ b/message.c Sat Jun 04 23:30:36 2022 +0200
3.3 @@ -1,7 +1,7 @@
3.4 /*
3.5 * Generation of message structure access operations.
3.6 *
3.7 - * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
3.8 + * Copyright (C) 2019, 2022 Paul Boddie <paul@boddie.org.uk>
3.9 *
3.10 * This program is free software; you can redistribute it and/or
3.11 * modify it under the terms of the GNU General Public License as
3.12 @@ -82,7 +82,7 @@
3.13 if ((param->specifier & direction) && (param->cls & cls))
3.14 {
3.15 name = get_parameter_name(param->identifiers);
3.16 - access = access_name(param, component);
3.17 + access = access_name(param, component, writing);
3.18
3.19 switch (cls)
3.20 {