@@ -103,7 +103,7 @@ std::shared_ptr<PublisherData> PublisherData::make(
103
103
return nullptr ;
104
104
}
105
105
106
- zenoh::ZResult err ;
106
+ zenoh::ZResult result ;
107
107
std::optional<zenoh::ext::PublicationCache> pub_cache;
108
108
zenoh::KeyExpr pub_ke (entity->topic_info ()->topic_keyexpr_ );
109
109
// Create a Publication Cache if durability is transient_local.
@@ -117,9 +117,9 @@ std::shared_ptr<PublisherData> PublisherData::make(
117
117
std::string queryable_prefix = entity->zid ();
118
118
pub_cache_opts.queryable_prefix = zenoh::KeyExpr (queryable_prefix);
119
119
120
- pub_cache = session->declare_publication_cache (pub_ke, std::move (pub_cache_opts), &err );
120
+ pub_cache = session->declare_publication_cache (pub_ke, std::move (pub_cache_opts), &result );
121
121
122
- if (err != Z_OK) {
122
+ if (result != Z_OK) {
123
123
RMW_SET_ERROR_MSG (" unable to create zenoh publisher cache" );
124
124
return nullptr ;
125
125
}
@@ -135,9 +135,9 @@ std::shared_ptr<PublisherData> PublisherData::make(
135
135
opts.congestion_control = Z_CONGESTION_CONTROL_BLOCK;
136
136
}
137
137
}
138
- auto pub = session->declare_publisher (pub_ke, std::move (opts), &err );
138
+ auto pub = session->declare_publisher (pub_ke, std::move (opts), &result );
139
139
140
- if (err != Z_OK) {
140
+ if (result != Z_OK) {
141
141
RMW_SET_ERROR_MSG (" Unable to create Zenoh publisher." );
142
142
return nullptr ;
143
143
}
@@ -146,8 +146,8 @@ std::shared_ptr<PublisherData> PublisherData::make(
146
146
auto token = session->liveliness_declare_token (
147
147
zenoh::KeyExpr (liveliness_keyexpr),
148
148
zenoh::Session::LivelinessDeclarationOptions::create_default (),
149
- &err );
150
- if (err != Z_OK) {
149
+ &result );
150
+ if (result != Z_OK) {
151
151
RMW_ZENOH_LOG_ERROR_NAMED (
152
152
" rmw_zenoh_cpp" ,
153
153
" Unable to create liveliness token for the publisher." );
@@ -273,7 +273,7 @@ rmw_ret_t PublisherData::publish(
273
273
// The encoding is simply forwarded and is useful when key expressions in the
274
274
// session use different encoding formats. In our case, all key expressions
275
275
// will be encoded with CDR so it does not really matter.
276
- zenoh::ZResult err ;
276
+ zenoh::ZResult result ;
277
277
auto options = zenoh::Publisher::PutOptions::create_default ();
278
278
options.attachment = create_map_and_set_sequence_num (
279
279
sequence_number_++,
@@ -285,9 +285,9 @@ rmw_ret_t PublisherData::publish(
285
285
reinterpret_cast <const uint8_t *>(msg_bytes) + data_length);
286
286
zenoh::Bytes payload (raw_image);
287
287
288
- pub_.put (std::move (payload), std::move (options), &err );
289
- if (err != Z_OK) {
290
- if (err == Z_ESESSION_CLOSED) {
288
+ pub_.put (std::move (payload), std::move (options), &result );
289
+ if (result != Z_OK) {
290
+ if (result == Z_ESESSION_CLOSED) {
291
291
RMW_ZENOH_LOG_WARN_NAMED (
292
292
" rmw_zenoh_cpp" ,
293
293
" unable to publish message since the zenoh session is closed" );
@@ -319,7 +319,7 @@ rmw_ret_t PublisherData::publish_serialized_message(
319
319
// The encoding is simply forwarded and is useful when key expressions in the
320
320
// session use different encoding formats. In our case, all key expressions
321
321
// will be encoded with CDR so it does not really matter.
322
- zenoh::ZResult err ;
322
+ zenoh::ZResult result ;
323
323
auto options = zenoh::Publisher::PutOptions::create_default ();
324
324
options.attachment = create_map_and_set_sequence_num (sequence_number_++, entity_->copy_gid ());
325
325
@@ -328,9 +328,9 @@ rmw_ret_t PublisherData::publish_serialized_message(
328
328
serialized_message->buffer + data_length);
329
329
zenoh::Bytes payload (raw_image);
330
330
331
- pub_.put (std::move (payload), std::move (options), &err );
332
- if (err != Z_OK) {
333
- if (err == Z_ESESSION_CLOSED) {
331
+ pub_.put (std::move (payload), std::move (options), &result );
332
+ if (result != Z_OK) {
333
+ if (result == Z_ESESSION_CLOSED) {
334
334
RMW_ZENOH_LOG_WARN_NAMED (
335
335
" rmw_zenoh_cpp" ,
336
336
" unable to publish message since the zenoh session is closed" );
@@ -408,16 +408,16 @@ rmw_ret_t PublisherData::shutdown()
408
408
}
409
409
410
410
// Unregister this publisher from the ROS graph.
411
- zenoh::ZResult err ;
412
- std::move (token_).value ().undeclare (&err );
413
- if (err != Z_OK) {
411
+ zenoh::ZResult result ;
412
+ std::move (token_).value ().undeclare (&result );
413
+ if (result != Z_OK) {
414
414
RMW_ZENOH_LOG_ERROR_NAMED (
415
415
" rmw_zenoh_cpp" ,
416
416
" Unable to undeclare liveliness token" );
417
417
return RMW_RET_ERROR;
418
418
}
419
- std::move (pub_).undeclare (&err );
420
- if (err != Z_OK) {
419
+ std::move (pub_).undeclare (&result );
420
+ if (result != Z_OK) {
421
421
RMW_ZENOH_LOG_ERROR_NAMED (
422
422
" rmw_zenoh_cpp" ,
423
423
" Unable to undeclare publisher" );
0 commit comments