]> granicus.if.org Git - libevent/commitdiff
C90 doesn't like declarations intermingled with statements
authorPhilip Prindeville <philipp@redfish-solutions.com>
Sat, 12 Nov 2016 00:51:37 +0000 (17:51 -0700)
committerAzat Khuzhin <a3at.mail@gmail.com>
Tue, 6 Dec 2016 06:56:28 +0000 (09:56 +0300)
So move all of the declarations to the top of the offending function.

This patch includes both of issues (Fixes:), from @jeking3 and
@pprindeville

Fixes: #418
Fixes: nmathewson/Libevent#136
bufferevent_openssl.c
test/bench_httpclient.c

index 2703d7044ce1c93d209b3162fa441db5cea66117..87225ca1218455e10a6bb84614524c8130b45818 100644 (file)
@@ -540,9 +540,11 @@ conn_closed(struct bufferevent_openssl *bev_ssl, int when, int errcode, int ret)
 static void
 init_bio_counts(struct bufferevent_openssl *bev_ssl)
 {
-       BIO *wbio = SSL_get_wbio(bev_ssl->ssl);
+       BIO *rbio, *wbio;
+
+       wbio = SSL_get_wbio(bev_ssl->ssl);
        bev_ssl->counts.n_written = wbio ? BIO_number_written(wbio) : 0;
-       BIO *rbio = SSL_get_rbio(bev_ssl->ssl);
+       rbio = SSL_get_rbio(bev_ssl->ssl);
        bev_ssl->counts.n_read = rbio ? BIO_number_read(rbio) : 0;
 }
 
index bcddc95f43809ab6dc82b70570758e1f3b8cd96e..e15929519dcc1cc8df808f601b665f1d34f1168a 100644 (file)
@@ -181,13 +181,14 @@ main(int argc, char **argv)
        struct timeval start, end, total;
        long long usec;
        double throughput;
-       resource = "/ref";
 
 #ifdef _WIN32
        WSADATA WSAData;
        WSAStartup(0x101, &WSAData);
 #endif
 
+       resource = "/ref";
+
        setvbuf(stdout, NULL, _IONBF, 0);
 
        base = event_base_new();