fix compiler warning
This commit is contained in:
parent
2179ef9fa9
commit
a6fb6b70c7
18
lib/base64.c
18
lib/base64.c
@ -54,22 +54,28 @@ static const char table64[]=
|
|||||||
|
|
||||||
static void decodeQuantum(unsigned char *dest, const char *src)
|
static void decodeQuantum(unsigned char *dest, const char *src)
|
||||||
{
|
{
|
||||||
unsigned int x = 0;
|
unsigned long x = 0;
|
||||||
int i;
|
int i;
|
||||||
char *found;
|
char *found;
|
||||||
|
union {
|
||||||
|
unsigned long uns;
|
||||||
|
long sig;
|
||||||
|
} offset;
|
||||||
|
|
||||||
for(i = 0; i < 4; i++) {
|
for(i = 0; i < 4; i++) {
|
||||||
if((found = strchr(table64, src[i])) != NULL)
|
if((found = strchr(table64, src[i])) != NULL) {
|
||||||
x = (x << 6) + (unsigned int)(found - table64);
|
offset.sig = found - table64;
|
||||||
|
x = (x << 6) + offset.uns;
|
||||||
|
}
|
||||||
else if(src[i] == '=')
|
else if(src[i] == '=')
|
||||||
x = (x << 6);
|
x = (x << 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
dest[2] = (unsigned char)(x & 255);
|
dest[2] = (unsigned char)(x & 0xFFUL);
|
||||||
x >>= 8;
|
x >>= 8;
|
||||||
dest[1] = (unsigned char)(x & 255);
|
dest[1] = (unsigned char)(x & 0xFFUL);
|
||||||
x >>= 8;
|
x >>= 8;
|
||||||
dest[0] = (unsigned char)(x & 255);
|
dest[0] = (unsigned char)(x & 0xFFUL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -222,7 +222,7 @@ void *curl_dorealloc(void *ptr, size_t wantedsize,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if(ptr)
|
if(ptr)
|
||||||
mem = (struct memdebug *)((char *)ptr - offsetof(struct memdebug, mem));
|
mem = (void *)((char *)ptr - offsetof(struct memdebug, mem));
|
||||||
|
|
||||||
mem = (Curl_crealloc)(mem, size);
|
mem = (Curl_crealloc)(mem, size);
|
||||||
if(source)
|
if(source)
|
||||||
@ -243,7 +243,7 @@ void curl_dofree(void *ptr, int line, const char *source)
|
|||||||
|
|
||||||
assert(ptr != NULL);
|
assert(ptr != NULL);
|
||||||
|
|
||||||
mem = (struct memdebug *)((char *)ptr - offsetof(struct memdebug, mem));
|
mem = (void *)((char *)ptr - offsetof(struct memdebug, mem));
|
||||||
|
|
||||||
/* destroy */
|
/* destroy */
|
||||||
memset(mem->mem, 0x13, mem->size);
|
memset(mem->mem, 0x13, mem->size);
|
||||||
|
@ -911,7 +911,7 @@ static int dprintf_formatf(
|
|||||||
static const char strnil[] = "(nil)";
|
static const char strnil[] = "(nil)";
|
||||||
const char *point;
|
const char *point;
|
||||||
|
|
||||||
width -= sizeof(strnil) - 1;
|
width -= (long)(sizeof(strnil) - 1);
|
||||||
if(p->flags & FLAGS_LEFT)
|
if(p->flags & FLAGS_LEFT)
|
||||||
while(width-- > 0)
|
while(width-- > 0)
|
||||||
OUTCHAR(' ');
|
OUTCHAR(' ');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user