You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by mi...@apache.org on 2011/05/30 21:55:10 UTC

svn commit: r1129330 - in /apr/apr-util/branches/1.5.x: crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/private/apr_crypto_internal.h

Author: minfrin
Date: Mon May 30 19:55:10 2011
New Revision: 1129330

URL: http://svn.apache.org/viewvc?rev=1129330&view=rev
Log:
Backport from trunk: Fix compilation with C90.

Modified:
    apr/apr-util/branches/1.5.x/crypto/apr_crypto_nss.c
    apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c
    apr/apr-util/branches/1.5.x/include/private/apr_crypto_internal.h

Modified: apr/apr-util/branches/1.5.x/crypto/apr_crypto_nss.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/crypto/apr_crypto_nss.c?rev=1129330&r1=1129329&r2=1129330&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/crypto/apr_crypto_nss.c (original)
+++ apr/apr-util/branches/1.5.x/crypto/apr_crypto_nss.c Mon May 30 19:55:10 2011
@@ -87,7 +87,7 @@ static apr_status_t crypto_error(const a
  *
  * It is safe to shut down twice.
  */
-static apr_status_t crypto_shutdown()
+static apr_status_t crypto_shutdown(void)
 {
     if (NSS_IsInitialized()) {
         SECStatus s = NSS_Shutdown();
@@ -462,11 +462,12 @@ static apr_status_t crypto_block_encrypt
             return APR_ENOIV;
         }
         if (*iv == NULL) {
+            SECStatus s;
             usedIv = apr_pcalloc(p, key->ivSize);
             if (!usedIv) {
                 return APR_ENOMEM;
             }
-            SECStatus s = PK11_GenerateRandom(usedIv, key->ivSize);
+            s = PK11_GenerateRandom(usedIv, key->ivSize);
             if (s != SECSuccess) {
                 return APR_ENOIV;
             }
@@ -526,6 +527,7 @@ static apr_status_t crypto_block_encrypt
 
     unsigned char *buffer;
     int outl = (int) *outlen;
+    SECStatus s;
     if (!out) {
         *outlen = inlen + block->blockSize;
         return APR_SUCCESS;
@@ -538,7 +540,7 @@ static apr_status_t crypto_block_encrypt
         *out = buffer;
     }
 
-    SECStatus s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*)in, inlen);
+    s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*)in, inlen);
     if (s != SECSuccess) {
         PRErrorCode perr = PORT_GetError();
         if (perr) {
@@ -687,6 +689,7 @@ static apr_status_t crypto_block_decrypt
 
     unsigned char *buffer;
     int outl = (int) *outlen;
+    SECStatus s;
     if (!out) {
         *outlen = inlen + block->blockSize;
         return APR_SUCCESS;
@@ -699,7 +702,7 @@ static apr_status_t crypto_block_decrypt
         *out = buffer;
     }
 
-    SECStatus s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*)in, inlen);
+    s = PK11_CipherOp(block->ctx, *out, &outl, inlen, (unsigned char*)in, inlen);
     if (s != SECSuccess) {
         PRErrorCode perr = PORT_GetError();
         if (perr) {

Modified: apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c?rev=1129330&r1=1129329&r2=1129330&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c (original)
+++ apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c Mon May 30 19:55:10 2011
@@ -79,7 +79,7 @@ static apr_status_t crypto_error(const a
 /**
  * Shutdown the crypto library and release resources.
  */
-static apr_status_t crypto_shutdown() {
+static apr_status_t crypto_shutdown(void) {
     ERR_free_strings();
     EVP_cleanup();
     ENGINE_cleanup();

Modified: apr/apr-util/branches/1.5.x/include/private/apr_crypto_internal.h
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/include/private/apr_crypto_internal.h?rev=1129330&r1=1129329&r2=1129330&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/include/private/apr_crypto_internal.h (original)
+++ apr/apr-util/branches/1.5.x/include/private/apr_crypto_internal.h Mon May 30 19:55:10 2011
@@ -234,7 +234,7 @@ struct apr_crypto_driver_t {
      * @note After cleanup, a context is free to be reused if necessary.
      * @return Returns APR_ENOTIMPL if not supported.
      */
-    apr_status_t (*shutdown)();
+    apr_status_t (*shutdown)(void);
 
     /**
      * @brief: fetch the most recent error from this driver.