commit 98f8cbd013de346af67715175158356e69820f69
parent 21b0708ce5d2f0e1cafb28c1b9e739c7ba1e8f36
Author: Louis Burda <quent.burda@gmail.com>
Date: Tue, 21 Feb 2023 12:10:08 +0100
Let libslip_decode return void
Diffstat:
4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/include/slip.h b/include/slip.h
@@ -47,7 +47,7 @@ struct slip {
int slip_init(struct slip *slip);
void slip_deinit(struct slip *slip);
-int slip_decode(struct slip *slip, uint8_t *data, size_t size);
+void slip_decode(struct slip *slip, uint8_t *data, size_t size);
void slip_decode_store(struct slip *slip, uint8_t byte);
int slip_encode(struct slip *slip, uint8_t *out, size_t *outlen, size_t outcap,
diff --git a/libslip.abi b/libslip.abi
@@ -1,7 +1,7 @@
-slip_init;
-slip_deinit;
+slip_init
+slip_deinit
-slip_set_rx_callback;
-slip_decode;
+slip_decode
+slip_decode_store
-slip_encode;
+slip_encode
diff --git a/libslip.lds b/libslip.lds
@@ -3,8 +3,8 @@ LIBSLIP_1.0 {
slip_init;
slip_deinit;
- slip_set_rx_callback;
slip_decode;
+ slip_decode_store;
slip_encode;
local: *;
diff --git a/src/slip.c b/src/slip.c
@@ -116,7 +116,7 @@ slip_decode_store(struct slip *slip, uint8_t byte)
slip->rx_buf[slip->rx_index++] = byte;
}
-int
+void
slip_decode(struct slip *slip, uint8_t* data, size_t size)
{
uint8_t rx_byte;
@@ -136,10 +136,9 @@ slip_decode(struct slip *slip, uint8_t* data, size_t size)
break;
default:
LIBSLIP_ASSERT(false);
+ abort();
}
}
-
- return 0;
}
int