Index: pjproject/trunk/build/vs/pjproject-vs14-win32-common-defaults.props
===================================================================
--- pjproject/trunk/build/vs/pjproject-vs14-win32-common-defaults.props	(revision 5634)
+++ pjproject/trunk/build/vs/pjproject-vs14-win32-common-defaults.props	(revision 5635)
@@ -1,5 +1,5 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ImportGroup Label="PropertySheets">    
+  <ImportGroup Label="PropertySheets">
   </ImportGroup>
   <PropertyGroup Label="UserMacros">
@@ -14,4 +14,7 @@
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
+    <Lib>
+      <AdditionalOptions>/ignore:4221</AdditionalOptions>
+    </Lib>
   </ItemDefinitionGroup>
   <ItemGroup>
Index: pjproject/trunk/build/vs/pjproject-vs14-win64-common-defaults.props
===================================================================
--- pjproject/trunk/build/vs/pjproject-vs14-win64-common-defaults.props	(revision 5634)
+++ pjproject/trunk/build/vs/pjproject-vs14-win64-common-defaults.props	(revision 5635)
@@ -1,5 +1,5 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ImportGroup Label="PropertySheets">    
+  <ImportGroup Label="PropertySheets">
   </ImportGroup>
   <PropertyGroup Label="UserMacros">
@@ -14,4 +14,7 @@
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
+    <Lib>
+      <AdditionalOptions>/ignore:4221</AdditionalOptions>
+    </Lib>
   </ItemDefinitionGroup>
   <ItemGroup>
Index: pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c	(revision 5634)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c	(revision 5635)
@@ -663,4 +663,8 @@
         pj_dns_addr_record rec;
 
+	/* Avoid warning: potentially uninitialized local variable 'rec' */
+	rec.alias.slen = 0;
+	rec.addr_count = 0;
+
 	/* Clear outstanding job */
 	if (common->type == PJ_DNS_TYPE_A) {
@@ -692,6 +696,6 @@
 		          status,
 		          pj_strerror(status,errmsg,sizeof(errmsg)).ptr));
-            }
-        }
+	    }
+	}
 
 	/* Check that we really have answer */
