Many Visual C++ compile warnings and errors fixed.

This commit is contained in:
Jan Vidar Krey
2011-01-02 02:39:25 +01:00
parent adb6641a17
commit 9b57279628
20 changed files with 163 additions and 115 deletions

View File

@@ -600,7 +600,7 @@ int adc_msg_has_named_argument(struct adc_message* cmd, const char prefix_[2])
while (start)
{
count++;
if ((&start[0] - &cmd->cache[0]) < 1+cmd->length)
if ((size_t) (&start[0] - &cmd->cache[0]) < 1+cmd->length)
start = memmem(&start[1], (&cmd->cache[cmd->length] - &start[0]), prefix, 3);
else
start = NULL;
@@ -881,8 +881,8 @@ char* adc_msg_unescape(const char* string)
char* adc_msg_escape(const char* string)
{
char* str = hub_malloc(adc_msg_escape_length(string)+1);
int n = 0;
int i = 0;
size_t n = 0;
size_t i = 0;
for (i = 0; i < strlen(string); i++)
{
switch (string[i]) {

View File

@@ -119,6 +119,8 @@ void sid_pool_destroy(struct sid_pool* pool)
sid_t sid_alloc(struct sid_pool* pool, struct hub_user* user)
{
sid_t n;
if (pool->count >= (pool->max - pool->min))
{
#ifdef DEBUG_SID
@@ -127,7 +129,8 @@ sid_t sid_alloc(struct sid_pool* pool, struct hub_user* user)
return 0;
}
sid_t n = (++pool->count);
n = ++pool->count;
for (; (pool->map[n % pool->max]); n++) ;
#ifdef DEBUG_SID