Skip to content

Commit

Permalink
gcoap: Fix incorrect function pointer signature
Browse files Browse the repository at this point in the history
Merges: #80
  • Loading branch information
chrysn authored Feb 5, 2024
2 parents 9d2068a + 9610bf8 commit 82bb9a4
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 82bb9a4

Please sign in to comment.