mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
r18482@catbus: nickm | 2008-02-28 12:38:40 -0500
Fix GCC 4.2 warnings; fix includes in subdirs. svn:r675
This commit is contained in:
parent
5c70ea4c9d
commit
0e7cbe6508
12
buffer.c
12
buffer.c
@ -226,9 +226,10 @@ evbuffer_drain(struct evbuffer *buf, size_t len)
|
||||
/* Reads data from an event buffer and drains the bytes read */
|
||||
|
||||
int
|
||||
evbuffer_remove(struct evbuffer *buf, void *data, size_t datlen)
|
||||
evbuffer_remove(struct evbuffer *buf, void *data_out, size_t datlen)
|
||||
{
|
||||
struct evbuffer_chain *chain = buf->first, *tmp;
|
||||
char *data = data_out;
|
||||
size_t nread;
|
||||
|
||||
if (datlen >= buf->total_len)
|
||||
@ -332,7 +333,7 @@ u_char *
|
||||
evbuffer_pullup(struct evbuffer *buf, int size)
|
||||
{
|
||||
struct evbuffer_chain *chain = buf->first, *next, *tmp;
|
||||
void *buffer;
|
||||
u_char *buffer;
|
||||
|
||||
if (size == -1)
|
||||
size = buf->total_len;
|
||||
@ -555,9 +556,10 @@ evbuffer_readln(struct evbuffer *buffer, size_t *n_read_out,
|
||||
/* Adds data to an event buffer */
|
||||
|
||||
int
|
||||
evbuffer_add(struct evbuffer *buf, const void *data, size_t datlen)
|
||||
evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen)
|
||||
{
|
||||
struct evbuffer_chain *chain = buf->last;
|
||||
const u_char *data = data_in;
|
||||
size_t old_len = buf->total_len, remain, to_alloc;
|
||||
|
||||
if (chain == NULL) {
|
||||
@ -656,7 +658,7 @@ evbuffer_chain_align(struct evbuffer_chain *chain)
|
||||
int
|
||||
evbuffer_expand(struct evbuffer *buf, size_t datlen)
|
||||
{
|
||||
struct evbuffer_chain *chain = buf->last;
|
||||
struct evbuffer_chain *chain = buf->last, *tmp;
|
||||
size_t need, length;
|
||||
|
||||
if (chain == NULL) {
|
||||
@ -687,7 +689,7 @@ evbuffer_expand(struct evbuffer *buf, size_t datlen)
|
||||
length = chain->buffer_len << 1;
|
||||
if (length < datlen)
|
||||
length = datlen;
|
||||
struct evbuffer_chain *tmp = evbuffer_chain_new(length);
|
||||
tmp = evbuffer_chain_new(length);
|
||||
if (tmp == NULL)
|
||||
return (-1);
|
||||
chain->next = tmp;
|
||||
|
@ -1,7 +1,7 @@
|
||||
AUTOMAKE_OPTIONS = foreign no-dependencies
|
||||
|
||||
LDADD = ../libevent.la
|
||||
AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat
|
||||
AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat -I$(top_srcdir)/include
|
||||
|
||||
noinst_PROGRAMS = event-test time-test signal-test
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
AUTOMAKE_OPTIONS = foreign no-dependencies
|
||||
|
||||
CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat
|
||||
CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat -I$(top_srcdir)/include
|
||||
|
||||
EXTRA_DIST = regress.rpc regress.gen.h regress.gen.c
|
||||
|
||||
|
@ -896,6 +896,7 @@ test_evbuffer(void)
|
||||
static char buffer[512], *tmp;
|
||||
struct evbuffer *evb = evbuffer_new();
|
||||
struct evbuffer *evb_two = evbuffer_new();
|
||||
size_t sz_tmp;
|
||||
int i;
|
||||
setup_test("Testing Evbuffer: ");
|
||||
|
||||
@ -951,9 +952,10 @@ test_evbuffer(void)
|
||||
goto out;
|
||||
|
||||
/* test remove buffer */
|
||||
evbuffer_remove_buffer(evb, evb_two, sizeof(buffer) * 2.5);
|
||||
if (EVBUFFER_LENGTH(evb_two) != sizeof(buffer) * 2.5 ||
|
||||
EVBUFFER_LENGTH(evb) != sizeof(buffer) * 0.5)
|
||||
sz_tmp = sizeof(buffer)*2.5;
|
||||
evbuffer_remove_buffer(evb, evb_two, sz_tmp);
|
||||
if (EVBUFFER_LENGTH(evb_two) != sz_tmp ||
|
||||
EVBUFFER_LENGTH(evb) != sizeof(buffer) / 2)
|
||||
goto out;
|
||||
|
||||
if (memcmp(evbuffer_pullup(
|
||||
|
Loading…
x
Reference in New Issue
Block a user