Removed some more compiler warnings from Windows compile (GCC 4.4).

Added -Wextra to the Windows compile.
Added new define in libbitdht for snprintf and fprintf to proper handling of "%ll" under Windows.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4951 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-02-17 10:03:38 +00:00
parent 2d2b7230d1
commit 970d88200d
35 changed files with 170 additions and 125 deletions

View file

@ -95,7 +95,7 @@ int tou_init(void **in_udpsubrecvs, int *type, int number)
}
noUdpSR = number;
int i;
uint32_t i;
for(i = 0; i < noUdpSR; i++)
{
udpSR[i] = usrArray[i];
@ -110,7 +110,7 @@ int tou_init(void **in_udpsubrecvs, int *type, int number)
/* open - allocates a sockfd, and checks that the type is okay */
int tou_socket(int recvIdx, int type, int /*protocol*/)
int tou_socket(uint32_t recvIdx, uint32_t type, int /*protocol*/)
{
if (!tou_inited)
{

View file

@ -104,7 +104,7 @@ int tou_init(void **udpSubRecvs, int *udpTypes, int nUdps);
*/
/* creation/connections */
int tou_socket(int domain, int type, int protocol);
int tou_socket(uint32_t domain, uint32_t type, int protocol);
int tou_bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen); /* null op now */
int tou_listen(int sockfd, int backlog); /* null op now */
int tou_connect(int sockfd, const struct sockaddr *serv_addr,

View file

@ -41,9 +41,9 @@ static const int STUN_TTL = 64;
//#define DEBUG_UDP_STUNNER 1
const int32_t TOU_STUN_MAX_FAIL_COUNT = 3; /* 3 tries (could be higher?) */
const uint32_t TOU_STUN_MAX_FAIL_COUNT = 3; /* 3 tries (could be higher?) */
const int32_t TOU_STUN_MAX_SEND_RATE = 5; /* every 5 seconds */
const int32_t TOU_STUN_MAX_RECV_RATE = 25; /* every 25 seconds */
const uint32_t TOU_STUN_MAX_RECV_RATE = 25; /* every 25 seconds */
// TIMEOUT is now tied to STUN RATE ... const int32_t TOU_STUN_ADDR_MAX_AGE = 120; /* 2 minutes */
const int32_t TOU_STUN_DEFAULT_TARGET_RATE = 15; /* 20 secs is minimum to keep a NAT UDP port open */
@ -384,7 +384,7 @@ bool UdpStunner::externalAddr(struct sockaddr_in &external, uint8_t &stable)
/* address timeout
* no timeout if in exclusive mode
*/
if ((time(NULL) - eaddrTime > (mTargetStunPeriod * 2)) && (!mExclusiveMode))
if ((time(NULL) - eaddrTime > (long) (mTargetStunPeriod * 2)) && (!mExclusiveMode))
{
std::cerr << "UdpStunner::externalAddr() eaddr expired";
std::cerr << std::endl;
@ -839,7 +839,7 @@ bool UdpStunner::attemptStun()
{
RsStackMutex stack(stunMtx); /********** LOCK MUTEX *********/
int i;
size_t i;
for(i = 0; ((i < mStunList.size()) && (mStunList.size() > 0) && (!found)); i++)
{
/* extract entry */
@ -1053,7 +1053,7 @@ bool UdpStunner::locked_checkExternalAddress()
#else
(isExternalNet(&(it->eaddr.sin_addr))) &&
#endif
(it->failCount == 0) && (age < (mTargetStunPeriod * 2)))
(it->failCount == 0) && (age < (long) (mTargetStunPeriod * 2)))
{
if (!found1)
{