r3392 - in trunk: libmcrypto/include/libmcrypto libmcrypto/source libmcrypto/source/openssl libmikey/include/libmikey libmikey/keyagreement libmikey/mikey libmnetutil/source libmsip/include/libmsip libmsip/source libmsip/source/headers libmsip/source/messages libmstun/source libmutil/include/libmutil libmutil/source

erik at minisip.org erik at minisip.org
Wed Aug 22 23:56:38 CEST 2007


Author: erik
Date: 2007-08-22 23:56:37 +0200 (Wed, 22 Aug 2007)
New Revision: 3392

Modified:
   trunk/libmcrypto/include/libmcrypto/SipSim.h
   trunk/libmcrypto/include/libmcrypto/cert.h
   trunk/libmcrypto/source/CertificateFinder.cxx
   trunk/libmcrypto/source/CertificatePathFinderUcd.cxx
   trunk/libmcrypto/source/cert.cxx
   trunk/libmcrypto/source/openssl/rand.cxx
   trunk/libmikey/include/libmikey/KeyAgreementDH.h
   trunk/libmikey/keyagreement/KeyAgreementPKE.cxx
   trunk/libmikey/mikey/Mikey.cxx
   trunk/libmikey/mikey/MikeyMessage.cxx
   trunk/libmnetutil/source/HttpDownloader.cxx
   trunk/libmnetutil/source/IP6Address.cxx
   trunk/libmnetutil/source/LdapDownloader.cxx
   trunk/libmnetutil/source/NetworkFunctions.cxx
   trunk/libmnetutil/source/SocketServer.cxx
   trunk/libmsip/include/libmsip/SipDialog.h
   trunk/libmsip/source/SipLayerTransaction.cxx
   trunk/libmsip/source/headers/SipHeaderCSeq.cxx
   trunk/libmsip/source/headers/SipHeaderContentLength.cxx
   trunk/libmsip/source/headers/SipHeaderRAck.cxx
   trunk/libmsip/source/headers/SipHeaderRSeq.cxx
   trunk/libmsip/source/messages/SipRequest.cxx
   trunk/libmsip/source/messages/SipResponse.cxx
   trunk/libmstun/source/STUNAttributes.cxx
   trunk/libmutil/include/libmutil/dbg.h
   trunk/libmutil/source/FileSystemUtils.cxx
Log:
libmutil, libmnetutil, libmcrypto, libmstun, libmikey, libmsip:
 * A lot of warnings removed (such as implicit type conversion from 
   size_t to int).

Modified: trunk/libmcrypto/include/libmcrypto/SipSim.h
===================================================================
--- trunk/libmcrypto/include/libmcrypto/SipSim.h	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmcrypto/include/libmcrypto/SipSim.h	2007-08-22 21:56:37 UTC (rev 3392)
@@ -32,7 +32,7 @@
 
 #define HASH_SHA1 1
 
