commit 950254e6bfe00fb96b4991378305c0345b7f2812
parent 03a18686244416c338e1eb2aae8babcc7f133a9c
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Fri, 12 Jan 2018 11:55:50 +0100
Fix non-conformity related MSVC build problem
MSVC does like 'interface' as it #define it as struct
Diffstat:
11 files changed, 155 insertions(+), 155 deletions(-)
diff --git a/src/sdis.h b/src/sdis.h
@@ -237,15 +237,15 @@ sdis_interface_create
struct sdis_medium* back,
const struct sdis_interface_shader* shader,
struct sdis_data* data, /* Data sent to the shader. May be NULL */
- struct sdis_interface** interface);
+ struct sdis_interface** interf);
SDIS_API res_T
sdis_interface_ref_get
- (struct sdis_interface* interface);
+ (struct sdis_interface* interf);
SDIS_API res_T
sdis_interface_ref_put
- (struct sdis_interface* interface);
+ (struct sdis_interface* interf);
/*******************************************************************************
* A scene is a collection of triangles. Each triangle is the support of the
@@ -256,7 +256,7 @@ sdis_scene_create
(struct sdis_device* dev,
const size_t ntris, /* #triangles */
void (*indices)(const size_t itri, size_t ids[3], void*),
- void (*interface)(const size_t itri, struct sdis_interface** bound, void*),
+ void (*interf)(const size_t itri, struct sdis_interface** bound, void*),
const size_t nverts, /* #vertices */
void (*position)(const size_t ivert, double pos[3], void* ctx),
void* ctx,
diff --git a/src/sdis_interface.c b/src/sdis_interface.c
@@ -57,16 +57,16 @@ check_interface_shader
static void
interface_release(ref_T* ref)
{
- struct sdis_interface* interface = NULL;
+ struct sdis_interface* interf = NULL;
struct sdis_device* dev = NULL;
ASSERT(ref);
- interface = CONTAINER_OF(ref, struct sdis_interface, ref);
- dev = interface->dev;
- if(interface->medium_front) SDIS(medium_ref_put(interface->medium_front));
- if(interface->medium_back) SDIS(medium_ref_put(interface->medium_back));
- if(interface->data) SDIS(data_ref_put(interface->data));
- flist_name_del(&dev->names, interface->id);
- MEM_RM(dev->allocator, interface);
+ interf = CONTAINER_OF(ref, struct sdis_interface, ref);
+ dev = interf->dev;
+ if(interf->medium_front) SDIS(medium_ref_put(interf->medium_front));
+ if(interf->medium_back) SDIS(medium_ref_put(interf->medium_back));
+ if(interf->data) SDIS(data_ref_put(interf->data));
+ flist_name_del(&dev->names, interf->id);
+ MEM_RM(dev->allocator, interf);
SDIS(device_ref_put(dev));
}
@@ -82,7 +82,7 @@ sdis_interface_create
struct sdis_data* data,
struct sdis_interface** out_interface)
{
- struct sdis_interface* interface = NULL;
+ struct sdis_interface* interf = NULL;
res_T res = RES_OK;
if(!dev || !front || !back || !shader || !out_interface) {
@@ -103,51 +103,51 @@ sdis_interface_create
goto error;
}
- interface = MEM_CALLOC(dev->allocator, 1, sizeof(struct sdis_interface));
- if(!interface) {
+ interf = MEM_CALLOC(dev->allocator, 1, sizeof(struct sdis_interface));
+ if(!interf) {
log_err(dev, "%s: could not create the interface.\n", FUNC_NAME);
res = RES_MEM_ERR;
goto error;
}
- ref_init(&interface->ref);
+ ref_init(&interf->ref);
SDIS(medium_ref_get(front));
SDIS(medium_ref_get(back));
SDIS(device_ref_get(dev));
- interface->medium_front = front;
- interface->medium_back = back;
- interface->dev = dev;
- interface->shader = *shader;
- interface->id = flist_name_add(&dev->names);
+ interf->medium_front = front;
+ interf->medium_back = back;
+ interf->dev = dev;
+ interf->shader = *shader;
+ interf->id = flist_name_add(&dev->names);
if(data) {
SDIS(data_ref_get(data));
- interface->data = data;
+ interf->data = data;
}
exit:
- if(out_interface) *out_interface = interface;
+ if(out_interface) *out_interface = interf;
return res;
error:
- if(interface) {
- SDIS(interface_ref_put(interface));
- interface = NULL;
+ if(interf) {
+ SDIS(interface_ref_put(interf));
+ interf = NULL;
}
goto exit;
}
res_T
-sdis_interface_ref_get(struct sdis_interface* interface)
+sdis_interface_ref_get(struct sdis_interface* interf)
{
- if(!interface) return RES_BAD_ARG;
- ref_get(&interface->ref);
+ if(!interf) return RES_BAD_ARG;
+ ref_get(&interf->ref);
return RES_OK;
}
res_T
-sdis_interface_ref_put(struct sdis_interface* interface)
+sdis_interface_ref_put(struct sdis_interface* interf)
{
- if(!interface) return RES_BAD_ARG;
- ref_put(&interface->ref, interface_release);
+ if(!interf) return RES_BAD_ARG;
+ ref_put(&interf->ref, interface_release);
return RES_OK;
}
@@ -156,23 +156,23 @@ sdis_interface_ref_put(struct sdis_interface* interface)
******************************************************************************/
const struct sdis_medium*
interface_get_medium
- (const struct sdis_interface* interface, const enum sdis_side_flag side)
+ (const struct sdis_interface* interf, const enum sdis_side_flag side)
{
struct sdis_medium* mdm = NULL;
- ASSERT(interface);
+ ASSERT(interf);
switch(side) {
- case SDIS_FRONT: mdm = interface->medium_front; break;
- case SDIS_BACK: mdm = interface->medium_back; break;
+ case SDIS_FRONT: mdm = interf->medium_front; break;
+ case SDIS_BACK: mdm = interf->medium_back; break;
default: FATAL("Unreachable code.\n"); break;
}
return mdm;
}
unsigned
-interface_get_id(const struct sdis_interface* interface)
+interface_get_id(const struct sdis_interface* interf)
{
- ASSERT(interface);
- return interface->id.index;
+ ASSERT(interf);
+ return interf->id.index;
}
void
diff --git a/src/sdis_interface_c.h b/src/sdis_interface_c.h
@@ -37,12 +37,12 @@ struct sdis_interface {
extern LOCAL_SYM const struct sdis_medium*
interface_get_medium
- (const struct sdis_interface* interface,
+ (const struct sdis_interface* interf,
const enum sdis_side_flag side);
extern LOCAL_SYM unsigned
interface_get_id
- (const struct sdis_interface* interface);
+ (const struct sdis_interface* interf);
extern LOCAL_SYM void
setup_interface_fragment
@@ -52,21 +52,21 @@ setup_interface_fragment
static INLINE double
interface_get_temperature
- (const struct sdis_interface* interface,
+ (const struct sdis_interface* interf,
const struct sdis_interface_fragment* frag)
{
- ASSERT(interface && frag);
- if(!interface->shader.temperature) return -DBL_MAX;
- return interface->shader.temperature(frag, interface->data);
+ ASSERT(interf && frag);
+ if(!interf->shader.temperature) return -DBL_MAX;
+ return interf->shader.temperature(frag, interf->data);
}
static INLINE double
interface_get_convection_coef
- (const struct sdis_interface* interface,
+ (const struct sdis_interface* interf,
const struct sdis_interface_fragment* frag)
{
- ASSERT(interface && frag);
- return interface->shader.convection_coef(frag, interface->data);
+ ASSERT(interf && frag);
+ return interf->shader.convection_coef(frag, interf->data);
}
#endif /* SDIS_INTERFACE_C_H */
diff --git a/src/sdis_scene.c b/src/sdis_scene.c
@@ -58,25 +58,25 @@ clear_interfaces(struct sdis_scene* scn)
{
size_t i;
ASSERT(scn);
- FOR_EACH(i, 0, darray_interface_size_get(&scn->interfaces)) {
- if(darray_interface_cdata_get(&scn->interfaces)[i]) {
- SDIS(interface_ref_put(darray_interface_data_get(&scn->interfaces)[i]));
+ FOR_EACH(i, 0, darray_interf_size_get(&scn->interfaces)) {
+ if(darray_interf_cdata_get(&scn->interfaces)[i]) {
+ SDIS(interface_ref_put(darray_interf_data_get(&scn->interfaces)[i]));
}
}
- darray_interface_clear(&scn->interfaces);
- darray_interface_clear(&scn->prim_interfaces);
+ darray_interf_clear(&scn->interfaces);
+ darray_interf_clear(&scn->prim_interfaces);
}
static res_T
setup_interfaces
(struct sdis_scene* scn,
const size_t ntris, /* #triangles */
- void (*interface)(const size_t itri, struct sdis_interface**, void*),
+ void (*interf)(const size_t itri, struct sdis_interface**, void*),
void* ctx)
{
size_t itri;
res_T res = RES_OK;
- ASSERT(ntris && interface);
+ ASSERT(ntris && interf);
clear_interfaces(scn);
@@ -86,24 +86,24 @@ setup_interfaces
unsigned id;
/* Retrieve the interface of the primitive */
- interface(itri, &itface, ctx);
+ interf(itri, &itface, ctx);
id = interface_get_id(itface);
/* Check that the interface is already registered against the scene */
- ninterfaces = darray_interface_size_get(&scn->interfaces);
+ ninterfaces = darray_interf_size_get(&scn->interfaces);
if(id >= ninterfaces) {
- res = darray_interface_resize(&scn->interfaces, id + 1);
+ res = darray_interf_resize(&scn->interfaces, id + 1);
if(res != RES_OK) goto error;
}
- if(darray_interface_cdata_get(&scn->interfaces)[id]) {
- ASSERT(darray_interface_cdata_get(&scn->interfaces)[id] == itface);
+ if(darray_interf_cdata_get(&scn->interfaces)[id]) {
+ ASSERT(darray_interf_cdata_get(&scn->interfaces)[id] == itface);
} else {
SDIS(interface_ref_get(itface));
- darray_interface_data_get(&scn->interfaces)[id] = itface;
+ darray_interf_data_get(&scn->interfaces)[id] = itface;
}
/* Register the primitive interface */
- res = darray_interface_push_back(&scn->prim_interfaces, &itface);
+ res = darray_interf_push_back(&scn->prim_interfaces, &itface);
if(res != RES_OK) goto error;
}
@@ -192,8 +192,8 @@ scene_release(ref_T * ref)
scn = CONTAINER_OF(ref, struct sdis_scene, ref);
dev = scn->dev;
clear_interfaces(scn);
- darray_interface_release(&scn->interfaces);
- darray_interface_release(&scn->prim_interfaces);
+ darray_interf_release(&scn->interfaces);
+ darray_interf_release(&scn->prim_interfaces);
if(scn->s3d_view) S3D(scene_view_ref_put(scn->s3d_view));
MEM_RM(dev->allocator, scn);
SDIS(device_ref_put(dev));
@@ -207,7 +207,7 @@ sdis_scene_create
(struct sdis_device* dev,
const size_t ntris, /* #triangles */
void (*indices)(const size_t itri, size_t ids[3], void*),
- void (*interface)(const size_t itri, struct sdis_interface** bound, void*),
+ void (*interf)(const size_t itri, struct sdis_interface** bound, void*),
const size_t nverts, /* #vertices */
void (*position)(const size_t ivert, double pos[3], void* ctx),
void* ctx,
@@ -216,7 +216,7 @@ sdis_scene_create
struct sdis_scene* scn = NULL;
res_T res = RES_OK;
- if(!dev || !out_scn || !ntris || !indices || !interface || !nverts
+ if(!dev || !out_scn || !ntris || !indices || !interf || !nverts
|| !position || ntris > UINT_MAX || nverts > UINT_MAX) {
res = RES_BAD_ARG;
goto error;
@@ -231,10 +231,10 @@ sdis_scene_create
ref_init(&scn->ref);
SDIS(device_ref_get(dev));
scn->dev = dev;
- darray_interface_init(dev->allocator, &scn->interfaces);
- darray_interface_init(dev->allocator, &scn->prim_interfaces);
+ darray_interf_init(dev->allocator, &scn->interfaces);
+ darray_interf_init(dev->allocator, &scn->prim_interfaces);
- res = setup_interfaces(scn, ntris, interface, ctx);
+ res = setup_interfaces(scn, ntris, interf, ctx);
if(res != RES_OK) {
log_err(dev, "%s: could not setup the scene interfaces.\n", FUNC_NAME);
goto error;
@@ -293,8 +293,8 @@ sdis_scene_get_aabb
const struct sdis_interface*
scene_get_interface(const struct sdis_scene* scn, const unsigned iprim)
{
- ASSERT(scn && iprim < darray_interface_size_get(&scn->prim_interfaces));
- return darray_interface_cdata_get(&scn->prim_interfaces)[iprim];
+ ASSERT(scn && iprim < darray_interf_size_get(&scn->prim_interfaces));
+ return darray_interf_cdata_get(&scn->prim_interfaces)[iprim];
}
res_T
@@ -343,10 +343,10 @@ scene_get_medium
}
if(absf(cos_N_dir) > 1.e-1f) { /* Not roughly orthognonal */
- const struct sdis_interface* interface;
- interface = scene_get_interface(scn, hit.prim.prim_id);
+ const struct sdis_interface* interf;
+ interf = scene_get_interface(scn, hit.prim.prim_id);
medium = interface_get_medium
- (interface, cos_N_dir < 0 ? SDIS_FRONT : SDIS_BACK);
+ (interf, cos_N_dir < 0 ? SDIS_FRONT : SDIS_BACK);
break;
}
}
diff --git a/src/sdis_scene_c.h b/src/sdis_scene_c.h
@@ -32,21 +32,21 @@ struct geometry_context {
static INLINE void
interface_init
(struct mem_allocator* allocator,
- struct sdis_interface** interface)
+ struct sdis_interface** interf)
{
(void)allocator;
- *interface = NULL;
+ *interf = NULL;
}
/* Declare the array of interfaces */
-#define DARRAY_NAME interface
+#define DARRAY_NAME interf
#define DARRAY_DATA struct sdis_interface*
#define DARRAY_FUNCTOR_INIT interface_init
#include <rsys/dynamic_array.h>
struct sdis_scene {
- struct darray_interface interfaces; /* List of interfaces own by the scene */
- struct darray_interface prim_interfaces; /* Per primitive interface */
+ struct darray_interf interfaces; /* List of interfaces own by the scene */
+ struct darray_interf prim_interfaces; /* Per primitive interface */
struct s3d_scene_view* s3d_view;
ref_T ref;
diff --git a/src/sdis_solve_probe.c b/src/sdis_solve_probe.c
@@ -143,7 +143,7 @@ solid_solid_boundary_temperature
struct ssp_rng* rng,
struct temperature* T)
{
- const struct sdis_interface* interface = NULL;
+ const struct sdis_interface* interf = NULL;
const struct sdis_medium* solid_front = NULL;
const struct sdis_medium* solid_back = NULL;
double lambda_front, lambda_back;
@@ -159,9 +159,9 @@ solid_solid_boundary_temperature
(void)frag;
/* Retrieve the current boundary media */
- interface = scene_get_interface(scn, rwalk->hit.prim.prim_id);
- solid_front = interface_get_medium(interface, SDIS_FRONT);
- solid_back = interface_get_medium(interface, SDIS_BACK);
+ interf = scene_get_interface(scn, rwalk->hit.prim.prim_id);
+ solid_front = interface_get_medium(interf, SDIS_FRONT);
+ solid_back = interface_get_medium(interf, SDIS_BACK);
ASSERT(solid_front->type == SDIS_MEDIUM_SOLID);
ASSERT(solid_back->type == SDIS_MEDIUM_SOLID);
@@ -211,7 +211,7 @@ solid_fluid_boundary_temperature
struct ssp_rng* rng,
struct temperature* T)
{
- const struct sdis_interface* interface = NULL;
+ const struct sdis_interface* interf = NULL;
const struct sdis_medium* mdm_front = NULL;
const struct sdis_medium* mdm_back = NULL;
const struct sdis_medium* solid = NULL;
@@ -228,9 +228,9 @@ solid_fluid_boundary_temperature
ASSERT(check_rwalk_fragment_consistency(rwalk, frag));
/* Retrieve the solid and the fluid split by the boundary */
- interface = scene_get_interface(scn, rwalk->hit.prim.prim_id);
- mdm_front = interface_get_medium(interface, SDIS_FRONT);
- mdm_back = interface_get_medium(interface, SDIS_BACK);
+ interf = scene_get_interface(scn, rwalk->hit.prim.prim_id);
+ mdm_front = interface_get_medium(interf, SDIS_FRONT);
+ mdm_back = interface_get_medium(interf, SDIS_BACK);
ASSERT(mdm_front->type != mdm_back->type);
if(mdm_front->type == SDIS_MEDIUM_SOLID) {
solid = mdm_front;
@@ -243,7 +243,7 @@ solid_fluid_boundary_temperature
/* Fetch the solid properties */
lambda = solid_get_thermal_conductivity(solid, &rwalk->vtx);
delta_boundary = solid_get_delta_boundary(solid, &rwalk->vtx);
- hc = interface_get_convection_coef(interface, frag);
+ hc = interface_get_convection_coef(interf, frag);
/* Compute the probas to switch in solid or fluid random walk */
tmp = lambda / (delta_boundary*fp_to_meter);
@@ -280,7 +280,7 @@ boundary_temperature
struct temperature* T)
{
struct sdis_interface_fragment frag = SDIS_INTERFACE_FRAGMENT_NULL;
- const struct sdis_interface* interface = NULL;
+ const struct sdis_interface* interf = NULL;
const struct sdis_medium* mdm_front = NULL;
const struct sdis_medium* mdm_back = NULL;
double tmp;
@@ -290,18 +290,18 @@ boundary_temperature
setup_interface_fragment(&frag, &rwalk->vtx, &rwalk->hit);
/* Retrieve the current interface */
- interface = scene_get_interface(scn, rwalk->hit.prim.prim_id);
+ interf = scene_get_interface(scn, rwalk->hit.prim.prim_id);
/* Check if the boundary condition is known */
- tmp = interface_get_temperature(interface, &frag);
+ tmp = interface_get_temperature(interf, &frag);
if(tmp >= 0) {
T->value += tmp;
T->done = 1;
return RES_OK;
}
- mdm_front = interface_get_medium(interface, SDIS_FRONT);
- mdm_back = interface_get_medium(interface, SDIS_BACK);
+ mdm_front = interface_get_medium(interf, SDIS_FRONT);
+ mdm_back = interface_get_medium(interf, SDIS_BACK);
if(mdm_front->type == mdm_back->type) {
solid_solid_boundary_temperature(scn, fp_to_meter, &frag, rwalk, rng, T);
@@ -404,10 +404,10 @@ solid_temperature
if(S3D_HIT_NONE(&rwalk->hit)) {
CHK(scene_get_medium(scn, rwalk->vtx.P, &mdm) == RES_OK);
} else {
- const struct sdis_interface* interface;
- interface = scene_get_interface(scn, rwalk->hit.prim.prim_id);
+ const struct sdis_interface* interf;
+ interf = scene_get_interface(scn, rwalk->hit.prim.prim_id);
mdm = interface_get_medium
- (interface,
+ (interf,
f3_dot(rwalk->hit.normal, dir0) < 0 ? SDIS_FRONT : SDIS_BACK);
}
diff --git a/src/test_sdis_interface.c b/src/test_sdis_interface.c
@@ -23,7 +23,7 @@ main(int argc, char** argv)
struct sdis_device* dev = NULL;
struct sdis_medium* fluid = NULL;
struct sdis_medium* solid = NULL;
- struct sdis_interface* interface = NULL;
+ struct sdis_interface* interf = NULL;
struct sdis_fluid_shader fluid_shader = DUMMY_FLUID_SHADER;
struct sdis_solid_shader solid_shader = DUMMY_SOLID_SHADER;
struct sdis_interface_shader shader = DUMMY_INTERFACE_SHADER;
@@ -53,42 +53,42 @@ main(int argc, char** argv)
CHK(CREATE(dev, NULL, fluid, &shader, NULL, NULL) == RES_BAD_ARG);
CHK(CREATE(NULL, solid, fluid, &shader, NULL, NULL) == RES_BAD_ARG);
CHK(CREATE(dev, solid, fluid, &shader, NULL, NULL) == RES_BAD_ARG);
- CHK(CREATE(NULL, NULL, NULL, NULL, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(dev, NULL, NULL, NULL, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(NULL, solid, NULL, NULL, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(dev, solid, NULL, NULL, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(NULL, NULL, fluid, NULL, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(dev, NULL, fluid, NULL, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(NULL, solid, fluid, NULL, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(dev, solid, fluid, NULL, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(NULL, NULL, NULL, &shader, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(dev, NULL, NULL, &shader, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(NULL, solid, NULL, &shader, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(dev, solid, NULL, &shader, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(NULL, NULL, fluid, &shader, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(dev, NULL, fluid, &shader, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(NULL, solid, fluid, &shader, NULL, &interface) == RES_BAD_ARG);
- CHK(CREATE(dev, solid, fluid, &shader, NULL, &interface) == RES_OK);
+ CHK(CREATE(NULL, NULL, NULL, NULL, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(dev, NULL, NULL, NULL, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(NULL, solid, NULL, NULL, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(dev, solid, NULL, NULL, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(NULL, NULL, fluid, NULL, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(dev, NULL, fluid, NULL, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(NULL, solid, fluid, NULL, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(dev, solid, fluid, NULL, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(NULL, NULL, NULL, &shader, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(dev, NULL, NULL, &shader, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(NULL, solid, NULL, &shader, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(dev, solid, NULL, &shader, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(NULL, NULL, fluid, &shader, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(dev, NULL, fluid, &shader, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(NULL, solid, fluid, &shader, NULL, &interf) == RES_BAD_ARG);
+ CHK(CREATE(dev, solid, fluid, &shader, NULL, &interf) == RES_OK);
CHK(sdis_interface_ref_get(NULL) == RES_BAD_ARG);
- CHK(sdis_interface_ref_get(interface) == RES_OK);
+ CHK(sdis_interface_ref_get(interf) == RES_OK);
CHK(sdis_interface_ref_put(NULL) == RES_BAD_ARG);
- CHK(sdis_interface_ref_put(interface) == RES_OK);
- CHK(sdis_interface_ref_put(interface) == RES_OK);
+ CHK(sdis_interface_ref_put(interf) == RES_OK);
+ CHK(sdis_interface_ref_put(interf) == RES_OK);
- CHK(CREATE(dev, solid, solid, &shader, NULL, &interface) == RES_BAD_ARG);
+ CHK(CREATE(dev, solid, solid, &shader, NULL, &interf) == RES_BAD_ARG);
shader.convection_coef = NULL;
- CHK(CREATE(dev, solid, solid, &shader, NULL, &interface) == RES_OK);
- CHK(sdis_interface_ref_put(interface) == RES_OK);
+ CHK(CREATE(dev, solid, solid, &shader, NULL, &interf) == RES_OK);
+ CHK(sdis_interface_ref_put(interf) == RES_OK);
shader.temperature = NULL;
- CHK(CREATE(dev, solid, solid, &shader, NULL, &interface) == RES_OK);
- CHK(sdis_interface_ref_put(interface) == RES_OK);
+ CHK(CREATE(dev, solid, solid, &shader, NULL, &interf) == RES_OK);
+ CHK(sdis_interface_ref_put(interf) == RES_OK);
- CHK(CREATE(dev, solid, fluid, &shader, NULL, &interface) == RES_BAD_ARG);
+ CHK(CREATE(dev, solid, fluid, &shader, NULL, &interf) == RES_BAD_ARG);
shader.convection_coef = DUMMY_INTERFACE_SHADER.convection_coef;
- CHK(CREATE(dev, solid, fluid, &shader, NULL, &interface) == RES_OK);
- CHK(sdis_interface_ref_put(interface) == RES_OK);
+ CHK(CREATE(dev, solid, fluid, &shader, NULL, &interf) == RES_OK);
+ CHK(sdis_interface_ref_put(interf) == RES_OK);
#undef CREATE
CHK(sdis_device_ref_put(dev) == RES_OK);
diff --git a/src/test_sdis_scene.c b/src/test_sdis_scene.c
@@ -20,7 +20,7 @@
struct context {
const double* positions;
const size_t* indices;
- struct sdis_interface* interface;
+ struct sdis_interface* interf;
};
static INLINE void
@@ -52,7 +52,7 @@ get_interface(const size_t itri, struct sdis_interface** bound, void* context)
CHK(ctx != NULL);
CHK(itri < box_ntriangles);
CHK(bound != NULL);
- *bound = ctx->interface;
+ *bound = ctx->interf;
}
int
@@ -62,7 +62,7 @@ main(int argc, char** argv)
struct sdis_device* dev = NULL;
struct sdis_medium* solid = NULL;
struct sdis_medium* fluid = NULL;
- struct sdis_interface* interface = NULL;
+ struct sdis_interface* interf = NULL;
struct sdis_scene* scn = NULL;
struct sdis_fluid_shader fluid_shader = DUMMY_FLUID_SHADER;
struct sdis_solid_shader solid_shader = DUMMY_SOLID_SHADER;
@@ -78,11 +78,11 @@ main(int argc, char** argv)
CHK(sdis_fluid_create(dev, &fluid_shader, NULL, &fluid) == RES_OK);
CHK(sdis_solid_create(dev, &solid_shader, NULL, &solid) == RES_OK);
CHK(sdis_interface_create
- (dev, solid, fluid, &interface_shader, NULL, &interface) == RES_OK);
+ (dev, solid, fluid, &interface_shader, NULL, &interf) == RES_OK);
ctx.positions = box_vertices;
ctx.indices = box_indices;
- ctx.interface = interface;
+ ctx.interf = interf;
ntris = box_ntriangles;
npos = box_nvertices;
@@ -122,7 +122,7 @@ main(int argc, char** argv)
CHK(sdis_scene_ref_put(scn) == RES_OK);
CHK(sdis_device_ref_put(dev) == RES_OK);
- CHK(sdis_interface_ref_put(interface) == RES_OK);
+ CHK(sdis_interface_ref_put(interf) == RES_OK);
CHK(sdis_medium_ref_put(solid) == RES_OK);
CHK(sdis_medium_ref_put(fluid) == RES_OK);
diff --git a/src/test_sdis_solve_probe.c b/src/test_sdis_solve_probe.c
@@ -38,7 +38,7 @@
struct context {
const double* positions;
const size_t* indices;
- struct sdis_interface* interface;
+ struct sdis_interface* interf;
};
static void
@@ -64,7 +64,7 @@ get_interface(const size_t itri, struct sdis_interface** bound, void* context)
{
struct context* ctx = context;
(void)itri;
- *bound = ctx->interface;
+ *bound = ctx->interf;
}
/*******************************************************************************
@@ -144,7 +144,7 @@ solid_get_temperature
/*******************************************************************************
* Interface
******************************************************************************/
-struct interface {
+struct interf {
double hc;
};
@@ -153,7 +153,7 @@ interface_get_convection_coef
(const struct sdis_interface_fragment* frag, struct sdis_data* data)
{
CHK(data != NULL && frag != NULL);
- return ((const struct interface*)sdis_data_cget(data))->hc;
+ return ((const struct interf*)sdis_data_cget(data))->hc;
}
/*******************************************************************************
@@ -167,7 +167,7 @@ main(int argc, char** argv)
struct sdis_device* dev = NULL;
struct sdis_medium* solid = NULL;
struct sdis_medium* fluid = NULL;
- struct sdis_interface* interface = NULL;
+ struct sdis_interface* interf = NULL;
struct sdis_scene* scn = NULL;
struct sdis_data* data = NULL;
struct sdis_estimator* estimator = NULL;
@@ -177,7 +177,7 @@ main(int argc, char** argv)
struct context ctx;
struct fluid* fluid_param;
struct solid* solid_param;
- struct interface* interface_param;
+ struct interf* interface_param;
double pos[3];
double time;
double ref;
@@ -218,14 +218,14 @@ main(int argc, char** argv)
CHK(sdis_data_ref_put(data) == RES_OK);
/* Create the solid/fluid interface */
- CHK(sdis_data_create(dev, sizeof(struct interface),
- ALIGNOF(struct interface), NULL, &data) == RES_OK);
+ CHK(sdis_data_create(dev, sizeof(struct interf),
+ ALIGNOF(struct interf), NULL, &data) == RES_OK);
interface_param = sdis_data_get(data);
interface_param->hc = 0.5;
interface_shader.convection_coef = interface_get_convection_coef;
interface_shader.temperature = NULL;
CHK(sdis_interface_create
- (dev, solid, fluid, &interface_shader, data, &interface) == RES_OK);
+ (dev, solid, fluid, &interface_shader, data, &interf) == RES_OK);
CHK(sdis_data_ref_put(data) == RES_OK);
/* Release the media */
@@ -235,11 +235,11 @@ main(int argc, char** argv)
/* Create the scene */
ctx.positions = box_vertices;
ctx.indices = box_indices;
- ctx.interface = interface;
+ ctx.interf = interf;
CHK(sdis_scene_create(dev, box_ntriangles, get_indices, get_interface,
box_nvertices, get_position, &ctx, &scn) == RES_OK);
- CHK(sdis_interface_ref_put(interface) == RES_OK);
+ CHK(sdis_interface_ref_put(interf) == RES_OK);
/* Test the solver */
pos[0] = 0.5;
diff --git a/src/test_sdis_solve_probe2.c b/src/test_sdis_solve_probe2.c
@@ -126,7 +126,7 @@ solid_get_delta_boundary
/*******************************************************************************
* Interface
******************************************************************************/
-struct interface {
+struct interf {
double temperature;
};
@@ -144,7 +144,7 @@ interface_get_temperature
(const struct sdis_interface_fragment* frag, struct sdis_data* data)
{
CHK(data != NULL && frag != NULL);
- return ((const struct interface*)sdis_data_cget(data))->temperature;
+ return ((const struct interf*)sdis_data_cget(data))->temperature;
}
/*******************************************************************************
@@ -169,7 +169,7 @@ main(int argc, char** argv)
struct sdis_interface_shader interface_shader = DUMMY_INTERFACE_SHADER;
struct sdis_interface* interfaces[12];
struct context ctx;
- struct interface* interface_param = NULL;
+ struct interf* interface_param = NULL;
double pos[3];
double time;
double ref;
@@ -202,8 +202,8 @@ main(int argc, char** argv)
(dev, solid, fluid, &interface_shader, NULL, &Tnone) == RES_OK);
/* Create the fluid/solid interface with a fixed temperature of 300K */
- CHK(sdis_data_create(dev, sizeof(struct interface),
- ALIGNOF(struct interface), NULL, &data) == RES_OK);
+ CHK(sdis_data_create(dev, sizeof(struct interf),
+ ALIGNOF(struct interf), NULL, &data) == RES_OK);
interface_param = sdis_data_get(data);
interface_param->temperature = 300;
interface_shader.convection_coef = null_convection_coef;
@@ -213,8 +213,8 @@ main(int argc, char** argv)
CHK(sdis_data_ref_put(data) == RES_OK);
/* Create the fluid/solid interface with a fixed temperature of 350K */
- CHK(sdis_data_create(dev, sizeof(struct interface),
- ALIGNOF(struct interface), NULL, &data) == RES_OK);
+ CHK(sdis_data_create(dev, sizeof(struct interf),
+ ALIGNOF(struct interf), NULL, &data) == RES_OK);
interface_param = sdis_data_get(data);
interface_param->temperature = 350;
interface_shader.convection_coef = null_convection_coef;
diff --git a/src/test_sdis_solve_probe3.c b/src/test_sdis_solve_probe3.c
@@ -148,7 +148,7 @@ solid_get_delta_boundary
/*******************************************************************************
* Interface
******************************************************************************/
-struct interface {
+struct interf {
double temperature;
};
@@ -166,7 +166,7 @@ interface_get_temperature
(const struct sdis_interface_fragment* frag, struct sdis_data* data)
{
CHK(data != NULL && frag != NULL);
- return ((const struct interface*)sdis_data_cget(data))->temperature;
+ return ((const struct interf*)sdis_data_cget(data))->temperature;
}
/*******************************************************************************
@@ -193,7 +193,7 @@ main(int argc, char** argv)
struct s3dut_mesh* msh = NULL;
struct s3dut_mesh_data msh_data;
struct context ctx = CONTEXT_NULL;
- struct interface* interface_param = NULL;
+ struct interf* interface_param = NULL;
double pos[3];
double time;
double ref;
@@ -229,8 +229,8 @@ main(int argc, char** argv)
(dev, solid, fluid, &interface_shader, NULL, &Tnone) == RES_OK);
/* Create the fluid/solid interface with a fixed temperature of 300K */
- CHK(sdis_data_create(dev, sizeof(struct interface),
- ALIGNOF(struct interface), NULL, &data) == RES_OK);
+ CHK(sdis_data_create(dev, sizeof(struct interf),
+ ALIGNOF(struct interf), NULL, &data) == RES_OK);
interface_param = sdis_data_get(data);
interface_param->temperature = 300;
interface_shader.convection_coef = null_convection_coef;
@@ -240,8 +240,8 @@ main(int argc, char** argv)
CHK(sdis_data_ref_put(data) == RES_OK);
/* Create the fluid/solid interface with a fixed temperature of 350K */
- CHK(sdis_data_create(dev, sizeof(struct interface),
- ALIGNOF(struct interface), NULL, &data) == RES_OK);
+ CHK(sdis_data_create(dev, sizeof(struct interf),
+ ALIGNOF(struct interf), NULL, &data) == RES_OK);
interface_param = sdis_data_get(data);
interface_param->temperature = 350;
interface_shader.convection_coef = null_convection_coef;