1
0
mirror of https://github.com/moparisthebest/curl synced 2024-10-31 15:45:12 -04:00

variable type cleanup to fix picky compiler warnings

This commit is contained in:
Daniel Stenberg 2004-07-01 07:43:20 +00:00
parent fcfd4bef2d
commit f05d47ddd6
3 changed files with 18 additions and 20 deletions

View File

@ -2662,9 +2662,8 @@ CURLcode ftp_regular_transfer(struct connectdata *conn)
/* we skip empty path components, like "x//y" since the FTP command CWD /* we skip empty path components, like "x//y" since the FTP command CWD
requires a parameter and a non-existant parameter a) doesn't work on requires a parameter and a non-existant parameter a) doesn't work on
many servers and b) has no effect on the others. */ many servers and b) has no effect on the others. */
ftp->dirs[ftp->dirdepth] = curl_unescape(cur_pos - absolute_dir, int len = (int)(slash_pos - cur_pos + absolute_dir);
slash_pos - cur_pos + ftp->dirs[ftp->dirdepth] = curl_unescape(cur_pos - absolute_dir, len);
absolute_dir);
if (!ftp->dirs[ftp->dirdepth]) { /* run out of memory ... */ if (!ftp->dirs[ftp->dirdepth]) { /* run out of memory ... */
failf(data, "no memory"); failf(data, "no memory");

View File

@ -151,11 +151,11 @@ void idn_free (void *ptr); /* prototype from idn-free.h, not provided by
#include "memdebug.h" #include "memdebug.h"
/* Local static prototypes */ /* Local static prototypes */
static int ConnectionKillOne(struct SessionHandle *data); static long ConnectionKillOne(struct SessionHandle *data);
static bool ConnectionExists(struct SessionHandle *data, static bool ConnectionExists(struct SessionHandle *data,
struct connectdata *needle, struct connectdata *needle,
struct connectdata **usethis); struct connectdata **usethis);
static unsigned int ConnectionStore(struct SessionHandle *data, static long ConnectionStore(struct SessionHandle *data,
struct connectdata *conn); struct connectdata *conn);
static bool safe_strequal(char* str1, char* str2); static bool safe_strequal(char* str1, char* str2);
@ -411,17 +411,16 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
{ {
long newconnects= va_arg(param, long); long newconnects= va_arg(param, long);
struct connectdata **newptr; struct connectdata **newptr;
long i;
if(newconnects < data->state.numconnects) { if(newconnects < data->state.numconnects) {
/* Since this number is *decreased* from the existing number, we must /* Since this number is *decreased* from the existing number, we must
close the possibly open connections that live on the indexes that close the possibly open connections that live on the indexes that
are being removed! */ are being removed! */
int i;
for(i=newconnects; i< data->state.numconnects; i++) for(i=newconnects; i< data->state.numconnects; i++)
Curl_disconnect(data->state.connects[i]); Curl_disconnect(data->state.connects[i]);
} }
if(newconnects) { if(newconnects) {
int i;
newptr= (struct connectdata **) newptr= (struct connectdata **)
realloc(data->state.connects, realloc(data->state.connects,
sizeof(struct connectdata *) * newconnects); sizeof(struct connectdata *) * newconnects);
@ -577,7 +576,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
* This is the value to compare with the remote document with the * This is the value to compare with the remote document with the
* method set with CURLOPT_TIMECONDITION * method set with CURLOPT_TIMECONDITION
*/ */
data->set.timevalue = va_arg(param, long); data->set.timevalue = (time_t)va_arg(param, long);
break; break;
case CURLOPT_SSLVERSION: case CURLOPT_SSLVERSION:
/* /*
@ -1633,14 +1632,14 @@ ConnectionExists(struct SessionHandle *data,
* should take the previously set policy into account when deciding which * should take the previously set policy into account when deciding which
* of the connections to kill. * of the connections to kill.
*/ */
static int static long
ConnectionKillOne(struct SessionHandle *data) ConnectionKillOne(struct SessionHandle *data)
{ {
long i; long i;
struct connectdata *conn; struct connectdata *conn;
int highscore=-1; long highscore=-1;
int connindex=-1; long connindex=-1;
int score; long score;
struct timeval now; struct timeval now;
now = Curl_tvnow(); now = Curl_tvnow();
@ -1697,7 +1696,7 @@ ConnectionKillOne(struct SessionHandle *data)
* The given connection should be unique. That must've been checked prior to * The given connection should be unique. That must've been checked prior to
* this call. * this call.
*/ */
static unsigned int static long
ConnectionStore(struct SessionHandle *data, ConnectionStore(struct SessionHandle *data,
struct connectdata *conn) struct connectdata *conn)
{ {
@ -1787,8 +1786,8 @@ static int handleSock5Proxy(const char *proxy_name,
/* Needs user name and password */ /* Needs user name and password */
int userlen, pwlen, len; int userlen, pwlen, len;
userlen = strlen(proxy_name); userlen = (int)strlen(proxy_name);
pwlen = proxy_password?strlen(proxy_password):0; pwlen = proxy_password?(int)strlen(proxy_password):0;
/* username/password request looks like /* username/password request looks like
* +----+------+----------+------+----------+ * +----+------+----------+------+----------+
@ -2108,7 +2107,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
CURLcode result=CURLE_OK; CURLcode result=CURLE_OK;
struct connectdata *conn; struct connectdata *conn;
struct connectdata *conn_temp; struct connectdata *conn_temp;
int urllen; size_t urllen;
struct Curl_dns_entry *hostaddr; struct Curl_dns_entry *hostaddr;
#ifdef HAVE_ALARM #ifdef HAVE_ALARM
unsigned int prev_alarm=0; unsigned int prev_alarm=0;
@ -2407,7 +2406,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
nope=no_proxy?strtok_r(no_proxy, ", ", &no_proxy_tok_buf):NULL; nope=no_proxy?strtok_r(no_proxy, ", ", &no_proxy_tok_buf):NULL;
while(nope) { while(nope) {
unsigned int namelen; size_t namelen;
char *endptr = strchr(conn->host.name, ':'); char *endptr = strchr(conn->host.name, ':');
if(endptr) if(endptr)
namelen=endptr-conn->host.name; namelen=endptr-conn->host.name;
@ -3290,7 +3289,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
failf(data, "Previous alarm fired off!"); failf(data, "Previous alarm fired off!");
} }
else else
alarm(alarm_set); alarm((unsigned int)alarm_set);
} }
else else
alarm(0); /* just shut it off */ alarm(0); /* just shut it off */

View File

@ -876,7 +876,7 @@ struct UserDefined {
struct curl_slist *http200aliases; /* linked list of aliases for http200 */ struct curl_slist *http200aliases; /* linked list of aliases for http200 */
int ip_version; long ip_version;
curl_off_t max_filesize; /* Maximum file size to download */ curl_off_t max_filesize; /* Maximum file size to download */