Index: pjproject/trunk/pjlib/src/pj/os_info.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/os_info.c	(revision 5634)
+++ pjproject/trunk/pjlib/src/pj/os_info.c	(revision 5635)
@@ -100,5 +100,6 @@
 static pj_uint32_t parse_version(char *str)
 {    
-    int i, maxtok, found_idx;
+    int i, maxtok;
+    pj_ssize_t found_idx;
     pj_uint32_t version = 0;
     pj_str_t in_str = pj_str(str);
Index: pjproject/trunk/pjlib/src/pj/sock_qos_bsd.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/sock_qos_bsd.c	(revision 5634)
+++ pjproject/trunk/pjlib/src/pj/sock_qos_bsd.c	(revision 5635)
@@ -104,5 +104,5 @@
 {
     pj_status_t last_err = PJ_ENOTSUP;
-    int val, optlen;
+    int val = 0, optlen;
     pj_sockaddr sa;
     int salen = sizeof(salen);
Index: pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c	(revision 5634)
+++ pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c	(revision 5635)
@@ -116,6 +116,8 @@
 #  define M_ASN1_STRING_data(x)	    ASN1_STRING_get0_data(x)
 #  define M_ASN1_STRING_length(x)   ASN1_STRING_length(x)
-#  define X509_get_notBefore(x)	    X509_get0_notBefore(x)
-#  define X509_get_notAfter(x)	    X509_get0_notAfter(x)
+#  if defined(OPENSSL_API_COMPAT) && OPENSSL_API_COMPAT >= 0x10100000L
+#     define X509_get_notBefore(x)  X509_get0_notBefore(x)
+#     define X509_get_notAfter(x)   X509_get0_notAfter(x)
+#  endif
 #else
 #  define SSL_CIPHER_get_id(c)	    (c)->id
@@ -133,4 +135,5 @@
 #    pragma comment(lib, "ssleay32")
 #  endif
+#  define strerror_r(errno,buf,len) strerror_s(buf,len,errno)
 #endif
 
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 5634)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 5635)
@@ -769,5 +769,6 @@
 {
     pj_str_t token, delim, host;
-    int af, found_idx;    
+    int af;
+    pj_ssize_t found_idx;
     pj_status_t status = PJNATH_EICEINCANDSDP;
 
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c	(revision 5634)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c	(revision 5635)
@@ -832,5 +832,5 @@
 	/* TX crypto and key */
 	b64_len = sizeof(b64);
-	status = pj_base64_encode((pj_uint8_t*)tx->key.ptr, tx->key.slen,
+	status = pj_base64_encode((pj_uint8_t*)tx->key.ptr, (int)tx->key.slen,
 				  b64, &b64_len);
 	if (status != PJ_SUCCESS)
@@ -849,5 +849,5 @@
 	/* RX crypto and key */
 	b64_len = sizeof(b64);
-	status = pj_base64_encode((pj_uint8_t*)rx->key.ptr, rx->key.slen,
+	status = pj_base64_encode((pj_uint8_t*)rx->key.ptr, (int)rx->key.slen,
 				  b64, &b64_len);
 	if (status != PJ_SUCCESS)
@@ -1179,5 +1179,5 @@
 {
     transport_srtp *srtp = (transport_srtp *) user_data;
-    int len = size;
+    int len = (int)size;
     srtp_err_status_t err;
     void (*cb)(void*, void*, pj_ssize_t) = NULL;
@@ -1273,5 +1273,5 @@
 {
     transport_srtp *srtp = (transport_srtp *) user_data;
-    int len = size;
+    int len = (int)size;
     srtp_err_status_t err;
     void (*cb)(void*, void*, pj_ssize_t) = NULL;
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c	(revision 5634)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c	(revision 5635)
@@ -33,5 +33,6 @@
 #include <openssl/ssl.h>
 
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \
+    defined(OPENSSL_API_COMPAT) && OPENSSL_API_COMPAT >= 0x10100000L
 #  define X509_get_notBefore(x)	    X509_getm_notBefore(x)
 #  define X509_get_notAfter(x)	    X509_getm_notAfter(x)
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c	(revision 5634)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c	(revision 5635)
@@ -158,5 +158,5 @@
 
     /* Key transmitted via SDP should be base64 encoded. */
-    status = pj_base64_encode((pj_uint8_t*)crypto->key.ptr, crypto->key.slen,
+    status = pj_base64_encode((pj_uint8_t*)crypto->key.ptr, (int)crypto->key.slen,
 			      b64_key, &b64_key_len);
     if (status != PJ_SUCCESS) {
@@ -192,5 +192,6 @@
     pj_str_t token, delim;
     pj_status_t status;
-    int itmp, found_idx;
+    int itmp;
+    pj_ssize_t found_idx;
 
     pj_bzero(crypto, sizeof(*crypto));
Index: pjproject/trunk/pjmedia/src/pjmedia/wav_player.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/wav_player.c	(revision 5634)
+++ pjproject/trunk/pjmedia/src/pjmedia/wav_player.c	(revision 5635)
@@ -456,5 +456,5 @@
     }
 
-    info->size_bytes = pjmedia_wav_player_get_len(port);
+    info->size_bytes = (pj_uint32_t)pjmedia_wav_player_get_len(port);
     info->size_samples = info->size_bytes /
 			 (info->payload_bits_per_sample / 8);
Index: pjproject/trunk/pjnath/src/pjnath/turn_session.c
===================================================================
--- pjproject/trunk/pjnath/src/pjnath/turn_session.c	(revision 5634)
+++ pjproject/trunk/pjnath/src/pjnath/turn_session.c	(revision 5635)
@@ -1779,8 +1779,8 @@
     /* Run pending allocation */
     if (sess->pending_alloc) {
-	pj_status_t status;
-	status = pj_turn_session_alloc(sess, NULL);
-	if (status != PJ_SUCCESS)
-	    on_session_fail(sess, PJ_STUN_ALLOCATE_METHOD, status, NULL);
+	pj_status_t status2;
+	status2 = pj_turn_session_alloc(sess, NULL);
+	if (status2 != PJ_SUCCESS)
+	    on_session_fail(sess, PJ_STUN_ALLOCATE_METHOD, status2, NULL);
     }
 
Index: pjproject/trunk/pjsip-apps/src/samples/encdec.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/encdec.c	(revision 5634)
+++ pjproject/trunk/pjsip-apps/src/samples/encdec.c	(revision 5635)
@@ -177,5 +177,5 @@
 	}
 	
-	bitstream_size += frm_bit.size;
+	bitstream_size += (unsigned)frm_bit.size;
 
 	/* Parse the bitstream (not really necessary for this case
Index: pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_resolve.c	(revision 5634)
+++ pjproject/trunk/pjsip/src/pjsip/sip_resolve.c	(revision 5635)
@@ -281,9 +281,9 @@
 		    unsigned int count = 1;
 		    pj_addrinfo ai[1];
-		    pj_status_t status;
-
-                    status = pj_getaddrinfo(pj_AF_INET6(),
+		    pj_status_t status2;
+
+                    status2 = pj_getaddrinfo(pj_AF_INET6(),
                     			    &target->addr.host, &count, ai);
-		    if (status == PJ_SUCCESS && count > 0 &&
+		    if (status2 == PJ_SUCCESS && count > 0 &&
 		    	ai[0].ai_addr.addr.sa_family == pj_AF_INET6())
 		    {
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 5634)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 5635)
@@ -2940,7 +2940,7 @@
     */
     pconst = pjsip_parser_const();	
-    call_id_len = pj_strncpy2_escape(call_id_dest_buf, &dest_dlg->call_id->id,
-     				     PJ_ARRAY_SIZE(call_id_dest_buf),
-     				     &pconst->pjsip_HDR_CHAR_SPEC);
+    call_id_len = (int)pj_strncpy2_escape(call_id_dest_buf, &dest_dlg->call_id->id,
+     					  PJ_ARRAY_SIZE(call_id_dest_buf),
+     					  &pconst->pjsip_HDR_CHAR_SPEC);
     if (call_id_len < 0) {
     	status = PJSIP_EURITOOLONG;
Index: pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
===================================================================
--- pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp	(revision 5634)
+++ pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp	(revision 5635)
@@ -85,4 +85,6 @@
         verifyMsgs.push_back(verif_msgs[i]);
     }
+#else
+    PJ_UNUSED_ARG(info);
 #endif
 }
@@ -1394,5 +1396,5 @@
     
     srtp_opt->use = prm.srtpUse;
-    srtp_opt->crypto_count = prm.cryptos.size();
+    srtp_opt->crypto_count = (unsigned)prm.cryptos.size();
     for (unsigned i = 0; i < srtp_opt->crypto_count; i++) {
     	srtp_opt->crypto[i].key   = str2Pj(prm.cryptos[i].key);
Index: pjproject/trunk/pjsip/src/pjsua2/media.cpp
===================================================================
--- pjproject/trunk/pjsip/src/pjsua2/media.cpp	(revision 5634)
+++ pjproject/trunk/pjsip/src/pjsua2/media.cpp	(revision 5635)
@@ -352,5 +352,5 @@
     pj_ssize_t pos = pjsua_player_get_pos(playerId);
     if (pos < 0) {
-	PJSUA2_RAISE_ERROR2(-pos, "AudioMediaPlayer::getPos()");
+	PJSUA2_RAISE_ERROR2((pj_status_t)-pos, "AudioMediaPlayer::getPos()");
     }
     return (pj_uint32_t)pos;
@@ -509,5 +509,5 @@
     }
 
-    status = pjmedia_tonegen_play(tonegen, tones.size(), &tones[0],
+    status = pjmedia_tonegen_play(tonegen, (unsigned)tones.size(), &tones[0],
 				  loop? PJMEDIA_TONEGEN_LOOP : 0);
     PJSUA2_CHECK_RAISE_ERROR2(status, "ToneGenerator::play()");
@@ -526,5 +526,5 @@
     }
 
-    status = pjmedia_tonegen_play_digits(tonegen, digits.size(), &digits[0],
+    status = pjmedia_tonegen_play_digits(tonegen, (unsigned)digits.size(), &digits[0],
 					 loop? PJMEDIA_TONEGEN_LOOP : 0);
     PJSUA2_CHECK_RAISE_ERROR2(status, "ToneGenerator::playDigits()");
@@ -572,5 +572,5 @@
     }
 
-    digitMap.count = digit_map.size();
+    digitMap.count = (unsigned)digit_map.size();
     if (digitMap.count > PJ_ARRAY_SIZE(digitMap.digits))
 	digitMap.count = PJ_ARRAY_SIZE(digitMap.digits);
Index: pjproject/trunk/third_party/build/speex/config.h
===================================================================
--- pjproject/trunk/third_party/build/speex/config.h	(revision 5634)
+++ pjproject/trunk/third_party/build/speex/config.h	(revision 5635)
@@ -28,4 +28,5 @@
 #   pragma warning(disable: 4018)   // signed/unsigned mismatch
 #   pragma warning(disable: 4456)   // declaration of '[var]' hides previous local declaration
+#   pragma warning(disable: 4267)   // conversion from 'size_t' to 'int', possible loss of data
 //#   pragma warning(disable: 4701)   // local variable used without initialized
 #endif
Index: pjproject/trunk/third_party/build/srtp/srtp_config.h
===================================================================
--- pjproject/trunk/third_party/build/srtp/srtp_config.h	(revision 5634)
+++ pjproject/trunk/third_party/build/srtp/srtp_config.h	(revision 5635)
@@ -138,7 +138,7 @@
 #   endif
 
-//#   pragma warning(disable:4311)
+#   pragma warning(disable:4311) // 'type cast': pointer truncation from 'unsigned char *' to 'unsigned long'
 //#   pragma warning(disable:4761) // integral mismatch
-//#   pragma warning(disable:4018) // signed/unsigned mismatch
+#   pragma warning(disable:4018) // '<' : signed/unsigned mismatch
 #   pragma warning(disable:4244) // conversion from int64 to int
 #   pragma warning(disable:4100) // unreferenced formal parameter
@@ -147,4 +147,5 @@
 #   pragma warning(disable:4701) // potentially uninitialized local variable used
 #   pragma warning(disable:4702) // unreachable code
+#   pragma warning(disable:4703) // potentially uninitialized local pointer variable used
 #endif
 
