Make no-dh work, plus other no-dh problems found by Richard.
[openssl.git] / crypto / lock.c
index c7188780e61c34f1fe5eb412ffd621ba2f23eb6b..d24527a49bd6949046990a747fa848303583086b 100644 (file)
  * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
  */
 
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
 #include <openssl/safestack.h>
 
 #if defined(OPENSSL_SYS_WIN32)
-static double SSLeay_MSVC5_hack = 0.0; /* and for VC1.5 */
+static double OpenSSL_MSVC5_hack = 0.0; /* and for VC1.5 */
 #endif
 
 DECLARE_STACK_OF(CRYPTO_dynlock)
@@ -207,7 +207,7 @@ int CRYPTO_get_new_lockid(char *name)
      * using /MT. Without this, the application cannot use any floating point
      * printf's. It also seems to be needed for Visual C 1.5 (win16)
      */
-    SSLeay_MSVC5_hack = (double)name[0] * (double)name[1];
+    OpenSSL_MSVC5_hack = (double)name[0] * (double)name[1];
 #endif
 
     if ((app_locks == NULL)
@@ -251,7 +251,7 @@ int CRYPTO_get_new_dynlockid(void)
     }
     CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
 
-    pointer = (CRYPTO_dynlock *) OPENSSL_malloc(sizeof(CRYPTO_dynlock));
+    pointer = OPENSSL_malloc(sizeof(*pointer));
     if (pointer == NULL) {
         CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID, ERR_R_MALLOC_FAILURE);
         return (0);
@@ -309,8 +309,7 @@ void CRYPTO_destroy_dynlockid(int i)
         --pointer->references;
 #ifdef REF_CHECK
         if (pointer->references < 0) {
-            fprintf(stderr,
-                    "CRYPTO_destroy_dynlockid, bad reference count\n");
+            OPENSSL_showfatal("CRYPTO_destroy_dynlockid, bad reference count\n");
             abort();
         } else
 #endif