Change in libosmocore[master]: bitvec: Add bitvec_tailroom_bits() function

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Feb 4 11:12:10 UTC 2019


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/12816


Change subject: bitvec: Add bitvec_tailroom_bits() function
......................................................................

bitvec: Add bitvec_tailroom_bits() function

This is similar to msgb_tailroom(): It returns the amount of space
left at the end of the bit vector (compared to the current cursor).

The function returns the number of bits left in the bitvec.

Change-Id: I8980a6b6d1973b67a2d9ad411c878d956fb428d1
---
M include/osmocom/core/bitvec.h
1 file changed, 6 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/12816/1

diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h
index da2d4e4..a404c2f 100644
--- a/include/osmocom/core/bitvec.h
+++ b/include/osmocom/core/bitvec.h
@@ -93,4 +93,10 @@
 	return bytes;
 }
 
+/*! Return the tailroom in number of unused bits remaining in the bit-vector */
+static inline unsigned int bitvec_tailroom_bits(const sturct bitvec *bv)
+{
+	return bv->data_len*8 - bv->cur_bit;
+}
+
 /*! @} */

-- 
To view, visit https://gerrit.osmocom.org/12816
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8980a6b6d1973b67a2d9ad411c878d956fb428d1
Gerrit-Change-Number: 12816
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190204/d0dd3c7a/attachment.htm>


More information about the gerrit-log mailing list