summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@intec.ugent.be>2016-02-24 11:28:54 +0100
committerDimitri Staessens <dimitri.staessens@intec.ugent.be>2016-02-24 11:28:54 +0100
commitef26d4303ed776578e6522fb9fc4ff7817d40dc1 (patch)
tree5e1274fd5846c1b72e26fe5f58539b37763fda05 /src
parent32bad3183aa5045e2ab8a0da92d4b7a8802d4aad (diff)
downloadouroboros-ef26d4303ed776578e6522fb9fc4ff7817d40dc1.tar.gz
ouroboros-ef26d4303ed776578e6522fb9fc4ff7817d40dc1.zip
lib: further cleanup of du_buff
du_buff.c : removed unnecessary variable for return values removed unnecessary functions
Diffstat (limited to 'src')
-rw-r--r--src/lib/du_buff.c35
1 files changed, 2 insertions, 33 deletions
diff --git a/src/lib/du_buff.c b/src/lib/du_buff.c
index eace2d02..e530fcb7 100644
--- a/src/lib/du_buff.c
+++ b/src/lib/du_buff.c
@@ -263,8 +263,6 @@ int du_buff_init(du_buff_t * dub,
uint8_t * data,
size_t len)
{
- int ret = -EINVAL;
-
if (dub == NULL || data == NULL) {
LOG_DBG("Bogus input, bugging out.");
return -EINVAL;
@@ -278,37 +276,7 @@ int du_buff_init(du_buff_t * dub,
dub->du_start = start;
dub->du_end = start + len;
- ret = buffer_copy_data(dub->buffer, start, data, len);
-
- return ret;
-}
-
-uint8_t * du_buff_data_ptr_start(du_buff_t * dub)
-{
- uint8_t * ret = NULL;
-
- if (dub == NULL) {
- LOG_DBGF("Bogus input, bugging out.");
- return NULL;
- }
-
- ret = buffer_seek_pos(dub->buffer, dub->du_start);
-
- return ret;
-}
-
-uint8_t * du_buff_data_ptr_end(du_buff_t * dub)
-{
- uint8_t * ret = NULL;
-
- if (dub == NULL) {
- LOG_DBG("Bogus input, bugging out.");
- return NULL;
- }
-
- ret = buffer_seek_pos(dub->buffer, dub->du_end);
-
- return ret;
+ return buffer_copy_data(dub->buffer, start, data, len);
}
int du_buff_head_alloc(du_buff_t * dub, size_t size)
@@ -327,6 +295,7 @@ int du_buff_head_alloc(du_buff_t * dub, size_t size)
return 0;
}
+
int du_buff_tail_alloc(du_buff_t * dub, size_t size)
{
if (dub == NULL) {