Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/libevent/dist merge conflicts, make compile wit...



details:   https://anonhg.NetBSD.org/src/rev/7a036ce580e8
branches:  trunk
changeset: 786016:7a036ce580e8
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Apr 11 16:56:41 2013 +0000

description:
merge conflicts, make compile with warnings.

diffstat:

 external/bsd/libevent/dist/Doxyfile                   |     2 +-
 external/bsd/libevent/dist/buffer.c                   |    18 +-
 external/bsd/libevent/dist/bufferevent-internal.h     |    10 +-
 external/bsd/libevent/dist/bufferevent.c              |     6 +-
 external/bsd/libevent/dist/bufferevent_ratelim.c      |     6 +-
 external/bsd/libevent/dist/evbuffer-internal.h        |    12 +-
 external/bsd/libevent/dist/evbuffer.c                 |   456 --
 external/bsd/libevent/dist/evdns.3                    |   326 -
 external/bsd/libevent/dist/evdns.c                    |    28 +-
 external/bsd/libevent/dist/event-internal.h           |     4 +-
 external/bsd/libevent/dist/event.3                    |   626 ---
 external/bsd/libevent/dist/event.c                    |    20 +-
 external/bsd/libevent/dist/event_tagging.c            |    10 +-
 external/bsd/libevent/dist/evmap.c                    |    10 +-
 external/bsd/libevent/dist/evrpc.c                    |    46 +-
 external/bsd/libevent/dist/evsignal.h                 |    53 -
 external/bsd/libevent/dist/evthread-internal.h        |    44 +-
 external/bsd/libevent/dist/evutil.c                   |     8 +-
 external/bsd/libevent/dist/evutil_rand.c              |    11 +-
 external/bsd/libevent/dist/ht-internal.h              |     8 +-
 external/bsd/libevent/dist/http.c                     |    14 +-
 external/bsd/libevent/dist/include/event2/rpc.h       |     4 +-
 external/bsd/libevent/dist/include/event2/util.h      |    51 +-
 external/bsd/libevent/dist/log-internal.h             |     4 +-
 external/bsd/libevent/dist/log.h                      |    52 -
 external/bsd/libevent/dist/min_heap.h                 |   150 -
 external/bsd/libevent/dist/ratelim-internal.h         |     6 +-
 external/bsd/libevent/dist/select.c                   |     6 +-
 external/bsd/libevent/dist/test/regress.c             |  2239 +++++++---
 external/bsd/libevent/dist/test/regress.h             |     4 +-
 external/bsd/libevent/dist/test/regress_buffer.c      |    56 +-
 external/bsd/libevent/dist/test/regress_bufferevent.c |    58 +-
 external/bsd/libevent/dist/test/regress_dns.c         |  1736 ++++++++-
 external/bsd/libevent/dist/test/regress_et.c          |    22 +-
 external/bsd/libevent/dist/test/regress_http.c        |  3384 +++++++++++++---
 external/bsd/libevent/dist/test/regress_listener.c    |     6 +-
 external/bsd/libevent/dist/test/regress_main.c        |     8 +-
 external/bsd/libevent/dist/test/regress_rpc.c         |    64 +-
 external/bsd/libevent/dist/test/regress_ssl.c         |    27 +-
 external/bsd/libevent/dist/test/regress_thread.c      |     8 +-
 external/bsd/libevent/dist/test/regress_util.c        |     9 +-
 external/bsd/libevent/dist/test/regress_zlib.c        |    24 +-
 external/bsd/libevent/dist/test/tinytest_macros.h     |    12 +-
 external/bsd/libevent/dist/util-internal.h            |     6 +-
 44 files changed, 6185 insertions(+), 3469 deletions(-)

diffs (truncated from 12790 to 300 lines):

diff -r 4b5a337b76e2 -r 7a036ce580e8 external/bsd/libevent/dist/Doxyfile
--- a/external/bsd/libevent/dist/Doxyfile       Thu Apr 11 16:56:11 2013 +0000
+++ b/external/bsd/libevent/dist/Doxyfile       Thu Apr 11 16:56:41 2013 +0000
@@ -175,7 +175,7 @@
 # If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
 # generate man pages
 
-GENERATE_MAN           = NO
+GENERATE_MAN           = YES
 
 # The MAN_EXTENSION tag determines the extension that is added to 
 # the generated man pages (default is the subroutine's section .3)
