Skip to content

Commit

Permalink
Cleanup sertype properties and initialization
Browse files Browse the repository at this point in the history
* Add ddsi_sertype_init_props
* Clean up sertype flags
* Rename IS_FIXED_SIZE to IS_MEMCPY_SAFE
* Delete useless "psmx endpoint serialization required"

Signed-off-by: Erik Boasson <[email protected]>
  • Loading branch information
eboasson authored and dpotman committed Sep 11, 2023
1 parent 61fd734 commit 7040196
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 110 deletions.
12 changes: 12 additions & 0 deletions src/core/cdr/src/dds_cdrstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -4553,10 +4553,22 @@ uint32_t dds_stream_type_nesting_depth (const uint32_t * __restrict ops)
return info.nesting_max;
}

static bool data_type_contains_indirections (dds_data_type_properties_t props)
{
return props & (DDS_DATA_TYPE_CONTAINS_OPTIONAL
| DDS_DATA_TYPE_CONTAINS_STRING
| DDS_DATA_TYPE_CONTAINS_WSTRING
| DDS_DATA_TYPE_CONTAINS_SEQUENCE
| DDS_DATA_TYPE_CONTAINS_BSEQUENCE
| DDS_DATA_TYPE_CONTAINS_EXTERNAL);
}

dds_data_type_properties_t dds_stream_data_types (const uint32_t * __restrict ops)

Check failure

Code scanning / CodeQL

RULE-8-3: All declarations of a function shall use the same names and type qualifiers Error

The return type of re-declaration of
dds_stream_data_types
is not compatible with declaration
dds_stream_data_types
{
struct dds_cdrstream_ops_info info;
dds_stream_get_ops_info (ops, &info);
if (!data_type_contains_indirections (info.data_types))
info.data_types |= DDS_DATA_TYPE_IS_MEMCPY_SAFE;
return info.data_types;
}

Expand Down
14 changes: 1 addition & 13 deletions src/core/ddsc/include/dds/ddsc/dds_data_type_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,7 @@ extern "C" {
#define DDS_DATA_TYPE_CONTAINS_EXTERNAL (0x1ull << 11)
#define DDS_DATA_TYPE_CONTAINS_KEY (0x1ull << 12)

#define DDS_DATA_TYPE_IS_FIXED_SIZE (0x1ull << 63)

/**
* @brief Checks whether a type has indirections (pointers) based on its data-type properties
*/
#define DDS_DATA_TYPE_CONTAINS_INDIRECTIONS(t) ((t) & \
(DDS_DATA_TYPE_CONTAINS_OPTIONAL \
| DDS_DATA_TYPE_CONTAINS_STRING \
| DDS_DATA_TYPE_CONTAINS_BSTRING \
| DDS_DATA_TYPE_CONTAINS_WSTRING \
| DDS_DATA_TYPE_CONTAINS_SEQUENCE \
| DDS_DATA_TYPE_CONTAINS_BSEQUENCE \
| DDS_DATA_TYPE_CONTAINS_EXTERNAL))
#define DDS_DATA_TYPE_IS_MEMCPY_SAFE (0x1ull << 63)

typedef uint64_t dds_data_type_properties_t;

Expand Down
14 changes: 0 additions & 14 deletions src/core/ddsc/include/dds/ddsc/dds_psmx.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,6 @@ typedef struct dds_psmx_ops {
dds_psmx_supported_features_fn supported_features;
} dds_psmx_ops_t;

/**
* @brief Definition for function to check if serialization is required
*
* Definition of a function that checks whether serialization is
* required for a data type with the provided properties.
*
* @param[in] data_type_props The properties of the data type
* @returns true if serialization is required, else otherwise
*
* FIXME: I wonder if we shouldn't do this check in Cyclone's core? But it is true that, e.g., OpenSplice [cw]ould also say "no need", so it isn't simply complicating things
*/
typedef bool (* dds_psmx_serialization_required_fn) (dds_data_type_properties_t data_type_props);

