Bugs item #2835196, was opened at 2009-08-11 00:08
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2835196&group_id=976
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: compile or build problem
Group: portability problem
Status: Open
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Benbuck Nason (benbuck)
Assigned to: Daniel Stenberg (bagder)
Summary: Mixing bool with int in several places
Initial Comment:
In a few places in the curl library sources, bool types are mixed with integer types, which causes warnings with the compiler I am using (SNC for PSP). These are easy to fix, the changes are below.
Thanks,
Benbuck Nason
==== curl/lib/ftp.c#2 (text) ====
@@ -3537,7 +3537,7 @@
/* But only if a body transfer was requested. */
if(ftp->transfer == FTPTRANSFER_BODY) {
- result = ftp_nb_type(conn, 1, FTP_LIST_TYPE);
+ result = ftp_nb_type(conn, TRUE, FTP_LIST_TYPE);
if(result)
return result;
}
@@ -4101,7 +4101,7 @@
bool *dophase_done)
{
CURLcode result=CURLE_OK;
- bool connected=0;
+ bool connected=FALSE;
struct SessionHandle *data = conn->data;
struct ftp_conn *ftpc = &conn->proto.ftpc;
data->req.size = -1; /* make sure this is unknown at this point */
==== curl/lib/transfer.c#2 (text) ====
@@ -130,7 +130,9 @@
struct SessionHandle *data = conn->data;
size_t buffersize = (size_t)bytes;
int nread;
+#ifdef CURL_DOES_CONVERSIONS
bool sending_http_headers = FALSE;
+#endif
if(data->req.upload_chunky) {
/* if chunked Transfer-Encoding */
@@ -139,9 +141,11 @@
}
if((conn->protocol&PROT_HTTP) &&
(data->state.proto.http->sending == HTTPSEND_REQUEST)) {
+#ifdef CURL_DOES_CONVERSIONS
/* We're sending the HTTP request headers, not the data.
Remember that so we don't re-translate them into garbage. */
sending_http_headers = TRUE;
+#endif
}
/* this function returns a size_t, so we typecast to int to prevent warnings
==== curl/lib/url.c#2 (text) ====
@@ -3819,7 +3819,7 @@
if(data->set.use_netrc != CURL_NETRC_REQUIRED) {
/* We could use the one in the URL */
- conn->bits.user_passwd = 1; /* enable user+password */
+ conn->bits.user_passwd = TRUE; /* enable user+password */
if(*userpass != ':') {
/* the name is given, get user+password */
@@ -3984,7 +3984,7 @@
different host or similar. */
conn->bits.netrc = TRUE;
- conn->bits.user_passwd = 1; /* enable user+password */
+ conn->bits.user_passwd = TRUE; /* enable user+password */
}
}
}
----------------------------------------------------------------------
>Comment By: Daniel Stenberg (bagder)
Date: 2009-08-11 13:57
Message:
Thanks , these do indeed seem like accurate mistakes that should be fixed.
I'll apply your fixes as soon as I get the chance!
----------------------------------------------------------------------
Comment By: Benbuck Nason (benbuck)
Date: 2009-08-11 00:10
Message:
After posting this I realized I included some changes to transfer.c that
are due to a different problem (variable sending_http_headers set but not
used).
-Ben
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2835196&group_id=976
Received on 2009-08-11