Fixed some minor mismatched types found by splint.

This commit is contained in:
Dan Fandrich 2007-08-26 05:53:26 +00:00
parent 327c0d6b1c
commit 523767660c
10 changed files with 46 additions and 42 deletions

View File

@ -82,13 +82,13 @@
/* The last #include file should be: */
#include "memdebug.h"
static char *unescape_word(struct SessionHandle *data, char *inp)
static char *unescape_word(struct SessionHandle *data, const char *inp)
{
char *newp;
char *dictp;
char *ptr;
int len;
unsigned char byte;
char byte;
int olen=0;
newp = curl_easy_unescape(data, inp, 0, &len);
@ -100,7 +100,7 @@ static char *unescape_word(struct SessionHandle *data, char *inp)
/* According to RFC2229 section 2.2, these letters need to be escaped with
\[letter] */
for(ptr = newp;
(byte = (unsigned char)*ptr) != 0;
(byte = *ptr) != 0;
ptr++) {
if ((byte <= 32) || (byte == 127) ||
(byte == '\'') || (byte == '\"') || (byte == '\\')) {

View File

@ -886,7 +886,8 @@ CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
} else {
#ifdef HAVE_ICONV
/* do the translation ourselves */
char *input_ptr, *output_ptr;
const char *input_ptr;
char *output_ptr;
size_t in_bytes, out_bytes, rc;
int error;
@ -907,7 +908,7 @@ CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
/* call iconv */
input_ptr = output_ptr = buffer;
in_bytes = out_bytes = length;
rc = iconv(data->utf8_cd, (const char**)&input_ptr, &in_bytes,
rc = iconv(data->utf8_cd, &input_ptr, &in_bytes,
&output_ptr, &out_bytes);
if ((rc == ICONV_ERROR) || (in_bytes != 0)) {
error = ERRNO;

View File

@ -59,7 +59,7 @@ char *curl_easy_escape(CURL *handle, const char *string, int inlength)
size_t alloc = (inlength?(size_t)inlength:strlen(string))+1;
char *ns;
char *testing_ptr = NULL;
unsigned char in;
char in;
size_t newlen = alloc;
int strindex=0;
size_t length;

View File

@ -200,7 +200,7 @@ create_hostcache_id(const char *server, int port)
}
struct hostcache_prune_data {
int cache_timeout;
long cache_timeout;
time_t now;
};
@ -232,7 +232,7 @@ hostcache_timestamp_remove(void *datap, void *hc)
* Prune the DNS cache. This assumes that a lock has already been taken.
*/
static void
hostcache_prune(struct curl_hash *hostcache, int cache_timeout, time_t now)
hostcache_prune(struct curl_hash *hostcache, long cache_timeout, time_t now)
{
struct hostcache_prune_data user;

View File

@ -1055,7 +1055,7 @@ CURLcode add_buffer(send_buffer *in, const void *inptr, size_t size)
* Pass headers WITH the colon.
*/
bool
Curl_compareheader(char *headerline, /* line to check */
Curl_compareheader(const char *headerline, /* line to check */
const char *header, /* header keyword _with_ colon */
const char *content) /* content string to find */
{
@ -1067,8 +1067,8 @@ Curl_compareheader(char *headerline, /* line to check */
size_t hlen = strlen(header);
size_t clen;
size_t len;
char *start;
char *end;
const char *start;
const char *end;
if(!strnequal(headerline, header, hlen))
return FALSE; /* doesn't start with header */
@ -1119,7 +1119,7 @@ Curl_compareheader(char *headerline, /* line to check */
CURLcode Curl_proxyCONNECT(struct connectdata *conn,
int sockindex,
char *hostname,
int remote_port)
unsigned short remote_port)
{
int subversion=0;
struct SessionHandle *data=conn->data;

View File

@ -24,14 +24,14 @@
* $Id$
***************************************************************************/
#ifndef CURL_DISABLE_HTTP
bool Curl_compareheader(char *headerline, /* line to check */
bool Curl_compareheader(const char *headerline, /* line to check */
const char *header, /* header keyword _with_ colon */
const char *content); /* content string to find */
/* ftp can use this as well */
CURLcode Curl_proxyCONNECT(struct connectdata *conn,
int tunnelsocket,
char *hostname, int remote_port);
char *hostname, unsigned short remote_port);
/* protocol-specific functions set up to be called by the main engine */
CURLcode Curl_http(struct connectdata *conn, bool *done);

View File

@ -690,7 +690,7 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
return CURLM_BAD_EASY_HANDLE; /* twasn't found */
}
bool Curl_multi_canPipeline(struct Curl_multi* multi)
bool Curl_multi_canPipeline(const struct Curl_multi* multi)
{
return multi->pipelining_enabled;
}

View File

@ -30,7 +30,7 @@ void Curl_expire(struct SessionHandle *data, long milli);
void Curl_multi_rmeasy(void *multi, CURL *data);
bool Curl_multi_canPipeline(struct Curl_multi* multi);
bool Curl_multi_canPipeline(const struct Curl_multi* multi);
void Curl_multi_handlePipeBreak(struct SessionHandle *data);
/* the write bits start at bit 16 for the *getsock() bitmap */

View File

@ -158,8 +158,8 @@ static bool ConnectionExists(struct SessionHandle *data,
struct connectdata **usethis);
static long ConnectionStore(struct SessionHandle *data,
struct connectdata *conn);
static bool IsPipeliningPossible(struct SessionHandle *handle);
static bool IsPipeliningEnabled(struct SessionHandle *handle);
static bool IsPipeliningPossible(const struct SessionHandle *handle);
static bool IsPipeliningEnabled(const struct SessionHandle *handle);
static void conn_free(struct connectdata *conn);
static void signalPipeClose(struct curl_llist *pipe);
@ -292,7 +292,7 @@ CURLcode Curl_close(struct SessionHandle *data)
if(data->state.connc && data->state.connc->type == CONNCACHE_MULTI) {
struct conncache *c = data->state.connc;
int i;
long i;
struct curl_llist *pipe;
struct curl_llist_element *curr;
struct connectdata *connptr;
@ -536,7 +536,7 @@ CURLcode Curl_ch_connc(struct SessionHandle *data,
void Curl_rm_connc(struct conncache *c)
{
if(c->connects) {
int i;
long i;
for(i = 0; i < c->num; ++i)
conn_free(c->connects[i]);
@ -2010,7 +2010,7 @@ static bool SocketIsDead(curl_socket_t sock)
return ret_val;
}
static bool IsPipeliningPossible(struct SessionHandle *handle)
static bool IsPipeliningPossible(const struct SessionHandle *handle)
{
if (handle->multi && Curl_multi_canPipeline(handle->multi) &&
(handle->set.httpreq == HTTPREQ_GET ||
@ -2021,7 +2021,7 @@ static bool IsPipeliningPossible(struct SessionHandle *handle)
return FALSE;
}
static bool IsPipeliningEnabled(struct SessionHandle *handle)
static bool IsPipeliningEnabled(const struct SessionHandle *handle)
{
if (handle->multi && Curl_multi_canPipeline(handle->multi))
return TRUE;
@ -2430,24 +2430,27 @@ static CURLcode ConnectPlease(struct SessionHandle *data,
conn->dns_entry = hostaddr;
conn->ip_addr = addr;
Curl_store_ip_addr(conn);
result = Curl_store_ip_addr(conn);
switch(data->set.proxytype) {
case CURLPROXY_SOCKS5:
result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, conn->host.name,
conn->remote_port, FIRSTSOCKET, conn);
break;
case CURLPROXY_HTTP:
/* do nothing here. handled later. */
break;
case CURLPROXY_SOCKS4:
result = Curl_SOCKS4(conn->proxyuser, conn->host.name, conn->remote_port,
FIRSTSOCKET, conn);
break;
default:
failf(data, "unknown proxytype option given");
result = CURLE_COULDNT_CONNECT;
break;
if(CURLE_OK == result) {
switch(data->set.proxytype) {
case CURLPROXY_SOCKS5:
result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, conn->host.name,
conn->remote_port, FIRSTSOCKET, conn);
break;
case CURLPROXY_HTTP:
/* do nothing here. handled later. */
break;
case CURLPROXY_SOCKS4:
result = Curl_SOCKS4(conn->proxyuser, conn->host.name, conn->remote_port,
FIRSTSOCKET, conn);
break;
default:
failf(data, "unknown proxytype option given");
result = CURLE_COULDNT_CONNECT;
break;
}
}
}
if(result)
@ -2867,7 +2870,7 @@ static CURLcode setup_range(struct SessionHandle *data)
req->resume_from = data->set.set_resume_from;
if (req->resume_from || data->set.str[STRING_SET_RANGE]) {
if (req->rangestringalloc == TRUE)
if (req->rangestringalloc)
free(req->range);
if(req->resume_from)

View File

@ -132,7 +132,7 @@
of need. */
#define HEADERSIZE 256
#define CURLEASY_MAGIC_NUMBER 0xc0dedbad
#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
/* Just a convenience macro to get the larger value out of two given.
We prefix with CURL to prevent name collisions. */
@ -1354,7 +1354,7 @@ struct UserDefined {
curl_proxytype proxytype; /* what kind of proxy that is in use */
int dns_cache_timeout; /* DNS cache timeout */
long dns_cache_timeout; /* DNS cache timeout */
long buffer_size; /* size of receive buffer to use */
void *private_data; /* Private data */