-class SipSim : public virtual MObject {
+class LIBMCRYPTO_API SipSim : public virtual MObject {
 
 public:
 

Modified: trunk/libmcrypto/include/libmcrypto/cert.h
===================================================================
--- trunk/libmcrypto/include/libmcrypto/cert.h	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmcrypto/include/libmcrypto/cert.h	2007-08-22 21:56:37 UTC (rev 3392)
@@ -36,6 +36,8 @@
 #include<libmutil/Exception.h>
 #include<libmutil/CacheItem.h>
 
+#pragma warning (disable: 4251)
+
 class Certificate;
 #if 0
 #define CERT_DB_ITEM_TYPE_OTHER  0

Modified: trunk/libmcrypto/source/CertificateFinder.cxx
===================================================================
--- trunk/libmcrypto/source/CertificateFinder.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmcrypto/source/CertificateFinder.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -86,7 +86,7 @@
 		if (USE_CERTIFICATE_CACHE != CERTCACHEUSE_NONE) {
 			stats->cacheQueries++;
 			ret = cacheManager->findCertificates(subjectUri, issuer);
-			mdbg("ucd") << "    Found certificates in local cache: " << ret.size() << std::endl;
+			mdbg("ucd") << "    Found certificates in local cache: " << (int)ret.size() << std::endl;
 			if (!ret.empty()){
 				return ret;
 			} else {
@@ -114,7 +114,7 @@
 
 			LdapUrl url(sias.at(0));
 			ret = downloadFromLdap(url, subjectUri, issuer, typeCrossCert);
-			mdbg("ucd") << "    Found certificates using SIA: " << ret.size() << std::endl;
+			mdbg("ucd") << "    Found certificates using SIA: " << (int)ret.size() << std::endl;
 			if (!ret.empty()) {
 				return ret;
 			}
@@ -140,7 +140,7 @@
 		LdapUrl url(server);
 		ret = downloadFromLdap(url, subjectUri, issuer, typeCrossCert);
 
-		mdbg("ucd") << "    Found certificates using SRV: " << ret.size() << std::endl;
+		mdbg("ucd") << "    Found certificates using SRV: " << (int)ret.size() << std::endl;
 		stats->dnsSrvQueries++;
 
 		if (!ret.empty()) {
@@ -170,7 +170,7 @@
 			guessName = "ldap." + curAltNamesDomains.at(0);
 
 			ret = downloadFromLdap(LdapUrl("ldap://" + guessName), subjectUri, issuer, typeCrossCert);
-			mdbg("ucd") << "    Found certificates using domain name guessing (guess:" << guessName << "): " << ret.size() << std::endl;
+			mdbg("ucd") << "    Found certificates using domain name guessing (guess:" << guessName << "): " << (int)ret.size() << std::endl;
 			if (!ret.empty()) {
 				effort = MAX_EFFORT;
 				return ret;
@@ -285,7 +285,7 @@
 			} catch (LdapException & ex) {
 				mdbg("ucd") << "    LdapException: " << ex.what() << std::endl;
 			}
-			mdbg("ucd") << "    " << result.size() << " entries found" << std::endl;
+			mdbg("ucd") << "    " << (int)result.size() << " entries found" << std::endl;
 
 			if (result.size() == 0)
 				if (stats != NULL) stats->ldapQueriesNoResult++;

Modified: trunk/libmcrypto/source/CertificatePathFinderUcd.cxx
===================================================================
--- trunk/libmcrypto/source/CertificatePathFinderUcd.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmcrypto/source/CertificatePathFinderUcd.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -338,7 +338,7 @@
 	interested in what lies *above* curCert.domain.
 	*/
 
-	mdbg("ucd") << "    tempCurrent.size()=" << tempCurrent.size() << ", tempTo.size()=" << tempTo.size() << std::endl;
+	mdbg("ucd") << "    tempCurrent.size()=" << (int)tempCurrent.size() << ", tempTo.size()=" << (int)tempTo.size() << std::endl;
 
 	if (tempCurrent.size() > 0)
 		tempCurrent.erase(tempCurrent.begin());
@@ -388,7 +388,7 @@
 	std::vector<std::string>::iterator nameIter;
 	std::vector<std::string> resDomains;
 
-	mdbg("ucd") << "    Certificate belonging to " << toCert->getCn() << " has " << altNames.size() << " subjectAltNames" << std::endl;
+	mdbg("ucd") << "    Certificate belonging to " << toCert->getCn() << " has " << (int)altNames.size() << " subjectAltNames" << std::endl;
 	/*
 	For each of the alt. names we calculate all possible "parent name". Note that it is
 	VERY unlikely that a CA certificate has multiple alternative names, an end-user may

Modified: trunk/libmcrypto/source/cert.cxx
===================================================================
--- trunk/libmcrypto/source/cert.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmcrypto/source/cert.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -357,7 +357,7 @@
 		item->setImportMethod(CertificateSetItem::IMPORTMETHOD_FILE);
 		item->setImportParameter(uri.getString());
 		return item;
-	} catch (CertificateException & ex) {
+	} catch (CertificateException & /*ex*/) {
 	}
 	return MRef<CertificateSetItem*>();
 }

Modified: trunk/libmcrypto/source/openssl/rand.cxx
===================================================================
--- trunk/libmcrypto/source/openssl/rand.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmcrypto/source/openssl/rand.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -28,14 +28,14 @@
 
 bool Rand::randomize(void *buffer, size_t length)
 {
-	return RAND_bytes((unsigned char*)buffer, length);
+	return RAND_bytes((unsigned char*)buffer, (int)length) != 0;
 }
 
 bool Rand::randomize(void * buffer, size_t length, MRef<SipSim *> sim)
 {
 	unsigned char * tempBufferPtr = new unsigned char[16];
-	int index = 0;
-	int left = length;
+	size_t index = 0;
+	size_t left = length;
 	while(left > 16){
 		if(sim->getRandomValue(tempBufferPtr, 16)){
 			memcpy(&((unsigned char *)buffer)[index], tempBufferPtr, 16);

Modified: trunk/libmikey/include/libmikey/KeyAgreementDH.h
===================================================================
--- trunk/libmikey/include/libmikey/KeyAgreementDH.h	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmikey/include/libmikey/KeyAgreementDH.h	2007-08-22 21:56:37 UTC (rev 3392)
@@ -40,7 +40,24 @@
 class certificate;
 class CertificateSet;
 
+/*
+ITgk is an interface implemented by KeyAgreement.
+KeyAgreementDH inherits the methods in the interface
+both via DHBase and KeyAgreement. MSVC warns that
+the version inherited from DHBase is used.
 
+ ITgk
+ ! !  
+ ! KeyAgreement
+ DHBase   !
+    !     !
+  KeyAgreementDH
+
+  We turn off the warning for this situation so that not every
+  compile that includes this file gets those warnings.
+*/
+#pragma warning (disable: 4250)
+
 class LIBMIKEY_API PeerCertificates {
 	public:
 		PeerCertificates( MRef<CertificateChain*> aCert,

Modified: trunk/libmikey/keyagreement/KeyAgreementPKE.cxx
===================================================================
--- trunk/libmikey/keyagreement/KeyAgreementPKE.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmikey/keyagreement/KeyAgreementPKE.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -59,7 +59,7 @@
 
 void KeyAgreementPKE::setEnvelopeKey( const byte_t *aEnvKey,
 				      size_t aEnvKeyLength ){
-	setPSK( aEnvKey, aEnvKeyLength );
+	setPSK( aEnvKey, (int)aEnvKeyLength );
 }
 	
 MikeyMessage* KeyAgreementPKE::createMessage(){

Modified: trunk/libmikey/mikey/Mikey.cxx
===================================================================
--- trunk/libmikey/mikey/Mikey.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmikey/mikey/Mikey.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -529,11 +529,11 @@
 			}
 
 			if( type == KEY_AGREEMENT_TYPE_PSK ){
-				ka = new KeyAgreementPSK(psk, psk_len);
+				ka = new KeyAgreementPSK(psk, (int)psk_len);
 			}
 			else{
 				KeyAgreementDHHMAC *kaDH =
-					new KeyAgreementDHHMAC(psk, psk_len);
+					new KeyAgreementDHHMAC(psk, (int)psk_len);
 				if( isInitiator() ){
 					kaDH->setGroup( DH_GROUP_OAKLEY5 );
 				}

Modified: trunk/libmikey/mikey/MikeyMessage.cxx
===================================================================
--- trunk/libmikey/mikey/MikeyMessage.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmikey/mikey/MikeyMessage.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -331,7 +331,8 @@
 
 	byte_t * start = rawMessageData();
 	byte_t * end = start;
-	uint32_t diff=rawMessageLength() - sigLength;
+	int diff=rawMessageLength() - (int)sigLength;
+	assert(diff>=0);
 	end+=diff;
 
 	signData.insert( signData.end(), start, end);
@@ -378,7 +379,7 @@
 
 	signData = buildSignData( GUESSED_SIGNATURE_LENGTH, addIdsAndT );
 
-	if (!sim->getSignature( &signData.front(), signData.size(), 
+	if (!sim->getSignature( &signData.front(), (int)signData.size(), 
 			 signature, signatureLength, true )){
 		throw MikeyException( "Could not perform digital signature of the message" );
 	}
@@ -388,7 +389,7 @@
 		sign->setSigData(signature, signatureLength); // the length needs to be set to the correct value
 		signData = buildSignData( signatureLength, addIdsAndT );
 
-		sim->getSignature( &signData.front(), signData.size(),
+		sim->getSignature( &signData.front(), (int)signData.size(),
 				signature, signatureLength, true );
 	}
 
@@ -426,7 +427,7 @@
 
 	signData = buildSignData( GUESSED_SIGNATURE_LENGTH, addIdsAndT );
 
-	if (cert->signData( &signData.front(), signData.size(),
+	if (cert->signData( &signData.front(), (int)signData.size(),
 			 signature, &signatureLength )){
 		throw MikeyException( "Could not perform digital signature of the message" );
 	}
@@ -437,7 +438,7 @@
 		sign->setSigData(signature, signatureLength); // the length needs to be set to the correct value
 		signData = buildSignData( signatureLength, addIdsAndT );
 
-		cert->signData( &signData.front(), signData.size(),
+		cert->signData( &signData.front(), (int)signData.size(),
 				 signature, &signatureLength );
 	}
 
@@ -931,7 +932,7 @@
 
 	signData = buildSignData( sig->sigLength(), addIdsAndT );
 
-	int res = cert->verifSign( &signData.front(), signData.size(),
+	int res = cert->verifSign( &signData.front(), (int)signData.size(),
 				    sig->sigData(),
 				    sig->sigLength() );
 	return res > 0;
@@ -1150,7 +1151,7 @@
 	}
 
 	MikeyPayloadID* initId =
-		new MikeyPayloadID( type, id.size(), (byte_t*)id.c_str() );
+		new MikeyPayloadID( type, (int)id.size(), (byte_t*)id.c_str() );
 	addPayload( initId );
 }
 

Modified: trunk/libmnetutil/source/HttpDownloader.cxx
===================================================================
--- trunk/libmnetutil/source/HttpDownloader.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmnetutil/source/HttpDownloader.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -131,7 +131,7 @@
 
 			if (bodyStr != NULL) {
 				// Found boundary
-				headerStream.write(buffer, bodyStr - buffer);
+				headerStream.write(buffer, (int)(bodyStr - (char*)buffer));
 				// Error checking!
 				if (headerStream.fail()) {
 					return 0;
@@ -208,11 +208,11 @@
 
 void HttpDownloader::split(std::string data, std::string token, std::vector<std::string> &res, int maxChars)
 {
-	int count = 0;
+	size_t count = 0;
 	size_t lastpos = 0;
-	int tokenlen = token.length();
+	size_t tokenlen = token.length();
 	size_t pos = data.find(token,lastpos);
-	while(std::string::npos != pos && ((maxChars > 0 && pos < maxChars) || maxChars <= 0))
+	while(std::string::npos != pos && ((maxChars > 0 && (int)pos < maxChars) || maxChars <= 0))
 	{
 		count = pos - lastpos;
 		res.push_back(data.substr(lastpos,count));
@@ -233,7 +233,7 @@
 	size_t trimLeftPos = s.find_first_not_of(" \n\t\r");
 	size_t trimRightPos = s.find_last_not_of(" \n\t\r");
 	size_t pos = 0;
-	int len = 0;
+	size_t len = 0;
 
 	if (trimLeftPos != std::string::npos)
 		pos = trimLeftPos;

Modified: trunk/libmnetutil/source/IP6Address.cxx
===================================================================
--- trunk/libmnetutil/source/IP6Address.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmnetutil/source/IP6Address.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -73,7 +73,7 @@
 
 using namespace std;
 
-#define MAKE_UINT16(x,y) ((x)<<8+(y))
+#define MAKE_UINT16(x,y) (((x)<<8)+(y))
 
 #ifdef HAVE_GETADDRINFO
 void initIp6Address( const string &ipaddr, struct sockaddr_in6 *sockaddress,

Modified: trunk/libmnetutil/source/LdapDownloader.cxx
===================================================================
--- trunk/libmnetutil/source/LdapDownloader.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmnetutil/source/LdapDownloader.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -41,8 +41,8 @@
 			std::vector<std::string> attrs = url.getAttributes();
 			entries = conn->find(url.getDn(), url.getFilter(), attrs, url.getScope());
 			isLoaded = true;
-		} catch (LdapNotConnectedException & e) {
-		} catch (LdapException & e) {
+		} catch (LdapNotConnectedException & /*e*/) {
+		} catch (LdapException & /*e*/) {
 		}
 	}
 }
@@ -60,11 +60,11 @@
 				try {
 					std::string firstAttrValue = entry->getAttrValueString(attrs.at(0));
 
-					*length = firstAttrValue.length();
+					*length = (int)firstAttrValue.length();
 					char* res = new char[*length];
 					memcpy(res, firstAttrValue.c_str(), *length);
 					return res;
-				} catch (LdapAttributeNotFoundException & e) {
+				} catch (LdapAttributeNotFoundException & /*e*/) {
 					/*
 					 * Could not find the first named attribute amongst the string
 					 * attributes. Try to find the same attribute name in the
@@ -78,7 +78,7 @@
 							memcpy(res, firstAttrValues.at(0)->value, *length);
 							return res;
 						}
-					} catch (LdapAttributeNotFoundException & e) {
+					} catch (LdapAttributeNotFoundException & /*e*/) {
 						/*
 						 * Could not find attribute in collection of binary attributes
 						 * either. This is very odd and should be be able to happen!
@@ -104,7 +104,7 @@
 				std::vector< MRef<LdapEntryBinaryValue*> > binaryData = entry->getAttrValuesBinary(attr);
 
 				for (size_t i=0; i<binaryData.size(); i++) {
-					std::string fileName = nextFilename(filenameBase, i+1);
+					std::string fileName = nextFilename(filenameBase, (int)i+1);
 					std::ofstream file(fileName.c_str());
 					if (file.good()) {
 						MRef<LdapEntryBinaryValue*> val = binaryData.at(i);
@@ -115,7 +115,7 @@
 					if (onlyFirst && i==0)
 						break;
 				}
-			} catch (LdapAttributeNotFoundException & e) {
+			} catch (LdapAttributeNotFoundException & /*e*/) {
 
 			}
 		}
@@ -145,7 +145,7 @@
 			MRef<LdapEntry*> entry = entries.at(0);
 			try {
 				return entry->getAttrValueString(attr);
-			} catch (LdapAttributeNotFoundException & e) {
+			} catch (LdapAttributeNotFoundException & /*e*/) {
 				throw;
 			}
 		}
@@ -164,7 +164,7 @@
 				if (vals.size() > 0) {
 					return vals.at(0);
 				}
-			} catch (LdapAttributeNotFoundException & e) {
+			} catch (LdapAttributeNotFoundException & /*e*/) {
 				throw;
 			}
 		}

Modified: trunk/libmnetutil/source/NetworkFunctions.cxx
===================================================================
--- trunk/libmnetutil/source/NetworkFunctions.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmnetutil/source/NetworkFunctions.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -703,7 +703,7 @@
 string NetworkFunctions::getInterfaceOf( string ipStr ) {
 	vector<MRef<NetworkInterface*> > ifaces;
 	vector<MRef<NetworkInterface*> >::iterator iter;
-	bool isIpv6 = ipStr.find(':');
+	bool isIpv6 = ipStr.find(':')!=string::npos;
 	
 	ifaces = NetworkFunctions::getInterfaces();
 	for( iter = ifaces.begin(); iter != ifaces.end(); iter++ ){

Modified: trunk/libmnetutil/source/SocketServer.cxx
===================================================================
--- trunk/libmnetutil/source/SocketServer.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmnetutil/source/SocketServer.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -198,9 +198,9 @@
 }
 
 #ifdef WIN32
-static int createTcpPipe( int fds[2] )
+static int createTcpPipe( uint32_t fds[2] )
 {
-	SOCKET sd;
+	uint32_t sd;
 	struct sockaddr_in sa;
 	socklen_t sz = sizeof(sa);
 	u_long nonBlocking = 1;
@@ -257,7 +257,7 @@
 #endif	// WIN32
 
 void SocketServer::createSignalPipe(){
-	int pipeFds[2] = {-1,-1};
+	uint32_t pipeFds[2] = {-1,-1};
 
 	if( fdSignal >= 0 ){
 		close( fdSignal );

Modified: trunk/libmsip/include/libmsip/SipDialog.h
===================================================================
--- trunk/libmsip/include/libmsip/SipDialog.h	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmsip/include/libmsip/SipDialog.h	2007-08-22 21:56:37 UTC (rev 3392)
@@ -36,10 +36,10 @@
 
 #include<libmsip/SipRequest.h>
 #include<libmsip/SipStack.h>
+#include<libmsip/SipAuthenticationDigest.h>
 
 class SipTransaction;
 class SipDialogConfig;
-class SipAuthenticationDigest;
 
 
 /**

Modified: trunk/libmsip/source/SipLayerTransaction.cxx
===================================================================
--- trunk/libmsip/source/SipLayerTransaction.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmsip/source/SipLayerTransaction.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -102,7 +102,7 @@
 
 void SipLayerTransaction::removeTransaction(string tid){
 	transactions[tid]->freeStateMachine();
-	int n = transactions.erase(tid);
+	int n = (int)transactions.erase(tid);
 	massert(n==1);
 }
 

Modified: trunk/libmsip/source/headers/SipHeaderCSeq.cxx
===================================================================
--- trunk/libmsip/source/headers/SipHeaderCSeq.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmsip/source/headers/SipHeaderCSeq.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -50,7 +50,7 @@
 const string sipHeaderValueCSeqTypeStr = "CSeq";
 
 SipHeaderValueCSeq::SipHeaderValueCSeq(const string &build_from):SipHeaderValue(SIP_HEADER_TYPE_CSEQ,sipHeaderValueCSeqTypeStr){
-	unsigned maxlen=build_from.size();
+	unsigned maxlen=(unsigned)build_from.size();
 	unsigned i=0;
 
 	while (i<maxlen && isWS(build_from[i]))

Modified: trunk/libmsip/source/headers/SipHeaderContentLength.cxx
===================================================================
--- trunk/libmsip/source/headers/SipHeaderContentLength.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmsip/source/headers/SipHeaderContentLength.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -54,7 +54,7 @@
 		: SipHeaderValue(SIP_HEADER_TYPE_CONTENTLENGTH,sipHeaderValueContentLengthTypeStr)
 {
 	unsigned i=0;
-	unsigned len = build_from.length();
+	unsigned len = (unsigned)build_from.length();
 	while (isWS(build_from[i]))
 		i++;
 	string num="";

Modified: trunk/libmsip/source/headers/SipHeaderRAck.cxx
===================================================================
--- trunk/libmsip/source/headers/SipHeaderRAck.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmsip/source/headers/SipHeaderRAck.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -51,7 +51,7 @@
 
 SipHeaderValueRAck::SipHeaderValueRAck(const string &build_from):SipHeaderValue(SIP_HEADER_TYPE_RACK,sipHeaderValueRAckTypeStr){
 	unsigned i=0;
-	unsigned maxi=build_from.size()-1;
+	unsigned maxi=(unsigned)build_from.size()-1;
 	while (i<=maxi && isWS(build_from[i]))
 		i++;
 	

Modified: trunk/libmsip/source/headers/SipHeaderRSeq.cxx
===================================================================
--- trunk/libmsip/source/headers/SipHeaderRSeq.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmsip/source/headers/SipHeaderRSeq.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -48,7 +48,7 @@
 		: SipHeaderValue(SIP_HEADER_TYPE_RSEQ,sipHeaderValueRSeqTypeStr)
 {
 	unsigned i=0;
-	unsigned len=build_from.size();
+	unsigned len=(unsigned)build_from.size();
 	while (isWS(build_from[i]))
 		i++;
 	string num="";
@@ -64,7 +64,7 @@
 		throw SipExceptionInvalidMessage("SipHeaderValueRSeq malformed");
 	}
 #ifdef _MSC_VER
-	seq=_atoi64(num.c_str());
+	seq=(uint32_t)_atoi64(num.c_str());
 #else
 	seq=atoll(num.c_str());
 #endif

Modified: trunk/libmsip/source/messages/SipRequest.cxx
===================================================================
--- trunk/libmsip/source/messages/SipRequest.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmsip/source/messages/SipRequest.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -253,10 +253,10 @@
 }
 
 void SipRequest::init(string &build_from){
-	int start = 0;
-	int pos;
-	int pos2;
-	int end = 0;
+	size_t start = 0;
+	size_t pos;
+	size_t pos2;
+	size_t end = 0;
 	//int length = build_from.length();
 	string requestLine;
 

Modified: trunk/libmsip/source/messages/SipResponse.cxx
===================================================================
--- trunk/libmsip/source/messages/SipResponse.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmsip/source/messages/SipResponse.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -86,9 +86,9 @@
 //TODO: This constructor needs rewriting (re-use from sipmessage)
 SipResponse::SipResponse(string &resp): SipMessage(resp)
 {
-	int len = resp.size();
+	size_t len = resp.size();
 
-	int i =0;
+	size_t i =0;
 
 	//If stream transport we should allow whitespace before the start
 	//of the message
@@ -101,7 +101,7 @@
 	}
 	i+=7;
 
-	int afterws=i;
+	size_t afterws=i;
 	while ( afterws<len && resp[afterws]!='\0' && (resp[afterws]==' ' || resp[afterws]=='\t'))
 		afterws++;
 	

Modified: trunk/libmstun/source/STUNAttributes.cxx
===================================================================
--- trunk/libmstun/source/STUNAttributes.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmstun/source/STUNAttributes.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -96,7 +96,7 @@
     ret = new STUNAttributeChangedAddress(length,&data[4]);
     break;
   case STUNAttribute::CHANGE_REQUEST:
-    ret = new STUNAttributeChangeRequest(length,&data[4]);
+    ret = new STUNAttributeChangeRequest(&data[4], length);
     break;
   case STUNAttribute::USERNAME:
     ret = new STUNAttributeUsername(length,&data[4]);

Modified: trunk/libmutil/include/libmutil/dbg.h
===================================================================
--- trunk/libmutil/include/libmutil/dbg.h	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmutil/include/libmutil/dbg.h	2007-08-22 21:56:37 UTC (rev 3392)
@@ -34,6 +34,7 @@
 #include<sstream>
 #include<set>
 
+#pragma warning (disable: 4251)
 
 /**
  * Normal operation:

Modified: trunk/libmutil/source/FileSystemUtils.cxx
===================================================================
--- trunk/libmutil/source/FileSystemUtils.cxx	2007-08-22 21:17:53 UTC (rev 3391)
+++ trunk/libmutil/source/FileSystemUtils.cxx	2007-08-22 21:56:37 UTC (rev 3392)
@@ -52,7 +52,7 @@
 	std::string dirComplete = dir + "\\*.*";
 	// start the finder -- on error _findfirsti64() will return -1, otherwise if no
 	// error it returns a handle greater than -1.
-	long h = _findfirsti64(dirComplete.c_str(), &data);
+	intptr_t h = _findfirsti64(dirComplete.c_str(), &data);
 	if(h >= 0) {
 		//FILELIST thisList;
 		// add empty FILELIST structure to the linked list argument



More information about the Minisip-devel mailing list