Resolve warnings in VC-WIN32 build, which allows to add /WX.
[openssl.git] / crypto / bio / b_addr.c
index b2cd83c3929a78b94518bd3a5e7f5a5bdcf9bdbd..d6d70a1ae9d94eafef8dc797601a7c32d77f2f57 100644 (file)
@@ -76,7 +76,7 @@ int BIO_ADDR_make(BIO_ADDR *ap, const struct sockaddr *sa)
     }
 #endif
 #ifdef AF_UNIX
-    if (ap->sa.sa_family == AF_UNIX) {
+    if (sa->sa_family == AF_UNIX) {
         ap->s_un = *(const struct sockaddr_un *)sa;
         return 1;
     }
@@ -603,7 +603,7 @@ static int addrinfo_wrap(int family, int socktype,
 DEFINE_RUN_ONCE_STATIC(do_bio_lookup_init)
 {
     OPENSSL_init_crypto(0, NULL);
-    bio_lookup_lock = CRYPTO_THREAD_lock_new();
+    bio_lookup_lock = CRYPTO_THREAD_glock_new("bio_lookup");
     return bio_lookup_lock != NULL;
 }
 
@@ -821,7 +821,7 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
 
             if (endp != service && *endp == '\0'
                     && portnum > 0 && portnum < 65536) {
-                se_fallback.s_port = htons(portnum);
+                se_fallback.s_port = htons((unsigned short)portnum);
                 se_fallback.s_proto = proto;
                 se = &se_fallback;
             } else if (endp == service) {