diff -r 4b5a337b76e2 -r 7a036ce580e8 external/bsd/libevent/dist/buffer.c
--- a/external/bsd/libevent/dist/buffer.c       Thu Apr 11 16:56:11 2013 +0000
+++ b/external/bsd/libevent/dist/buffer.c       Thu Apr 11 16:56:41 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: buffer.c,v 1.1.1.2 2013/04/11 16:43:28 christos Exp $  */
+/*     $NetBSD: buffer.c,v 1.2 2013/04/11 16:56:41 christos Exp $      */
 /*
  * Copyright (c) 2002-2007 Niels Provos <provos%citi.umich.edu@localhost>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -28,7 +28,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: buffer.c,v 1.1.1.2 2013/04/11 16:43:28 christos Exp $");
+__RCSID("$NetBSD: buffer.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
 
 #ifdef WIN32
 #include <winsock2.h>
@@ -88,7 +88,7 @@
 #include "event2/thread.h"
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: buffer.c,v 1.1.1.2 2013/04/11 16:43:28 christos Exp $");
+__RCSID("$NetBSD: buffer.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
 #include "log-internal.h"
 #include "mm-internal.h"
 #include "util-internal.h"
@@ -1661,7 +1661,7 @@
                } else if (chain->misalign) {
                        /* we can only fit some of the data. */
                        memcpy(chain->buffer,
-                           (char*)data + datlen - chain->misalign,
+                           (const char*)data + datlen - chain->misalign,
                            (size_t)chain->misalign);
                        chain->off += (size_t)chain->misalign;
                        buf->total_len += (size_t)chain->misalign;
@@ -2702,7 +2702,7 @@
        if (!chain)
                return (-1);
        chain->flags |= EVBUFFER_REFERENCE | EVBUFFER_IMMUTABLE;
-       chain->buffer = (u_char *)data;
+       chain->buffer = __UNCONST(data);
        chain->buffer_len = datlen;
        chain->off = datlen;
 
