Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Sep 18, 2023
1 parent 0bf4bce commit 41698a3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
24 changes: 12 additions & 12 deletions zenoh-bridge-dds/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,41 +48,41 @@ fn parse_args() -> (Config, Option<f32>) {
// zenoh related arguments:
//
.arg(Arg::from_usage(
r#"-i, --id=[HEX_STRING] \
r"-i, --id=[HEX_STRING] \
'The identifier (as an hexadecimal string, with odd number of chars - e.g.: 0A0B23...) that zenohd must use.
WARNING: this identifier must be unique in the system and must be 16 bytes maximum (32 chars)!
If not set, a random UUIDv4 will be used.'"#,
If not set, a random UUIDv4 will be used.'",
))
.arg(Arg::from_usage(
r#"-m, --mode=[MODE] 'The zenoh session mode.'"#)
.possible_values(["peer", "client"])
.default_value("peer")
)
.arg(Arg::from_usage(
r#"-c, --config=[FILE] \
'The configuration file. Currently, this file must be a valid JSON5 file.'"#,
r"-c, --config=[FILE] \
'The configuration file. Currently, this file must be a valid JSON5 file.'",
))
.arg(Arg::from_usage(
r#"-l, --listen=[ENDPOINT]... \
r"-l, --listen=[ENDPOINT]... \
'A locator on which this router will listen for incoming sessions.
Repeat this option to open several listeners.'"#,
Repeat this option to open several listeners.'",
),
)
.arg(Arg::from_usage(
r#"-e, --connect=[ENDPOINT]... \
r"-e, --connect=[ENDPOINT]... \
'A peer locator this router will try to connect to.
Repeat this option to connect to several peers.'"#,
Repeat this option to connect to several peers.'",
))
.arg(Arg::from_usage(
r#"--no-multicast-scouting \
r"--no-multicast-scouting \
'By default the zenoh bridge listens and replies to UDP multicast scouting messages for being discovered by peers and routers.
This option disables this feature.'"#
This option disables this feature.'"
))
.arg(Arg::from_usage(
r#"--rest-http-port=[PORT | IP:PORT] \
r"--rest-http-port=[PORT | IP:PORT] \
'Configures HTTP interface for the REST API (disabled by default, setting this option enables it). Accepted values:'
- a port number
- a string with format `<local_ip>:<port_number>` (to bind the HTTP server to a specific interface)."#
- a string with format `<local_ip>:<port_number>` (to bind the HTTP server to a specific interface)."
))
//
// DDS related arguments:
Expand Down
9 changes: 2 additions & 7 deletions zenoh-plugin-dds/src/dds_mgt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use std::collections::HashMap;
use std::ffi::{CStr, CString};
use std::fmt;
use std::mem::MaybeUninit;
use std::os::raw;
use std::slice;
use std::sync::Arc;
use std::time::Duration;
Expand Down Expand Up @@ -298,7 +297,7 @@ unsafe extern "C" fn on_data(dr: dds_entity_t, arg: *mut std::os::raw::c_void) {

let n = dds_take(
dr,
samples.as_mut_ptr() as *mut *mut raw::c_void,
samples.as_mut_ptr(),
si.as_mut_ptr() as *mut dds_sample_info_t,
MAX_SAMPLES,
MAX_SAMPLES as u32,
Expand Down Expand Up @@ -428,11 +427,7 @@ unsafe extern "C" fn on_data(dr: dds_entity_t, arg: *mut std::os::raw::c_void) {
}
}
}
dds_return_loan(
dr,
samples.as_mut_ptr() as *mut *mut raw::c_void,
MAX_SAMPLES as i32,
);
dds_return_loan(dr, samples.as_mut_ptr(), MAX_SAMPLES as i32);
Box::into_raw(btx);
}

Expand Down

0 comments on commit 41698a3

Please sign in to comment.