Change in libosmo-abis[master]: subchan_demux: Use ubit_t where appropriate

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun May 10 17:12:19 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/18179 )


Change subject: subchan_demux: Use ubit_t where appropriate
......................................................................

subchan_demux: Use ubit_t where appropriate

the subchan_demux code predates ubit_t; let's use it to clarify
certain pointers refer to arrays of unpacked bits.

Change-Id: I944f05473954920d57e12d5514cf928fc78f2ea4
---
M include/osmocom/abis/subchan_demux.h
M src/subchan_demux.c
2 files changed, 7 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/79/18179/1

diff --git a/include/osmocom/abis/subchan_demux.h b/include/osmocom/abis/subchan_demux.h
index 3978d73..dac072c 100644
--- a/include/osmocom/abis/subchan_demux.h
+++ b/include/osmocom/abis/subchan_demux.h
@@ -85,7 +85,7 @@
 	unsigned int bit_len;	/*!< \brief total number of bits in 'bits' */
 	unsigned int next_bit;	/*!< \brief next bit to be transmitted */
 
-	uint8_t bits[0];	/*!< \brief one bit per byte */
+	ubit_t bits[0];		/*!< \brief one bit per byte */
 };
 
 /*! \brief one sub-channel inside a multiplexer */
@@ -102,7 +102,7 @@
 
 int subchan_mux_init(struct subch_mux *mx);
 int subchan_mux_out(struct subch_mux *mx, uint8_t *data, int len);
-int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data,
+int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const ubit_t *data,
 			int len);
 
 /* }@ */
diff --git a/src/subchan_demux.c b/src/subchan_demux.c
index 9275fda..55503db 100644
--- a/src/subchan_demux.c
+++ b/src/subchan_demux.c
@@ -200,7 +200,7 @@
 
 /* return the requested number of bits from the specified subchannel */
 static int get_subch_bits(struct subch_mux *mx, int subch,
-			  uint8_t *bits, int num_requested)
+			  ubit_t *bits, int num_requested)
 {
 	struct mux_subch *sch = &mx->subch[subch];
 	int num_bits = 0;
@@ -258,7 +258,7 @@
 /* obtain a single output byte from the subchannel muxer */
 static int mux_output_byte(struct subch_mux *mx, uint8_t *byte)
 {
-	uint8_t bits[8];
+	ubit_t bits[8];
 	int rc;
 
 	/* combine two bits of every subchan */
@@ -310,11 +310,11 @@
 /*! \brief enqueue some data into the tx_queue of a given subchannel
  *  \param[in] mx subchannel muxer instance
  *  \param[in] s_nr subchannel number
- *  \param[in] data pointer to buffer with data
- *  \param[in] len length of \a data
+ *  \param[in] data pointer to buffer with data (unpacked bits)
+ *  \param[in] len length of data (in unpacked bits)
  *  \returns 0 in case of success, <0 in case of error
  */
-int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data,
+int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const ubit_t *data,
 			int len)
 {
 	struct mux_subch *sch = &mx->subch[s_nr];

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/18179
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I944f05473954920d57e12d5514cf928fc78f2ea4
Gerrit-Change-Number: 18179
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200510/78e4b1de/attachment.htm>


More information about the gerrit-log mailing list