@@ -2837,7 +2837,7 @@
        {
                /* the default implementation */
                struct evbuffer *tmp = evbuffer_new();
-               ev_ssize_t read;
+               ev_ssize_t nread;
 
                if (tmp == NULL)
                        return (-1);
@@ -2854,13 +2854,13 @@
                 * can abort without side effects if the read fails.
                 */
                while (length) {
-                       read = evbuffer_readfile(tmp, fd, (ev_ssize_t)length);
-                       if (read == -1) {
+                       nread = evbuffer_readfile(tmp, fd, (ev_ssize_t)length);
+                       if (nread == -1) {
                                evbuffer_free(tmp);
                                return (-1);
                        }
 
-                       length -= read;
+                       length -= nread;
                }
 
                EVBUFFER_LOCK(outbuf);
diff -r 4b5a337b76e2 -r 7a036ce580e8 external/bsd/libevent/dist/bufferevent-internal.h
--- a/external/bsd/libevent/dist/bufferevent-internal.h Thu Apr 11 16:56:11 2013 +0000
+++ b/external/bsd/libevent/dist/bufferevent-internal.h Thu Apr 11 16:56:41 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bufferevent-internal.h,v 1.1.1.1 2013/04/11 16:43:29 christos Exp $    */
+/*     $NetBSD: bufferevent-internal.h,v 1.2 2013/04/11 16:56:41 christos Exp $        */
 /*
  * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson
  *
@@ -358,14 +358,14 @@
        do {                                                            \
                if (evutil_timerisset(&(bev)->timeout_read))            \
                        event_add(&(bev)->ev_read, &(bev)->timeout_read); \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 /** Internal use: We have just successfully written data from an inbuf, so
  * reset the read timeout (if any). */
 #define BEV_RESET_GENERIC_WRITE_TIMEOUT(bev)                           \
        do {                                                            \
                if (evutil_timerisset(&(bev)->timeout_write))           \
                        event_add(&(bev)->ev_write, &(bev)->timeout_write); \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 #define BEV_DEL_GENERIC_READ_TIMEOUT(bev)      \
                event_del(&(bev)->ev_read)
 #define BEV_DEL_GENERIC_WRITE_TIMEOUT(bev)     \
@@ -384,13 +384,13 @@
 #define BEV_LOCK(b) do {                                               \
                struct bufferevent_private *locking =  BEV_UPCAST(b);   \
                EVLOCK_LOCK(locking->lock, 0);                          \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 
 /** Internal: Release the lock (if any) on a bufferevent */
 #define BEV_UNLOCK(b) do {                                             \
                struct bufferevent_private *locking =  BEV_UPCAST(b);   \
                EVLOCK_UNLOCK(locking->lock, 0);                        \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 #endif
 
 
diff -r 4b5a337b76e2 -r 7a036ce580e8 external/bsd/libevent/dist/bufferevent.c
--- a/external/bsd/libevent/dist/bufferevent.c  Thu Apr 11 16:56:11 2013 +0000
+++ b/external/bsd/libevent/dist/bufferevent.c  Thu Apr 11 16:56:41 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bufferevent.c,v 1.1.1.1 2013/04/11 16:43:25 christos Exp $     */
+/*     $NetBSD: bufferevent.c,v 1.2 2013/04/11 16:56:41 christos Exp $ */
 /*
  * Copyright (c) 2002-2007 Niels Provos <provos%citi.umich.edu@localhost>
  * Copyright (c) 2007-2012 Niels Provos, Nick Mathewson
@@ -30,7 +30,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bufferevent.c,v 1.1.1.1 2013/04/11 16:43:25 christos Exp $");
+__RCSID("$NetBSD: bufferevent.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
 
 #ifdef _EVENT_HAVE_SYS_TIME_H
 #include <sys/time.h>
@@ -216,7 +216,7 @@
                event_deferred_cb_schedule(                             \
                        event_base_get_deferred_cb_queue((bevp)->bev.ev_base), \
                        &(bevp)->deferred);                             \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 
 
 void
diff -r 4b5a337b76e2 -r 7a036ce580e8 external/bsd/libevent/dist/bufferevent_ratelim.c
--- a/external/bsd/libevent/dist/bufferevent_ratelim.c  Thu Apr 11 16:56:11 2013 +0000
+++ b/external/bsd/libevent/dist/bufferevent_ratelim.c  Thu Apr 11 16:56:41 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bufferevent_ratelim.c,v 1.1.1.1 2013/04/11 16:43:24 christos Exp $     */
+/*     $NetBSD: bufferevent_ratelim.c,v 1.2 2013/04/11 16:56:41 christos Exp $ */
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
  * Copyright (c) 2002-2006 Niels Provos <provos%citi.umich.edu@localhost>
@@ -214,7 +214,7 @@
        do {                                    \
                if (max_so_far > (x))           \
                        max_so_far = (x);       \
-       } while (0);
+       } while (/*CONSTCOND*/0);
 
        if (!bev->rate_limiting)
                return max_so_far;
@@ -482,7 +482,7 @@
                    bev = TAILQ_NEXT(bev, rate_limiting->next_in_group)) { \
                        block ;                                         \
                }                                                       \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 
 static void
 _bev_group_unsuspend_reading(struct bufferevent_rate_limit_group *g)
diff -r 4b5a337b76e2 -r 7a036ce580e8 external/bsd/libevent/dist/evbuffer-internal.h
--- a/external/bsd/libevent/dist/evbuffer-internal.h    Thu Apr 11 16:56:11 2013 +0000
+++ b/external/bsd/libevent/dist/evbuffer-internal.h    Thu Apr 11 16:56:41 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: evbuffer-internal.h,v 1.1.1.1 2013/04/11 16:43:26 christos Exp $       */
+/*     $NetBSD: evbuffer-internal.h,v 1.2 2013/04/11 16:56:41 christos Exp $   */
 /*
  * Copyright (c) 2000-2007 Niels Provos <provos%citi.umich.edu@localhost>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -221,19 +221,19 @@
 #define EVBUFFER_LOCK(buffer)                                          \
        do {                                                            \
                EVLOCK_LOCK((buffer)->lock, 0);                         \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 #define EVBUFFER_UNLOCK(buffer)                                                \
        do {                                                            \
                EVLOCK_UNLOCK((buffer)->lock, 0);                       \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 #define EVBUFFER_LOCK2(buffer1, buffer2)                               \
        do {                                                            \
                EVLOCK_LOCK2((buffer1)->lock, (buffer2)->lock, 0, 0);   \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 #define EVBUFFER_UNLOCK2(buffer1, buffer2)                             \
        do {                                                            \
                EVLOCK_UNLOCK2((buffer1)->lock, (buffer2)->lock, 0, 0); \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 
 /** Increase the reference count of buf by one. */
 void _evbuffer_incref(struct evbuffer *buf);
@@ -266,7 +266,7 @@
 #define WSABUF_FROM_EVBUFFER_IOV(i,ei) do {            \
                (i)->buf = (ei)->iov_base;              \
                (i)->len = (unsigned long)(ei)->iov_len;        \
-       } while (0)
+       } while (/*CONSTCOND*/0)
 /* XXXX the cast above is safe for now, but not if we allow mmaps on win64.
  * See note in buffer_iocp's launch_write function */
 
diff -r 4b5a337b76e2 -r 7a036ce580e8 external/bsd/libevent/dist/evbuffer.c
--- a/external/bsd/libevent/dist/evbuffer.c     Thu Apr 11 16:56:11 2013 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,456 +0,0 @@
-/*     $NetBSD: evbuffer.c,v 1.1.1.1 2009/11/02 10:00:53 plunky Exp $  */
-/*
- * Copyright (c) 2002-2004 Niels Provos <provos%citi.umich.edu@localhost>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
-
-#ifdef WIN32
-#include <winsock2.h>
-#endif
-
-#include "evutil.h"
-#include "event.h"
-
-/* prototypes */
-
-void bufferevent_read_pressure_cb(struct evbuffer *, size_t, size_t, void *);
-
-static int
-bufferevent_add(struct event *ev, int timeout)
-{
-       struct timeval tv, *ptv = NULL;
-
-       if (timeout) {
-               evutil_timerclear(&tv);
-               tv.tv_sec = timeout;
-               ptv = &tv;
-       }
-
-       return (event_add(ev, ptv));
-}
-
-/* 
- * This callback is executed when the size of the input buffer changes.
- * We use it to apply back pressure on the reading side.
- */



Home | Main Index | Thread Index | Old Index