cURL / Mailing Lists / curl-library / Single Mail

curl-library

Minor patch to remove a couple of msvc compiler warnings

From: Yang Tse <yangsita_at_gmail.com>
Date: Mon, 14 Nov 2005 04:47:07 +0100

The first patch adds an explicit cast when calling function 'sendto' in tftp.c

diff -urp c:\f\curl-old/curl/lib/tftp.c c:\f\curl-new/curl/lib/tftp.c
--- c:\f\curl-old/curl/lib/tftp.c 2005-11-13 14:20:37.000000000 +0100
+++ c:\f\curl-new/curl/lib/tftp.c 2005-11-14 03:43:28.819140800 +0100
@@ -278,7 +278,8 @@ static void tftp_send_first(tftp_state_d
     sprintf((char *)state->spacket.u.request.data, "%s%c%s%c",
             filename, '\0', mode, '\0');
     sbytes = 4 + strlen(filename) + strlen(mode);
- sbytes = sendto(state->sockfd, &state->spacket, sbytes, 0,
+ sbytes = sendto(state->sockfd, (char *)&state->spacket,
+ sbytes, 0,
                     state->conn->ip_addr->ai_addr,
                     state->conn->ip_addr->ai_addrlen);
     if(sbytes < 0) {
@@ -345,7 +346,8 @@ static void tftp_rx(tftp_state_data_t *s
     state->retries = 0;
     state->spacket.event = htons(TFTP_EVENT_ACK);
     state->spacket.u.ack.block = htons(state->block);
- sbytes = sendto(state->sockfd, &state->spacket, 4, MSG_NOSIGNAL,
+ sbytes = sendto(state->sockfd, (char *)&state->spacket,
+ 4, MSG_NOSIGNAL,
                     (struct sockaddr *)&state->remote_addr,
                     state->remote_addrlen);
     if(sbytes < 0) {
@@ -371,7 +373,7 @@ static void tftp_rx(tftp_state_data_t *s
       state->state = TFTP_STATE_FIN;
     } else {
       /* Resend the previous ACK */
- sbytes = sendto(state->sockfd, &state->spacket,
+ sbytes = sendto(state->sockfd, (char *)&state->spacket,
                       4, MSG_NOSIGNAL,
                       (struct sockaddr *)&state->remote_addr,
                       state->remote_addrlen);
@@ -437,7 +439,7 @@ static void tftp_tx(tftp_state_data_t *s
       return;
     }
     Curl_fillreadbuffer(state->conn, 512, &state->sbytes);
- sbytes = sendto(state->sockfd, &state->spacket,
+ sbytes = sendto(state->sockfd, (char *)&state->spacket,
                     4+state->sbytes, MSG_NOSIGNAL,
                     (struct sockaddr *)&state->remote_addr,
                     state->remote_addrlen);
@@ -458,7 +460,7 @@ static void tftp_tx(tftp_state_data_t *s
       state->state = TFTP_STATE_FIN;
     } else {
       /* Re-send the data packet */
- sbytes = sendto(state->sockfd, &state->spacket,
+ sbytes = sendto(state->sockfd, (char *)&state->spacket,
                       4+state->sbytes, MSG_NOSIGNAL,
                       (struct sockaddr *)&state->remote_addr,
                       state->remote_addrlen);

The second patch addresses the fact that msvc7+ has deprecated the
'DESCRIPTION' section in module-definition files. this section is not
mandatory for msvc60 so it could be completely removed from
libcurl.def. The patch just comments out the offending line.

diff -urp c:\f\curl-old/curl/lib/libcurl.def c:\f\curl-new/curl/lib/libcurl.def
--- c:\f\curl-old/curl/lib/libcurl.def 2005-08-16 22:12:58.000000000 +0200
+++ c:\f\curl-new/curl/lib/libcurl.def 2005-11-14 04:18:56.501780800 +0100
@@ -4,7 +4,7 @@

 LIBRARY LIBCURL

-DESCRIPTION 'curl libcurl - http://curl.haxx.se'
+; DESCRIPTION 'curl libcurl - http://curl.haxx.se'

 EXPORTS
         curl_easy_cleanup @ 1 ;
Received on 2005-11-14