mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Fix K&R incompatibilities reported by `gcc -Wtraditional'.
This commit is contained in:
parent
ce381136b6
commit
0967c21094
@ -1,3 +1,38 @@
|
||||
2005-05-03 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* url.c (url_parse): Rename label `error' to avoid conflict with
|
||||
identifier.
|
||||
|
||||
* retr.c (fd_read_body): Rename label `out' to avoid conflict with
|
||||
identifier.
|
||||
(fd_read_hunk): Use explicit double constant.
|
||||
(retrieve_from_file): Don't use string concatenation.
|
||||
(sleep_between_retrievals): Make sure xsleep is called with a
|
||||
`double' argument.
|
||||
(no_proxy_match): Define as static, like it is declared.
|
||||
|
||||
* progress.c (bar_create): Use 0.0 instead of 0 because K&R
|
||||
compilers can't automatically promote it.
|
||||
|
||||
* http-ntlm.c (ntlm_output): Replace \xHH sequences with \OOO for
|
||||
the sake of old compilers.
|
||||
|
||||
* ftp.c (ftp_loop_internal): Don't use string concatenation.
|
||||
|
||||
* http.c (request_send): Use explicit double constants when
|
||||
calling fd_read and fd_write.
|
||||
(post_file): Ditto.
|
||||
(gethttp): Ditto.
|
||||
(skip_short_body): Ditto.
|
||||
|
||||
* ftp-basic.c: When calling fd_write, specify the last argument as
|
||||
a `double' constant for the sake of K&R compilers which don't see
|
||||
the prototype and therefore can't promote it to double
|
||||
automatically.
|
||||
|
||||
* cookies.c (cookie_jar_load): Rename abort label to abort_cookie
|
||||
to avoid name conflict in K&R compilers.
|
||||
|
||||
2005-04-29 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* ptimer.c (posix_init): Since we allow _POSIX_MONOTONIC_CLOCK==0,
|
||||
|
@ -1404,7 +1404,7 @@ cookie_jar_load (struct cookie_jar *jar, const char *file)
|
||||
else
|
||||
{
|
||||
if (expiry < cookies_now)
|
||||
goto abort; /* ignore stale cookie. */
|
||||
goto abort_cookie; /* ignore stale cookie. */
|
||||
cookie->expiry_time = expiry;
|
||||
cookie->permanent = 1;
|
||||
}
|
||||
@ -1414,7 +1414,7 @@ cookie_jar_load (struct cookie_jar *jar, const char *file)
|
||||
next:
|
||||
continue;
|
||||
|
||||
abort:
|
||||
abort_cookie:
|
||||
delete_cookie (cookie);
|
||||
}
|
||||
fclose (fp);
|
||||
|
@ -132,7 +132,7 @@ ftp_login (int csock, const char *acc, const char *pass)
|
||||
xfree (respline);
|
||||
/* Send USER username. */
|
||||
request = ftp_request ("USER", acc);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -199,7 +199,7 @@ ftp_login (int csock, const char *acc, const char *pass)
|
||||
xfree (respline);
|
||||
/* Send PASS password. */
|
||||
request = ftp_request ("PASS", pass);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -274,7 +274,7 @@ ftp_port (int csock, int *local_sock)
|
||||
|
||||
/* Send PORT request. */
|
||||
request = ftp_request ("PORT", bytes);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -368,7 +368,7 @@ ftp_lprt (int csock, int *local_sock)
|
||||
|
||||
/* Send PORT request. */
|
||||
request = ftp_request ("LPRT", bytes);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -449,7 +449,7 @@ ftp_eprt (int csock, int *local_sock)
|
||||
|
||||
/* Send PORT request. */
|
||||
request = ftp_request ("EPRT", bytes);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -495,7 +495,7 @@ ftp_pasv (int csock, ip_address *addr, int *port)
|
||||
/* Form the request. */
|
||||
request = ftp_request ("PASV", NULL);
|
||||
/* And send it. */
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -564,7 +564,7 @@ ftp_lpsv (int csock, ip_address *addr, int *port)
|
||||
request = ftp_request ("LPSV", NULL);
|
||||
|
||||
/* And send it. */
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -729,7 +729,7 @@ ftp_epsv (int csock, ip_address *ip, int *port)
|
||||
request = ftp_request ("EPSV", (ip->type == IPV4_ADDRESS ? "1" : "2"));
|
||||
|
||||
/* And send it. */
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -829,7 +829,7 @@ ftp_type (int csock, int type)
|
||||
stype[1] = 0;
|
||||
/* Send TYPE request. */
|
||||
request = ftp_request ("TYPE", stype);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -864,7 +864,7 @@ ftp_cwd (int csock, const char *dir)
|
||||
|
||||
/* Send CWD request. */
|
||||
request = ftp_request ("CWD", dir);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -902,7 +902,7 @@ ftp_rest (int csock, wgint offset)
|
||||
uerr_t err;
|
||||
|
||||
request = ftp_request ("REST", number_to_static_string (offset));
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -936,7 +936,7 @@ ftp_retr (int csock, const char *file)
|
||||
|
||||
/* Send RETR request. */
|
||||
request = ftp_request ("RETR", file);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -976,7 +976,7 @@ ftp_list (int csock, const char *file)
|
||||
|
||||
/* Send LIST request. */
|
||||
request = ftp_request ("LIST", file);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -1015,7 +1015,7 @@ ftp_syst (int csock, enum stype *server_type)
|
||||
|
||||
/* Send SYST request. */
|
||||
request = ftp_request ("SYST", NULL);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -1072,7 +1072,7 @@ ftp_pwd (int csock, char **pwd)
|
||||
|
||||
/* Send PWD request. */
|
||||
request = ftp_request ("PWD", NULL);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
@ -1118,7 +1118,7 @@ ftp_size (int csock, const char *file, wgint *size)
|
||||
|
||||
/* Send PWD request. */
|
||||
request = ftp_request ("SIZE", file);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1);
|
||||
nwritten = fd_write (csock, request, strlen (request), -1.0);
|
||||
if (nwritten < 0)
|
||||
{
|
||||
xfree (request);
|
||||
|
@ -1286,8 +1286,8 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con)
|
||||
|
||||
if (opt.delete_after)
|
||||
{
|
||||
DEBUGP (("Removing file due to --delete-after in"
|
||||
" ftp_loop_internal():\n"));
|
||||
DEBUGP (("\
|
||||
Removing file due to --delete-after in ftp_loop_internal():\n"));
|
||||
logprintf (LOG_VERBOSE, _("Removing %s.\n"), locf);
|
||||
if (unlink (locf))
|
||||
logprintf (LOG_NOTQUIET, "unlink: %s\n", strerror (errno));
|
||||
|
@ -366,7 +366,7 @@ ntlm_output (struct ntlmdata *ntlm, const char *user, const char *passwd,
|
||||
*/
|
||||
|
||||
snprintf(ntlmbuf, sizeof(ntlmbuf),
|
||||
"NTLMSSP%c\x01%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%s%s",
|
||||
"NTLMSSP%c\001%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%s%s",
|
||||
0, /* trailing zero */
|
||||
0,0,0, /* part of type-1 long */
|
||||
|
||||
@ -485,7 +485,7 @@ ntlm_output (struct ntlmdata *ntlm, const char *user, const char *passwd,
|
||||
"%c%c" 2 zeroes */
|
||||
|
||||
size = snprintf(ntlmbuf, sizeof(ntlmbuf),
|
||||
"NTLMSSP%c\x03%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\xff\xff%c%c\x01\x82%c%c",
|
||||
"NTLMSSP%c\003%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\377\377%c%c\001\202%c%c",
|
||||
0, /* zero termination */
|
||||
0,0,0, /* type-3 long, the 24 upper bits */
|
||||
|
||||
|
@ -368,7 +368,7 @@ request_send (const struct request *req, int fd)
|
||||
|
||||
/* Send the request to the server. */
|
||||
|
||||
write_error = fd_write (fd, request_string, size - 1, -1);
|
||||
write_error = fd_write (fd, request_string, size - 1, -1.0);
|
||||
if (write_error < 0)
|
||||
logprintf (LOG_VERBOSE, _("Failed writing HTTP request: %s.\n"),
|
||||
strerror (errno));
|
||||
@ -412,7 +412,7 @@ post_file (int sock, const char *file_name, wgint promised_size)
|
||||
if (length == 0)
|
||||
break;
|
||||
towrite = MIN (promised_size - written, length);
|
||||
write_error = fd_write (sock, chunk, towrite, -1);
|
||||
write_error = fd_write (sock, chunk, towrite, -1.0);
|
||||
if (write_error < 0)
|
||||
{
|
||||
fclose (fp);
|
||||
@ -840,7 +840,7 @@ skip_short_body (int fd, wgint contlen)
|
||||
|
||||
while (contlen > 0)
|
||||
{
|
||||
int ret = fd_read (fd, dlbuf, MIN (contlen, SKIP_SIZE), -1);
|
||||
int ret = fd_read (fd, dlbuf, MIN (contlen, SKIP_SIZE), -1.0);
|
||||
if (ret <= 0)
|
||||
{
|
||||
/* Don't normally report the error since this is an
|
||||
@ -1523,7 +1523,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
|
||||
if (opt.post_data)
|
||||
{
|
||||
DEBUGP (("[POST data: %s]\n", opt.post_data));
|
||||
write_error = fd_write (sock, opt.post_data, post_data_size, -1);
|
||||
write_error = fd_write (sock, opt.post_data, post_data_size, -1.0);
|
||||
}
|
||||
else if (opt.post_file_name && post_data_size != 0)
|
||||
write_error = post_file (sock, opt.post_file_name, post_data_size);
|
||||
|
@ -530,7 +530,7 @@ bar_create (wgint initial, wgint total)
|
||||
|
||||
logputs (LOG_VERBOSE, "\n");
|
||||
|
||||
create_image (bp, 0);
|
||||
create_image (bp, 0.0);
|
||||
display_image (bp->buffer);
|
||||
|
||||
return bp;
|
||||
|
16
src/retr.c
16
src/retr.c
@ -299,7 +299,7 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos,
|
||||
if (!write_data (out, dlbuf, ret, &skip, &sum_written))
|
||||
{
|
||||
ret = -2;
|
||||
goto out;
|
||||
goto out_;
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos,
|
||||
if (ret < -1)
|
||||
ret = -1;
|
||||
|
||||
out:
|
||||
out_:
|
||||
if (progress)
|
||||
progress_finish (progress, ptimer_read (timer));
|
||||
|
||||
@ -388,7 +388,7 @@ fd_read_hunk (int fd, hunk_terminator_t terminator, long sizehint, long maxsize)
|
||||
|
||||
/* First, peek at the available data. */
|
||||
|
||||
pklen = fd_peek (fd, hunk + tail, bufsize - 1 - tail, -1);
|
||||
pklen = fd_peek (fd, hunk + tail, bufsize - 1 - tail, -1.0);
|
||||
if (pklen < 0)
|
||||
{
|
||||
xfree (hunk);
|
||||
@ -421,7 +421,7 @@ fd_read_hunk (int fd, hunk_terminator_t terminator, long sizehint, long maxsize)
|
||||
how much data we'll get. (Some TCP stacks are notorious for
|
||||
read returning less data than the previous MSG_PEEK.) */
|
||||
|
||||
rdlen = fd_read (fd, hunk + tail, remain, 0);
|
||||
rdlen = fd_read (fd, hunk + tail, remain, 0.0);
|
||||
if (rdlen < 0)
|
||||
{
|
||||
xfree_null (hunk);
|
||||
@ -830,8 +830,8 @@ retrieve_from_file (const char *file, int html, int *count)
|
||||
|
||||
if (filename && opt.delete_after && file_exists_p (filename))
|
||||
{
|
||||
DEBUGP (("Removing file due to --delete-after in"
|
||||
" retrieve_from_file():\n"));
|
||||
DEBUGP (("\
|
||||
Removing file due to --delete-after in retrieve_from_file():\n"));
|
||||
logprintf (LOG_VERBOSE, _("Removing %s.\n"), filename);
|
||||
if (unlink (filename))
|
||||
logprintf (LOG_NOTQUIET, "unlink: %s\n", strerror (errno));
|
||||
@ -879,7 +879,7 @@ sleep_between_retrievals (int count)
|
||||
/* If opt.waitretry is specified and this is a retry, wait for
|
||||
COUNT-1 number of seconds, or for opt.waitretry seconds. */
|
||||
if (count <= opt.waitretry)
|
||||
xsleep (count - 1);
|
||||
xsleep (count - 1.0);
|
||||
else
|
||||
xsleep (opt.waitretry);
|
||||
}
|
||||
@ -992,7 +992,7 @@ getproxy (struct url *u)
|
||||
}
|
||||
|
||||
/* Should a host be accessed through proxy, concerning no_proxy? */
|
||||
int
|
||||
static int
|
||||
no_proxy_match (const char *host, const char **no_proxy)
|
||||
{
|
||||
if (!no_proxy)
|
||||
|
18
src/url.c
18
src/url.c
@ -688,7 +688,7 @@ url_parse (const char *url, int *error)
|
||||
if (scheme == SCHEME_INVALID)
|
||||
{
|
||||
error_code = PE_UNSUPPORTED_SCHEME;
|
||||
goto error;
|
||||
goto err;
|
||||
}
|
||||
|
||||
url_encoded = reencode_escapes (url);
|
||||
@ -726,7 +726,7 @@ url_parse (const char *url, int *error)
|
||||
if (!host_e)
|
||||
{
|
||||
error_code = PE_UNTERMINATED_IPV6_ADDRESS;
|
||||
goto error;
|
||||
goto err;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
@ -734,14 +734,14 @@ url_parse (const char *url, int *error)
|
||||
if (!is_valid_ipv6_address(host_b, host_e))
|
||||
{
|
||||
error_code = PE_INVALID_IPV6_ADDRESS;
|
||||
goto error;
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Continue parsing after the closing ']'. */
|
||||
p = host_e + 1;
|
||||
#else
|
||||
error_code = PE_IPV6_NOT_SUPPORTED;
|
||||
goto error;
|
||||
goto err;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -753,7 +753,7 @@ url_parse (const char *url, int *error)
|
||||
if (host_b == host_e)
|
||||
{
|
||||
error_code = PE_EMPTY_HOST;
|
||||
goto error;
|
||||
goto err;
|
||||
}
|
||||
|
||||
port = scheme_default_port (scheme);
|
||||
@ -778,7 +778,7 @@ url_parse (const char *url, int *error)
|
||||
/* http://host:12randomgarbage/blah */
|
||||
/* ^ */
|
||||
error_code = PE_BAD_PORT_NUMBER;
|
||||
goto error;
|
||||
goto err;
|
||||
}
|
||||
port = 10 * port + (*pp - '0');
|
||||
/* Check for too large port numbers here, before we have
|
||||
@ -786,7 +786,7 @@ url_parse (const char *url, int *error)
|
||||
if (port > 65535)
|
||||
{
|
||||
error_code = PE_BAD_PORT_NUMBER;
|
||||
goto error;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -845,7 +845,7 @@ url_parse (const char *url, int *error)
|
||||
if (!parse_credentials (uname_b, uname_e - 1, &user, &passwd))
|
||||
{
|
||||
error_code = PE_INVALID_USER_NAME;
|
||||
goto error;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
@ -899,7 +899,7 @@ url_parse (const char *url, int *error)
|
||||
|
||||
return u;
|
||||
|
||||
error:
|
||||
err:
|
||||
/* Cleanup in case of error: */
|
||||
if (url_encoded && url_encoded != url)
|
||||
xfree (url_encoded);
|
||||
|
Loading…
Reference in New Issue
Block a user