[PATCH] change length-related return values to unsigned

Max max.suraev at fairwaves.ru
Mon Dec 16 15:59:27 UTC 2013


---
 include/osmocom/core/msgb.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index fe2733b..9221fda 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -99,7 +99,7 @@ uint16_t msgb_length(const struct msgb *msg);
  * This function computes the number of bytes between the tail of the
  * message and the layer 1 header.
  */
-static inline unsigned int msgb_l1len(const struct msgb *msgb)
+static inline uint16_t msgb_l1len(const struct msgb *msgb)
 {
 	return msgb->tail - (uint8_t *)msgb_l1(msgb);
 }
@@ -111,7 +111,7 @@ static inline unsigned int msgb_l1len(const struct msgb *msgb)
  * This function computes the number of bytes between the tail of the
  * message and the layer 2 header.
  */
-static inline unsigned int msgb_l2len(const struct msgb *msgb)
+static inline uint16_t msgb_l2len(const struct msgb *msgb)
 {
 	return msgb->tail - (uint8_t *)msgb_l2(msgb);
 }
@@ -123,7 +123,7 @@ static inline unsigned int msgb_l2len(const struct msgb *msgb)
  * This function computes the number of bytes between the tail of the
  * message and the layer 3 header.
  */
-static inline unsigned int msgb_l3len(const struct msgb *msgb)
+static inline uint16_t msgb_l3len(const struct msgb *msgb)
 {
 	return msgb->tail - (uint8_t *)msgb_l3(msgb);
 }
@@ -135,7 +135,7 @@ static inline unsigned int msgb_l3len(const struct msgb *msgb)
  * This function computes the length difference between the underlying
  * data buffer and the used section of the \a msgb.
  */
-static inline unsigned int msgb_headlen(const struct msgb *msgb)
+static inline uint16_t msgb_headlen(const struct msgb *msgb)
 {
 	return msgb->len - msgb->data_len;
 }
@@ -147,7 +147,7 @@ static inline unsigned int msgb_headlen(const struct msgb *msgb)
  * This function computes the amount of octets left in the underlying
  * data buffer after the end of the message.
  */
-static inline int msgb_tailroom(const struct msgb *msgb)
+static inline uint16_t msgb_tailroom(const struct msgb *msgb)
 {
 	return (msgb->head + msgb->data_len) - msgb->tail;
 }
@@ -159,7 +159,7 @@ static inline int msgb_tailroom(const struct msgb *msgb)
  * This function computes the amount of bytes left in the underlying
  * data buffer before the start of the actual message.
  */
-static inline int msgb_headroom(const struct msgb *msgb)
+static inline uint16_t msgb_headroom(const struct msgb *msgb)
 {
 	return (msgb->data - msgb->head);
 }
-- 
1.8.3.2


--------------060007020105010906090408--




More information about the baseband-devel mailing list