/**
* @brief Definition of function to create an endpoint for a topic
*
Expand All @@ -194,7 +181,6 @@ typedef dds_return_t (* dds_psmx_delete_endpoint_fn) (struct dds_psmx_endpoint *
* @brief functions which are used on a PSMX topic
*/
typedef struct dds_psmx_topic_ops {
dds_psmx_serialization_required_fn serialization_required;
dds_psmx_create_endpoint_fn create_endpoint;
dds_psmx_delete_endpoint_fn delete_endpoint;
} dds_psmx_topic_ops_t;
Expand Down
8 changes: 0 additions & 8 deletions src/core/ddsc/src/dds__psmx.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,4 @@ void dds_psmx_locators_set_free (struct ddsi_psmx_locators_set *psmx_locators_se
*/
dds_loaned_sample_t * dds_psmx_endpoint_request_loan (struct dds_psmx_endpoint *psmx_endpoint, uint32_t sz);

/**
* @brief Check if serialization is required
*
* @param[in] psmx_endpoint the endpoint
* @returns true if serialization is required
*/
bool dds_psmx_endpoint_serialization_required (struct dds_psmx_endpoint *psmx_endpoint);

#endif // DDS__PSMX_H
8 changes: 1 addition & 7 deletions src/core/ddsc/src/dds_psmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,6 @@ dds_loaned_sample_t * dds_psmx_endpoint_request_loan (struct dds_psmx_endpoint *
return psmx_endpoint->ops.request_loan (psmx_endpoint, sz);
}

bool dds_psmx_endpoint_serialization_required (struct dds_psmx_endpoint *psmx_endpoint)
{
assert (psmx_endpoint && psmx_endpoint->psmx_topic);
return psmx_endpoint->psmx_topic->ops.serialization_required (psmx_endpoint->psmx_topic->data_type_props);
}

static dds_psmx_instance_id_t get_psmx_instance_id (const struct ddsi_domaingv * gv, const char *config_name)
{
uint32_t ext_domainid = gv->config.extDomainId.value;
Expand Down Expand Up @@ -426,7 +420,7 @@ static bool endpoint_is_loan_available (const struct dds_endpoint *endpoint)
if (psmx_endpoint == NULL)
continue;
bool is_shm_available = dds_psmx_supported_features (psmx_endpoint->psmx_topic->psmx_instance) & DDS_PSMX_FEATURE_SHARED_MEMORY;
is_loan_available = is_shm_available && !dds_psmx_endpoint_serialization_required (psmx_endpoint);
is_loan_available = is_shm_available && (psmx_endpoint->psmx_topic->data_type_props & DDS_DATA_TYPE_IS_MEMCPY_SAFE);
}
return is_loan_available;
}
Expand Down
14 changes: 7 additions & 7 deletions src/core/ddsc/src/dds_serdata_default.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ static struct ddsi_serdata *serdata_default_from_loaned_sample (const struct dds
const struct dds_sertype_default *tp = (const struct dds_sertype_default *) type;

assert (loaned_sample->loan_origin.origin_kind == DDS_LOAN_ORIGIN_KIND_PSMX);
bool serialize_data = force_serialization || dds_psmx_endpoint_serialization_required (loaned_sample->loan_origin.psmx_endpoint);
bool serialize_data = force_serialization || !type->is_memcpy_safe;

struct dds_serdata_default *d;
if (serialize_data)
Expand Down Expand Up @@ -900,10 +900,10 @@ static struct ddsi_serdata *serdata_default_from_loaned_sample (const struct dds
d->c.loan->metadata->cdr_options = 0;
}

if (tp->c.typekind_no_key)
(void) fix_serdata_default_nokey (d, tp->c.serdata_basehash);
else
if (tp->c.has_key)
(void) fix_serdata_default (d, tp->c.serdata_basehash);
else
(void) fix_serdata_default_nokey (d, tp->c.serdata_basehash);
}

return (struct ddsi_serdata *) d;
Expand Down Expand Up @@ -973,10 +973,10 @@ static struct ddsi_serdata * serdata_default_from_psmx (const struct ddsi_sertyp
}
}

