mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 12:28:19 -04:00
Fix c89 bugs reported by Cory Stup.
Others may remain. I wasn't able to get gcc --std=c89 to build libevent at all, so I don't know what compiler the original reporter is using here. Note that this change requires us to disable the part of our rpc code that uses variadic macros when using a non-gcc compiler. This is a problem if we want our rpc api to be portable. svn:r1231
This commit is contained in:
parent
8ba25b9ec7
commit
9516df0e2e
@ -6,6 +6,7 @@ Changes in 2.0.2-alpha:
|
||||
o Disallow setting less than 1 priority.
|
||||
o Fix a bug when removing a timeout from the heap. [Patch from Marko Kreen]
|
||||
o Use signal.h, not sys/signal.h. [Patch from mmadia]
|
||||
o Try harder to build with certain older c99 compilers.
|
||||
|
||||
Changes in 2.0.1-alpha:
|
||||
o free minheap on event_base_free(); from Christopher Layne
|
||||
|
4
evdns.c
4
evdns.c
@ -261,8 +261,8 @@ struct evdns_server_port {
|
||||
struct server_reply_item {
|
||||
struct server_reply_item *next; /* next item in sequence. */
|
||||
char *name; /* name part of the RR */
|
||||
u16 type : 16; /* The RR type */
|
||||
u16 class : 16; /* The RR class (usually CLASS_INET) */
|
||||
u16 type; /* The RR type */
|
||||
u16 class; /* The RR class (usually CLASS_INET) */
|
||||
u32 ttl; /* The RR TTL */
|
||||
char is_name; /* True iff data is a label */
|
||||
u16 datalen; /* Length of data; -1 if data is a label */
|
||||
|
@ -1541,12 +1541,14 @@ class CCodeGenerator:
|
||||
|
||||
pre += (
|
||||
'#define EVTAG_HAS(msg, member) ((msg)->member##_set == 1)\n'
|
||||
'#ifdef __GNUC__\n'
|
||||
'#define EVTAG_ASSIGN(msg, member, args...) '
|
||||
'(*(msg)->base->member##_assign)(msg, ## args)\n'
|
||||
'#define EVTAG_GET(msg, member, args...) '
|
||||
'(*(msg)->base->member##_get)(msg, ## args)\n'
|
||||
'#define EVTAG_ADD(msg, member, args...) '
|
||||
'(*(msg)->base->member##_add)(msg, ## args)\n'
|
||||
'#endif\n'
|
||||
'#define EVTAG_LEN(msg, member) ((msg)->member##_length)\n'
|
||||
)
|
||||
|
||||
|
@ -147,8 +147,10 @@ void evhttp_connection_fail(struct evhttp_connection *,
|
||||
|
||||
void evhttp_get_request(struct evhttp *, evutil_socket_t, struct sockaddr *, socklen_t);
|
||||
|
||||
int evhttp_parse_firstline(struct evhttp_request *, struct evbuffer*);
|
||||
int evhttp_parse_headers(struct evhttp_request *, struct evbuffer*);
|
||||
enum message_read_status;
|
||||
|
||||
enum message_read_status evhttp_parse_firstline(struct evhttp_request *, struct evbuffer*);
|
||||
enum message_read_status evhttp_parse_headers(struct evhttp_request *, struct evbuffer*);
|
||||
|
||||
void evhttp_start_read(struct evhttp_connection *);
|
||||
void evhttp_make_header(struct evhttp_connection *, struct evhttp_request *);
|
||||
|
5
http.c
5
http.c
@ -2157,7 +2157,10 @@ evhttp_decode_uri_internal(
|
||||
c = ' ';
|
||||
} else if (c == '%' && EVUTIL_ISXDIGIT(uri[i+1]) &&
|
||||
EVUTIL_ISXDIGIT(uri[i+2])) {
|
||||
char tmp[] = { uri[i+1], uri[i+2], '\0' };
|
||||
char tmp[3];
|
||||
tmp[0] = uri[i+1];
|
||||
tmp[1] = uri[i+2];
|
||||
tmp[2] = '\0';
|
||||
c = (char)strtol(tmp, NULL, 16);
|
||||
i += 2;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user