From bb63ff2d125e51688213d0af9e4f785cf3865063 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Tue, 15 Apr 2014 16:37:22 +0000 Subject: First pass at applying KNF to the OpenSSL code, which almost makes it readable. This pass is whitespace only and can readily be verified using tr and md5. --- src/lib/libcrypto/bio/bio_cb.c | 78 ++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 37 deletions(-) (limited to 'src/lib/libcrypto/bio/bio_cb.c') diff --git a/src/lib/libcrypto/bio/bio_cb.c b/src/lib/libcrypto/bio/bio_cb.c index 78c8974ab4..3e110f3751 100644 --- a/src/lib/libcrypto/bio/bio_cb.c +++ b/src/lib/libcrypto/bio/bio_cb.c @@ -63,81 +63,85 @@ #include #include -long BIO_debug_callback(BIO *bio, int cmd, const char *argp, - int argi, long argl, long ret) - { +long +BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl, + long ret) +{ BIO *b; char buf[256]; char *p; - long r=1; + long r = 1; size_t p_maxlen; if (BIO_CB_RETURN & cmd) - r=ret; + r = ret; - (void) snprintf(buf,sizeof buf,"BIO[%08lX]:",(unsigned long)bio); - p= &(buf[14]); + (void) snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio); + p = &(buf[14]); p_maxlen = sizeof buf - 14; - switch (cmd) - { + switch (cmd) { case BIO_CB_FREE: - (void) snprintf(p,p_maxlen,"Free - %s\n",bio->method->name); + (void) snprintf(p, p_maxlen, "Free - %s\n", bio->method->name); break; case BIO_CB_READ: if (bio->method->type & BIO_TYPE_DESCRIPTOR) - (void) snprintf(p,p_maxlen,"read(%d,%lu) - %s fd=%d\n", - bio->num,(unsigned long)argi, - bio->method->name,bio->num); + (void) snprintf(p, p_maxlen, + "read(%d,%lu) - %s fd=%d\n", + bio->num,(unsigned long)argi, + bio->method->name, bio->num); else - (void) snprintf(p,p_maxlen,"read(%d,%lu) - %s\n", - bio->num,(unsigned long)argi, - bio->method->name); + (void) snprintf(p, p_maxlen, "read(%d,%lu) - %s\n", + bio->num, (unsigned long)argi, bio->method->name); break; case BIO_CB_WRITE: if (bio->method->type & BIO_TYPE_DESCRIPTOR) - (void) snprintf(p,p_maxlen,"write(%d,%lu) - %s fd=%d\n", - bio->num,(unsigned long)argi, - bio->method->name,bio->num); + (void) snprintf(p, p_maxlen, + "write(%d,%lu) - %s fd=%d\n", + bio->num, (unsigned long)argi, + bio->method->name, bio->num); else - (void) snprintf(p,p_maxlen,"write(%d,%lu) - %s\n", - bio->num,(unsigned long)argi, - bio->method->name); + (void) snprintf(p, p_maxlen, "write(%d,%lu) - %s\n", + bio->num, (unsigned long)argi, bio->method->name); break; case BIO_CB_PUTS: - (void) snprintf(p,p_maxlen,"puts() - %s\n",bio->method->name); + (void) snprintf(p, p_maxlen, + "puts() - %s\n", bio->method->name); break; case BIO_CB_GETS: - (void) snprintf(p,p_maxlen,"gets(%lu) - %s\n",(unsigned long)argi,bio->method->name); + (void) snprintf(p, p_maxlen, "gets(%lu) - %s\n", + (unsigned long)argi, bio->method->name); break; case BIO_CB_CTRL: - (void) snprintf(p,p_maxlen,"ctrl(%lu) - %s\n",(unsigned long)argi,bio->method->name); + (void) snprintf(p, p_maxlen, "ctrl(%lu) - %s\n", + (unsigned long)argi, bio->method->name); break; case BIO_CB_RETURN|BIO_CB_READ: - (void) snprintf(p,p_maxlen,"read return %ld\n",ret); + (void) snprintf(p, p_maxlen, "read return %ld\n", ret); break; case BIO_CB_RETURN|BIO_CB_WRITE: - (void) snprintf(p,p_maxlen,"write return %ld\n",ret); + (void) snprintf(p, p_maxlen, "write return %ld\n", ret); break; case BIO_CB_RETURN|BIO_CB_GETS: - (void) snprintf(p,p_maxlen,"gets return %ld\n",ret); + (void) snprintf(p, p_maxlen, "gets return %ld\n", ret); break; case BIO_CB_RETURN|BIO_CB_PUTS: - (void) snprintf(p,p_maxlen,"puts return %ld\n",ret); + (void) snprintf(p, p_maxlen, "puts return %ld\n", ret); break; case BIO_CB_RETURN|BIO_CB_CTRL: - (void) snprintf(p,p_maxlen,"ctrl return %ld\n",ret); + (void) snprintf(p, p_maxlen, "ctrl return %ld\n", ret); break; default: - (void) snprintf(p,p_maxlen,"bio callback - unknown type (%d)\n",cmd); + (void) snprintf(p, p_maxlen, + "bio callback - unknown type (%d)\n", cmd); break; - } + } - b=(BIO *)bio->cb_arg; + b = (BIO *)bio->cb_arg; if (b != NULL) - BIO_write(b,buf,strlen(buf)); + BIO_write(b, buf, strlen(buf)); #if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) else - fputs(buf,stderr); + fputs(buf, stderr); #endif - return(r); - } + return (r); +} -- cgit v1.2.3-55-g6feb