Re-order a couple of static functions and "#if 0" out unused ones - this
gets rid of gcc warnings.
This commit is contained in:
parent
282d8b1c38
commit
9a04387362
@ -36,6 +36,7 @@ unsigned long buffer_total_out(buffer_t *buf) {
|
|||||||
* it's not sure when they're called how it should be interpreted. Only the
|
* it's not sure when they're called how it should be interpreted. Only the
|
||||||
* higher-level "buffer_[to|from]_[fd|SSL|BIO]" functions should alter these
|
* higher-level "buffer_[to|from]_[fd|SSL|BIO]" functions should alter these
|
||||||
* values. */
|
* values. */
|
||||||
|
#if 0 /* To avoid "unused" warnings */
|
||||||
static unsigned int buffer_adddata(buffer_t *buf, const unsigned char *ptr,
|
static unsigned int buffer_adddata(buffer_t *buf, const unsigned char *ptr,
|
||||||
unsigned int size)
|
unsigned int size)
|
||||||
{
|
{
|
||||||
@ -50,6 +51,21 @@ static unsigned int buffer_adddata(buffer_t *buf, const unsigned char *ptr,
|
|||||||
return added;
|
return added;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned int buffer_tobuffer(buffer_t *to, buffer_t *from, int cap)
|
||||||
|
{
|
||||||
|
unsigned int moved, tomove = from->used;
|
||||||
|
if((int)tomove > cap)
|
||||||
|
tomove = cap;
|
||||||
|
if(tomove == 0)
|
||||||
|
return 0;
|
||||||
|
moved = buffer_adddata(to, from->data, tomove);
|
||||||
|
if(moved == 0)
|
||||||
|
return 0;
|
||||||
|
buffer_takedata(from, NULL, moved);
|
||||||
|
return moved;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static unsigned int buffer_takedata(buffer_t *buf, unsigned char *ptr,
|
static unsigned int buffer_takedata(buffer_t *buf, unsigned char *ptr,
|
||||||
unsigned int size)
|
unsigned int size)
|
||||||
{
|
{
|
||||||
@ -67,20 +83,6 @@ static unsigned int buffer_takedata(buffer_t *buf, unsigned char *ptr,
|
|||||||
return taken;
|
return taken;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int buffer_tobuffer(buffer_t *to, buffer_t *from, int cap)
|
|
||||||
{
|
|
||||||
unsigned int moved, tomove = from->used;
|
|
||||||
if((int)tomove > cap)
|
|
||||||
tomove = cap;
|
|
||||||
if(tomove == 0)
|
|
||||||
return 0;
|
|
||||||
moved = buffer_adddata(to, from->data, tomove);
|
|
||||||
if(moved == 0)
|
|
||||||
return 0;
|
|
||||||
buffer_takedata(from, NULL, moved);
|
|
||||||
return moved;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NO_IP
|
#ifndef NO_IP
|
||||||
|
|
||||||
int buffer_from_fd(buffer_t *buf, int fd)
|
int buffer_from_fd(buffer_t *buf, int fd)
|
||||||
|
Loading…
Reference in New Issue
Block a user