Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcoap: Fix incorrect function pointer signature #80

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/gcoap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ where
*mut libc::c_char,
riot_sys::size_t,
*mut riot_sys::coap_link_encoder_ctx_t,
) -> i32,
) -> riot_sys::ssize_t,
>,
) -> Self {
let methods = methods.try_into().unwrap();
Expand Down Expand Up @@ -171,9 +171,9 @@ where
unsafe extern "C" fn call_handler(
pkt: *mut coap_pkt_t,
buf: *mut u8,
len: u32,
len: riot_sys::size_t,
context: *mut riot_sys::coap_request_ctx_t,
) -> i32 {
) -> riot_sys::ssize_t {
/* The remaining information in the request_ctx is inaccessible through the CoAP handler
* API as it is now */
let h = riot_sys::coap_request_ctx_get_context(context) as *mut H;
Expand All @@ -193,7 +193,7 @@ unsafe extern "C" fn link_encoder<H: WithLinkEncoder>(
buf: *mut libc::c_char,
buf_len: riot_sys::size_t,
ctx: *mut riot_sys::coap_link_encoder_ctx_t,
) -> i32 {
) -> riot_sys::ssize_t {
// We're a SingleHandlerListener, therefore we only have a single resource and can
// back-track to Self
// (But we don't need this)
Expand Down Expand Up @@ -221,7 +221,7 @@ fn link_encoder_safe<H: WithLinkEncoder>(
h: &H,
mut buf: Option<&mut [u8]>,
ctx: &mut riot_sys::coap_link_encoder_ctx_t,
) -> i32 {
) -> riot_sys::ssize_t {
let mut writer = LinkEncoder::new(buf.as_deref_mut(), ctx);
h.encode(&mut writer);
let written = writer.written();
Expand Down
Loading