Browse Source

Changed some types from int to size_t/unsigned int.

release/0.19
JustinAJ 11 years ago
parent
commit
db5330e749
  1. 9
      Jupiter/Plugin.cpp
  2. 12
      Jupiter/Socket.cpp
  3. 10
      Jupiter/Socket.h
  4. BIN
      Release/Jupiter.lib

9
Jupiter/Plugin.cpp

@ -35,7 +35,14 @@ Jupiter::ArrayList<dlib> *libList = &_libList;
Jupiter::Plugin::~Plugin()
{
for (int i = _plugins.size(); i >= 0; i--) if (_plugins.get(i) == this) _plugins.remove(i);
for (size_t i = 0; i != _plugins.size(); i++)
{
if (_plugins.get(i) == this)
{
_plugins.remove(i);
break;
}
}
}
struct dlib

12
Jupiter/Socket.cpp

@ -251,10 +251,10 @@ void Jupiter::Socket::freeAddrInfo(addrinfo *info) // static
freeaddrinfo(info);
}
addrinfo *Jupiter::Socket::getAddrInfo(addrinfo *addr, int result) // static
addrinfo *Jupiter::Socket::getAddrInfo(addrinfo *addr, unsigned int result) // static
{
addrinfo *ptr = addr;
for (int i = 0; i < result && ptr != nullptr; i++) ptr = ptr->ai_next;
for (unsigned int i = 0; i != result && ptr != nullptr; i++) ptr = ptr->ai_next;
return ptr;
}
@ -265,14 +265,14 @@ char *Jupiter::Socket::resolveAddress(const addrinfo *addr) // static
return resolved;
}
char *Jupiter::Socket::resolveAddress(addrinfo *addr, int result) // static
char *Jupiter::Socket::resolveAddress(addrinfo *addr, unsigned int result) // static
{
addrinfo *ptr = Jupiter::Socket::getAddrInfo(addr, result);
if (ptr == nullptr) return nullptr;
return Jupiter::Socket::resolveAddress(ptr);
}
char *Jupiter::Socket::resolveAddress(const char *hostname, int result) // static
char *Jupiter::Socket::resolveAddress(const char *hostname, unsigned int result) // static
{
addrinfo *info = Jupiter::Socket::getAddrInfo(hostname, 0);
if (info == nullptr) return nullptr;
@ -286,14 +286,14 @@ char *Jupiter::Socket::resolveHostname(addrinfo *addr) // static
return resolved;
}
char *Jupiter::Socket::resolveHostname(addrinfo *addr, int result) // static
char *Jupiter::Socket::resolveHostname(addrinfo *addr, unsigned int result) // static
{
addrinfo *ptr = Jupiter::Socket::getAddrInfo(addr, result);
if (ptr == nullptr) return nullptr;
return Jupiter::Socket::resolveHostname(ptr);
}
char *Jupiter::Socket::resolveHostname(const char *hostname, int result) // static
char *Jupiter::Socket::resolveHostname(const char *hostname, unsigned int result) // static
{
addrinfo *info = Jupiter::Socket::getAddrInfo(hostname, 0);
if (info == nullptr) return nullptr;

10
Jupiter/Socket.h

@ -109,7 +109,7 @@ namespace Jupiter
* @param N Position of the addrinfo in the list to return.
* @return N'th addrinfo pointed to by addr.
*/
static addrinfo *getAddrInfo(addrinfo *addr, int N);
static addrinfo *getAddrInfo(addrinfo *addr, unsigned int N);
/**
* @brief Returns the text representation of an addrinfo's stored address.
@ -126,7 +126,7 @@ namespace Jupiter
* @param result Which result to return.
* @return String containing the text representation of the stored address on success, nullptr otherwise.
*/
static char *resolveAddress(addrinfo *addr, int result);
static char *resolveAddress(addrinfo *addr, unsigned int result);
/**
* @brief Resolves a hostname to an IP address.
@ -135,7 +135,7 @@ namespace Jupiter
* @param result Which resolution result to return.
* @return String containing the text representation of the resolved address on success, nullptr otherwise.
*/
static char *resolveAddress(const char *hostname, int result);
static char *resolveAddress(const char *hostname, unsigned int result);
/**
* @brief Resolves an address to a hostname. (Reverse DNS)
@ -152,7 +152,7 @@ namespace Jupiter
* @param result Which result to return.
* @return String containing the hostname of the stored address on success, nullptr otherwise.
*/
static char *resolveHostname(addrinfo *addr, int result);
static char *resolveHostname(addrinfo *addr, unsigned int result);
/**
* @brief Resolves an address to a hostname. (Reverse DNS)
@ -161,7 +161,7 @@ namespace Jupiter
* @param result Which resolution result to return.
* @return String containing the hostname of the resolved address on success, nullptr otherwise.
*/
static char *resolveHostname(const char *hostname, int result);
static char *resolveHostname(const char *hostname, unsigned int result);
/**
* @brief Interface to provide simple connection establishing.

BIN
Release/Jupiter.lib

Binary file not shown.
Loading…
Cancel
Save