if (tp->c.typekind_no_key)
(void) fix_serdata_default_nokey (d, tp->c.serdata_basehash);
else
if (tp->c.has_key)
(void) fix_serdata_default (d, tp->c.serdata_basehash);
else
(void) fix_serdata_default_nokey (d, tp->c.serdata_basehash);
return (struct ddsi_serdata *) d;
}

Expand Down
16 changes: 6 additions & 10 deletions src/core/ddsc/src/dds_sertype_default.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ static struct ddsi_sertype * sertype_default_derive_sertype (const struct ddsi_s
(void) tce_qos;

if (data_representation == DDS_DATA_REPRESENTATION_XCDR1)
required_ops = base_sertype->typekind_no_key ? &dds_serdata_ops_cdr_nokey : &dds_serdata_ops_cdr;
required_ops = base_sertype->has_key ? &dds_serdata_ops_cdr : &dds_serdata_ops_cdr_nokey;
else if (data_representation == DDS_DATA_REPRESENTATION_XCDR2)
required_ops = base_sertype->typekind_no_key ? &dds_serdata_ops_xcdr2_nokey : &dds_serdata_ops_xcdr2;
required_ops = base_sertype->has_key ? &dds_serdata_ops_xcdr2 : &dds_serdata_ops_xcdr2_nokey;
else
abort ();

Expand Down Expand Up @@ -299,23 +299,19 @@ dds_return_t dds_sertype_default_init (const struct dds_domain *domain, struct d
if (!dds_stream_extensibility (desc->m_ops, &type_ext))
return DDS_RETCODE_BAD_PARAMETER;

ddsi_sertype_init (&st->c, desc->m_typename, &dds_sertype_ops_default, serdata_ops, (desc->m_nkeys == 0));
st->c.zerocopy_size = desc->m_size;
st->c.fixed_size = (st->c.fixed_size || (desc->m_flagset & DDS_TOPIC_FIXED_SIZE)) ? 1u : 0u;
st->c.allowed_data_representation = desc->m_flagset & DDS_TOPIC_RESTRICT_DATA_REPRESENTATION ?
uint32_t allowed_data_representation = desc->m_flagset & DDS_TOPIC_RESTRICT_DATA_REPRESENTATION ?
desc->restrict_data_representation : DDS_DATA_REPRESENTATION_RESTRICT_DEFAULT;
if (min_xcdrv == DDSI_RTPS_CDR_ENC_VERSION_2)
st->c.allowed_data_representation &= ~DDS_DATA_REPRESENTATION_FLAG_XCDR1;
allowed_data_representation &= ~DDS_DATA_REPRESENTATION_FLAG_XCDR1;

ddsi_sertype_init_props (&st->c, desc->m_typename, &dds_sertype_ops_default, serdata_ops, desc->m_size, dds_stream_data_types (desc->m_ops), allowed_data_representation, 0);
st->encoding_format = ddsi_sertype_extensibility_enc_format (type_ext);
/* Store the encoding version used for writing data using this sertype. When reading data,
the encoding version from the encapsulation header in the CDR is used */
st->write_encoding_version = data_representation == DDS_DATA_REPRESENTATION_XCDR1 ? DDSI_RTPS_CDR_ENC_VERSION_1 : DDSI_RTPS_CDR_ENC_VERSION_2;
st->serpool = domain->serpool;

dds_cdrstream_desc_init (&st->type, &dds_cdrstream_default_allocator, desc->m_size, desc->m_align, desc->m_flagset, desc->m_ops, desc->m_keys, desc->m_nkeys);
st->c.data_type_props = dds_stream_data_types (desc->m_ops);
if (st->c.fixed_size)
st->c.data_type_props |= DDS_DATA_TYPE_IS_FIXED_SIZE;

if (min_xcdrv == DDSI_RTPS_CDR_ENC_VERSION_2 && dds_stream_type_nesting_depth (desc->m_ops) > DDS_CDRSTREAM_MAX_NESTING_DEPTH)
{
Expand Down
8 changes: 4 additions & 4 deletions src/core/ddsc/src/dds_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static bool evalute_topic_filter (const dds_writer *wr, const void *data, bool w

static bool requires_serialization(struct dds_topic *topic)
{
return !topic->m_stype->fixed_size;
return !topic->m_stype->is_memcpy_safe;
}

static bool allows_serialization_into_buffer(struct dds_topic *topic)
Expand All @@ -329,7 +329,7 @@ static bool get_required_buffer_size(struct dds_topic *topic, const void *sample
assert (topic && sz32 && sample);

if (!requires_serialization(topic))
sz = topic->m_stype->zerocopy_size;
sz = topic->m_stype->sizeof_type;
else if (allows_serialization_into_buffer(topic))
sz = ddsi_sertype_get_serialized_size(topic->m_stype, (void*) sample);
else
Expand Down Expand Up @@ -383,9 +383,9 @@ dds_return_t dds_request_writer_loan (dds_writer *wr, void **sample)
assert (wr->m_endpoint.psmx_endpoints.length <= 1);

dds_loaned_sample_t *loan;
if (wr->m_endpoint.psmx_endpoints.length > 0 && wr->m_topic->m_stype->fixed_size)
if (wr->m_endpoint.psmx_endpoints.length > 0 && wr->m_topic->m_stype->is_memcpy_safe)
{
if ((loan = dds_psmx_endpoint_request_loan (wr->m_endpoint.psmx_endpoints.endpoints[0], wr->m_topic->m_stype->zerocopy_size)) == NULL)
if ((loan = dds_psmx_endpoint_request_loan (wr->m_endpoint.psmx_endpoints.endpoints[0], wr->m_topic->m_stype->sizeof_type)) == NULL)
ret = DDS_RETCODE_ERROR;
}
else if ((ret = dds_heap_loan (wr->m_topic->m_stype, DDS_LOANED_SAMPLE_STATE_RAW_DATA, &loan)) != DDS_RETCODE_OK)
Expand Down
22 changes: 11 additions & 11 deletions src/core/ddsc/tests/cdrstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1911,25 +1911,25 @@ CU_Test (ddsc_cdrstream, data_type_info)
const dds_topic_descriptor_t *desc;
uint64_t data_types;
} tests[] = {
{ D(dti_struct), DDS_DATA_TYPE_CONTAINS_STRUCT },
{ D(dti_struct), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_IS_MEMCPY_SAFE },
{ D(dti_string), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_STRING },
{ D(dti_bstring), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_BSTRING },
{ D(dti_bstring), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_BSTRING | DDS_DATA_TYPE_IS_MEMCPY_SAFE },
{ D(dti_seq), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_SEQUENCE },
{ D(dti_bseq), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_BSEQUENCE },
{ D(dti_seq_str), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_SEQUENCE | DDS_DATA_TYPE_CONTAINS_STRING },
{ D(dti_arr), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_ARRAY },
{ D(dti_arr_bstr), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_ARRAY | DDS_DATA_TYPE_CONTAINS_BSTRING },
{ D(dti_arr), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_ARRAY | DDS_DATA_TYPE_IS_MEMCPY_SAFE },
{ D(dti_arr_bstr), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_ARRAY | DDS_DATA_TYPE_CONTAINS_BSTRING | DDS_DATA_TYPE_IS_MEMCPY_SAFE },
{ D(dti_opt), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_OPTIONAL | DDS_DATA_TYPE_CONTAINS_EXTERNAL },
{ D(dti_ext), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_EXTERNAL },
{ D(dti_struct_key), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_KEY },
{ D(dti_struct_nested_key), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_KEY },
{ D(dti_struct_nested_nokey), DDS_DATA_TYPE_CONTAINS_STRUCT },
{ D(dti_union), DDS_DATA_TYPE_CONTAINS_UNION },
{ D(dti_struct_key), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_KEY | DDS_DATA_TYPE_IS_MEMCPY_SAFE },
{ D(dti_struct_nested_key), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_CONTAINS_KEY | DDS_DATA_TYPE_IS_MEMCPY_SAFE },
{ D(dti_struct_nested_nokey), DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_IS_MEMCPY_SAFE },
{ D(dti_union), DDS_DATA_TYPE_CONTAINS_UNION | DDS_DATA_TYPE_IS_MEMCPY_SAFE },
{ D(dti_union_string), DDS_DATA_TYPE_CONTAINS_UNION | DDS_DATA_TYPE_CONTAINS_STRING },
{ D(dti_union_enum), DDS_DATA_TYPE_CONTAINS_UNION | DDS_DATA_TYPE_CONTAINS_ENUM },
{ D(dti_union_enum), DDS_DATA_TYPE_CONTAINS_UNION | DDS_DATA_TYPE_CONTAINS_ENUM | DDS_DATA_TYPE_IS_MEMCPY_SAFE },
{ D(dti_union_seq), DDS_DATA_TYPE_CONTAINS_UNION | DDS_DATA_TYPE_CONTAINS_SEQUENCE },
{ D(dti_union_arr), DDS_DATA_TYPE_CONTAINS_UNION | DDS_DATA_TYPE_CONTAINS_ARRAY },
{ D(dti_union_struct), DDS_DATA_TYPE_CONTAINS_UNION | DDS_DATA_TYPE_CONTAINS_STRUCT }
{ D(dti_union_arr), DDS_DATA_TYPE_CONTAINS_UNION | DDS_DATA_TYPE_CONTAINS_ARRAY | DDS_DATA_TYPE_IS_MEMCPY_SAFE },
{ D(dti_union_struct), DDS_DATA_TYPE_CONTAINS_UNION | DDS_DATA_TYPE_CONTAINS_STRUCT | DDS_DATA_TYPE_IS_MEMCPY_SAFE }
};

for (uint32_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
Expand Down
9 changes: 0 additions & 9 deletions src/core/ddsc/tests/psmx_cdds_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,10 @@ static const dds_psmx_ops_t psmx_instance_ops = {
.supported_features = cdds_supported_features
};

static bool cdds_psmx_topic_serialization_required (dds_data_type_properties_t data_type_props);
static struct dds_psmx_endpoint * cdds_psmx_create_endpoint (struct dds_psmx_topic *psmx_topic, const struct dds_qos *qos, dds_psmx_endpoint_type_t endpoint_type);
static dds_return_t cdds_psmx_delete_endpoint (struct dds_psmx_endpoint *psmx_endpoint);

static const dds_psmx_topic_ops_t psmx_topic_ops = {
.serialization_required = cdds_psmx_topic_serialization_required,
.create_endpoint = cdds_psmx_create_endpoint,
.delete_endpoint = cdds_psmx_delete_endpoint
};
Expand Down Expand Up @@ -246,13 +244,6 @@ static dds_psmx_features_t cdds_supported_features (const struct dds_psmx *psmx)
return DDS_PSMX_FEATURE_ZERO_COPY;
}

static bool cdds_psmx_topic_serialization_required (dds_data_type_properties_t data_type_props)
{
if (!(data_type_props & DDS_DATA_TYPE_IS_FIXED_SIZE) || DDS_DATA_TYPE_CONTAINS_INDIRECTIONS (data_type_props))
return true;
return false;
}

static struct dds_psmx_endpoint * cdds_psmx_create_endpoint (struct dds_psmx_topic *psmx_topic, const struct dds_qos *qos, dds_psmx_endpoint_type_t endpoint_type)
{
struct cdds_psmx_topic * ctp = (struct cdds_psmx_topic *) psmx_topic;
Expand Down
10 changes: 7 additions & 3 deletions src/core/ddsi/include/dds/ddsi/ddsi_sertype.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ struct ddsi_sertype {
const struct ddsi_sertype_ops *ops;
const struct ddsi_serdata_ops *serdata_ops;
uint32_t serdata_basehash;
uint32_t typekind_no_key : 1;
uint32_t has_key : 1;
uint32_t request_keyhash : 1;
uint32_t fixed_size : 1;
uint32_t is_memcpy_safe : 1;
uint32_t allowed_data_representation; /* Allowed data representations set in IDL for this type, or DDS_DATA_REPRESENTATION_RESTRICT_DEFAULT in case of
no restrictions in the IDL. Unsupported representations for the type are left out when creating the sertype. */
char *type_name;
ddsrt_atomic_voidp_t gv; /* set during registration */
ddsrt_atomic_uint32_t flags_refc; /* counts refs from entities (topic, reader, writer), not from data */
const struct ddsi_sertype *base_sertype; /* counted ref to sertype used to derive this sertype, used to overwrite the serdata_ops for a specific data representation */
uint32_t zerocopy_size;
uint32_t sizeof_type;
dds_data_type_properties_t data_type_props; /* representation of properties of the data type */
};

Expand Down Expand Up @@ -171,6 +171,10 @@ void ddsi_sertype_register_locked (struct ddsi_domaingv *gv, struct ddsi_sertype
#define DDSI_SERTYPE_FLAG_FIXED_SIZE (4u)

#define DDSI_SERTYPE_FLAG_MASK (0x7u)
#define DDSI_SERTYPE_PROPS_FLAG_MASK (DDSI_SERTYPE_FLAG_REQUEST_KEYHASH)

/** @component typesupport_if */
DDS_EXPORT void ddsi_sertype_init_props (struct ddsi_sertype *tp, const char *type_name, const struct ddsi_sertype_ops *sertype_ops, const struct ddsi_serdata_ops *serdata_ops, size_t sizeof_type, dds_data_type_properties_t data_type_props, uint32_t allowed_data_representation, uint32_t flags);

/** @component typesupport_if */
DDS_EXPORT void ddsi_sertype_init_flags (struct ddsi_sertype *tp, const char *type_name, const struct ddsi_sertype_ops *sertype_ops, const struct ddsi_serdata_ops *serdata_ops, uint32_t flags);
Expand Down
4 changes: 2 additions & 2 deletions src/core/ddsi/src/ddsi_endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ dds_return_t ddsi_new_writer (struct ddsi_writer **wr_out, struct ddsi_guid *wrg
awake and do not touch the thread's vtime (entidx_lookup already
verifies we're awake) */
wrguid->prefix = pp->e.guid.prefix;
kind = type->typekind_no_key ? DDSI_ENTITYID_KIND_WRITER_NO_KEY : DDSI_ENTITYID_KIND_WRITER_WITH_KEY;
kind = type->has_key ? DDSI_ENTITYID_KIND_WRITER_WITH_KEY : DDSI_ENTITYID_KIND_WRITER_NO_KEY;
if ((rc = ddsi_participant_allocate_entityid (&wrguid->entityid, kind, pp)) < 0)
return rc;
return ddsi_new_writer_guid (wr_out, wrguid, group_guid, pp, topic_name, type, xqos, whc, status_cb, status_cb_arg, psmx_locators);
Expand Down Expand Up @@ -1532,7 +1532,7 @@ dds_return_t ddsi_new_reader (struct ddsi_reader **rd_out, struct ddsi_guid *rdg
uint32_t kind;

rdguid->prefix = pp->e.guid.prefix;
kind = type->typekind_no_key ? DDSI_ENTITYID_KIND_READER_NO_KEY : DDSI_ENTITYID_KIND_READER_WITH_KEY;
kind = type->has_key ? DDSI_ENTITYID_KIND_READER_WITH_KEY : DDSI_ENTITYID_KIND_READER_NO_KEY;
if ((rc = ddsi_participant_allocate_entityid (&rdguid->entityid, kind, pp)) < 0)
return rc;
return ddsi_new_reader_guid (rd_out, rdguid, group_guid, pp, topic_name, type, xqos, rhc, status_cb, status_cb_arg, psmx_locators);
Expand Down
Loading

0 comments on commit 7040196

Please sign in to comment.