diff options
author | Bart Westgeest <bart@elbrys.com> | 2012-11-19 14:04:30 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-11-20 14:51:16 +0200 |
commit | 74116be7b84cbd422fcc765c9ef5d1f65287a0db (patch) | |
tree | cc21d024f7f6c00784fe477c01c4cac745ebc147 /lib | |
parent | d557e0d956d69318664ed5d1c3e4a765da24bc2a (diff) |
sdp: Inlined single use of function sdp_set_data_type
Inlining single use of sdp_set_data_type to improve code readability,
since the function was doing more than just setting the data type.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sdp.c | 18 |
1 files changed, 5 insertions, 13 deletions
@@ -666,18 +666,6 @@ static int sdp_get_data_type(sdp_buf_t *buf, uint8_t dtd) return data_type; } -static int sdp_set_data_type(sdp_buf_t *buf, uint8_t dtd) -{ - int data_type = 0; - uint8_t *p = buf->data + buf->data_size; - - *p = dtd; - data_type = sdp_get_data_type(buf, dtd); - buf->data_size += data_type; - - return data_type; -} - void sdp_set_attrid(sdp_buf_t *buf, uint16_t attr) { uint8_t *p = buf->data; @@ -815,9 +803,13 @@ int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) uint128_t u128; uint8_t *seqp = buf->data + buf->data_size; - pdu_size = sdp_set_data_type(buf, dtd); + pdu_size = sdp_get_data_type(buf, dtd); + buf->data_size += pdu_size; + data_size = sdp_get_data_size(buf, d); + *seqp = dtd; + switch (dtd) { case SDP_DATA_NIL: break; |