commit 29f84c17e3fa7362a5e51c2b1a7fb5bf4082f655
parent 3615bb2ade2ec25ab0e5e55c634ff41d93b304de
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Thu, 31 Oct 2019 15:52:44 +0100
Fix enum VS int mismatch when using enum members as flags
Diffstat:
7 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/senc2d.h b/src/senc2d.h
@@ -151,7 +151,7 @@ senc2d_device_ref_put
SENC2D_API res_T
senc2d_scene_create
(struct senc2d_device* device,
- const enum senc2d_convention convention,
+ const int convention,
struct senc2d_scene** scene);
/* Reserve memory according to anticipated scene size. */
@@ -195,7 +195,7 @@ senc2d_scene_analyze
SENC2D_API res_T
senc2d_scene_get_convention
(const struct senc2d_scene* scene,
- enum senc2d_convention* convention);
+ int* convention);
/* Returns the number of segments in the scene. */
SENC2D_API res_T
diff --git a/src/senc2d_scene.c b/src/senc2d_scene.c
@@ -58,7 +58,7 @@ compatible_medium
res_T
senc2d_scene_create
(struct senc2d_device* dev,
- const enum senc2d_convention conv,
+ const int conv,
struct senc2d_scene** out_scn)
{
struct senc2d_scene* scn = NULL;
@@ -335,7 +335,7 @@ error:
res_T
senc2d_scene_get_convention
(const struct senc2d_scene* scn,
- enum senc2d_convention* convention)
+ int* convention)
{
if(!scn || !convention) return RES_BAD_ARG;
*convention = scn->convention;
diff --git a/src/senc2d_scene_c.h b/src/senc2d_scene_c.h
@@ -153,7 +153,7 @@ side_range_init(struct mem_allocator* alloc, struct side_range* data)
struct senc2d_scene {
/* Front / Back sides convention */
- enum senc2d_convention convention;
+ int convention;
/* Segment information as given by user; no duplicates here */
struct darray_segment_in segments_in;
diff --git a/src/test_senc2d_enclosure.c b/src/test_senc2d_enclosure.c
@@ -22,7 +22,7 @@
#include <star/s2d.h>
static void
-test(enum senc2d_convention convention)
+test(int convention)
{
struct mem_allocator allocator;
struct senc2d_descriptor* desc = NULL;
@@ -41,7 +41,7 @@ test(enum senc2d_convention convention)
double vrtx[2];
struct context ctx;
unsigned i, n, t, ecount;
- enum senc2d_convention conv;
+ int conv;
int is_front, is_in;
CHK(mem_init_proxy_allocator(&allocator, &mem_default_allocator) == RES_OK);
diff --git a/src/test_senc2d_inconsistant_square.c b/src/test_senc2d_inconsistant_square.c
@@ -44,7 +44,7 @@ static const unsigned
inconsistant_medium_back[4] = { 0, 1, 1, 1 };
static void
-test(enum senc2d_convention convention)
+test(int convention)
{
struct mem_allocator allocator;
struct senc2d_descriptor* desc = NULL;
@@ -52,7 +52,7 @@ test(enum senc2d_convention convention)
struct senc2d_scene* scn = NULL;
struct senc2d_enclosure* enclosure;
struct senc2d_enclosure_header header;
- enum senc2d_convention conv;
+ int conv;
int conv_front, conv_in;
struct context ctx;
unsigned i, e, ecount;
diff --git a/src/test_senc2d_scene.c b/src/test_senc2d_scene.c
@@ -32,7 +32,7 @@ main(int argc, char** argv)
unsigned medfront[2], medback[2], ind[2];
double vrtx[2];
unsigned count, i, maxm;
- enum senc2d_convention convention;
+ int convention;
(void)argc, (void)argv;
CHK(mem_init_proxy_allocator(&allocator, &mem_default_allocator) == RES_OK);
diff --git a/src/test_senc2d_undefined_medium.c b/src/test_senc2d_undefined_medium.c
@@ -20,7 +20,7 @@
#include <rsys/double2.h>
static void
-test(enum senc2d_convention convention)
+test(int convention)
{
struct mem_allocator allocator;
struct senc2d_descriptor* desc = NULL;