commit 146bac35b2feb390d6879e62f4799696187047b1
parent 9084ddbbfd46d400ae76895150bfb59f8329d237
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 29 Feb 2024 15:11:52 +0100
Update the type of data used by an external source
It was previously a pointer to the external source on Stardis. It is now
a copy of this data to simplify access by avoiding pointers of pointers,
which are subject to error of use. A copy with little counterpart as the
size of the data copied is marginal.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/stardis-extern-source.c b/src/stardis-extern-source.c
@@ -62,10 +62,10 @@ create_solver_source_sphere
ASSERT(src && src->type == EXTERN_SOURCE_SPHERE && stardis);
/* Register with the solver source a pointer to the external source */
- res = sdis_data_create(stardis->dev, sizeof(struct extern_source*),
- ALIGNOF(struct extern_source*), NULL, &data);
+ res = sdis_data_create(stardis->dev, sizeof(struct extern_source),
+ ALIGNOF(struct extern_source), NULL, &data);
if(res != RES_OK) goto error;
- *((struct extern_source**)sdis_data_get(data)) = src;
+ *((struct extern_source*)sdis_data_get(data)) = *src;
/* Create the spherical source */
args.position = sphere_get_position;