[svn] Remove warnings under Borland C.

This commit is contained in:
hniksic 2005-03-05 18:11:10 -08:00
parent c5ca8b7152
commit e2241936d0
14 changed files with 57 additions and 40 deletions

View File

@ -1,3 +1,32 @@
2005-03-06 Hrvoje Niksic <hniksic@xemacs.org>
* utils.c (read_file): Don't use wgint for file size; LFS won't
work since the file is mmap'ed as a whole.
* options.h: Don't include stdio.h.
* log.c: Ditto.
* init.c: Disambiguate assignment from non-zero test to avoid
Borland C warning.
* http.c (response_new): Don't needlessly post-increment count.
* hash.c: Include stdio.h.
* gnu-md5.h: Don't include stdio.h.
* getopt.h (struct option): Always use const.
* ftp.c (getftp): Avoid unnecessary assignment to RES to avoid
Borland C warning.
* ftp-ls.c: Disambiguate assignment from non-zero test to avoid
Borland C warning.
* cmpt.c (strptime_internal): Don't initialize rp_backup when
!_NL_CURRENT to avoid Borland C warning.
2005-03-06 Hrvoje Niksic <hniksic@xemacs.org>
* utils.c (fopen_excl): Fix parse error when O_BINARY is

View File

@ -792,7 +792,9 @@ strptime_internal (rp, fmt, tm, decided)
struct tm *tm;
enum locale_status *decided;
{
#ifdef _NL_CURRENT
const char *rp_backup;
#endif
int cnt;
size_t val;
int have_I, is_pm;
@ -832,8 +834,10 @@ strptime_internal (rp, fmt, tm, decided)
start_over:
#endif
#ifdef _NL_CURRENT
/* Make back up of current processing pointer. */
rp_backup = rp;
#endif
switch (*fmt++)
{

View File

@ -121,7 +121,7 @@ ftp_parse_unix_ls (const char *file, int ignore_perms)
dir = l = NULL;
/* Line loop to end of file: */
while ((line = read_whole_line (fp)))
while ((line = read_whole_line (fp)) != NULL)
{
len = clean_line (line);
/* Skip if total... */
@ -200,7 +200,7 @@ ftp_parse_unix_ls (const char *file, int ignore_perms)
This tactic is quite dubious when it comes to
internationalization issues (non-English month names), but it
works for now. */
while ((tok = strtok (NULL, " ")))
while ((tok = strtok (NULL, " ")) != NULL)
{
--next;
if (next < 0) /* a month name was not encountered */
@ -449,7 +449,7 @@ ftp_parse_winnt_ls (const char *file)
dir = l = NULL;
/* Line loop to end of file: */
while ((line = read_whole_line (fp)))
while ((line = read_whole_line (fp)) != NULL)
{
len = clean_line (line);
@ -557,7 +557,7 @@ ftp_parse_winnt_ls (const char *file)
l->next = NULL;
}
xfree(line);
xfree (line);
}
fclose(fp);
@ -615,21 +615,18 @@ ftp_parse_vms_ls (const char *file)
/* Skip empty line. */
line = read_whole_line (fp);
if (line)
xfree (line);
xfree_null (line);
/* Skip "Directory PUB$DEVICE[PUB]" */
line = read_whole_line (fp);
if (line)
xfree (line);
xfree_null (line);
/* Skip empty line. */
line = read_whole_line (fp);
if (line)
xfree (line);
xfree_null (line);
/* Line loop to end of file: */
while ((line = read_whole_line (fp)))
while ((line = read_whole_line (fp)) != NULL)
{
char *p;
i = clean_line (line);
@ -729,7 +726,7 @@ ftp_parse_vms_ls (const char *file)
/* Fourth/Third column: Time hh:mm[:ss] */
tok = strtok (NULL, " ");
if (tok == NULL) continue;
hour = min = sec = 0;
min = sec = 0;
p = tok;
hour = atoi (p);
for (; *p && *p != ':'; ++p);

View File

@ -1114,7 +1114,7 @@ Error in server response, closing control connection.\n"));
char *line;
/* The lines are being read with read_whole_line because of
no-buffering on opt.lfile. */
while ((line = read_whole_line (fp)))
while ((line = read_whole_line (fp)) != NULL)
{
logprintf (LOG_ALWAYS, "%s\n", escnonprint (line));
xfree (line);
@ -1793,7 +1793,6 @@ ftp_retrieve_glob (struct url *u, ccon *con, int action)
return RETRBADPATTERN;
}
}
res = RETROK;
if (start)
{
/* Just get everything. */
@ -1843,7 +1842,6 @@ ftp_loop (struct url *u, int *dt, struct url *proxy)
con.rs = ST_UNIX;
con.id = NULL;
con.proxy = proxy;
res = RETROK; /* in case it's not used */
/* If the file name is empty, the user probably wants a directory
index. We'll provide one, properly HTML-ized. Unless

View File

@ -76,11 +76,7 @@ extern int optopt;
struct option
{
#if __STDC__
const char *name;
#else
char *name;
#endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;

View File

@ -21,8 +21,6 @@
#ifndef _MD5_H
#define _MD5_H 1
#include <stdio.h>
#if defined HAVE_LIMITS_H || _LIBC
# include <limits.h>
#endif
@ -125,10 +123,12 @@ extern void *md5_finish_ctx PARAMS ((struct md5_ctx *ctx, void *resbuf));
extern void *md5_read_ctx PARAMS ((const struct md5_ctx *ctx, void *resbuf));
#if 0 /* Unused in Wget */
/* Compute MD5 message digest for bytes read from STREAM. The
resulting message digest number will be written into the 16 bytes
beginning at RESBLOCK. */
extern int md5_stream PARAMS ((FILE *stream, void *resblock));
#endif
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise

View File

@ -47,6 +47,7 @@ so, delete this exception statement from your version. */
# include <limits.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

View File

@ -519,7 +519,7 @@ response_new (const char *head)
while (*hdr == ' ' || *hdr == '\t');
}
DO_REALLOC (resp->headers, size, count + 1, const char *);
resp->headers[count++] = NULL;
resp->headers[count] = NULL;
return resp;
}
@ -1043,7 +1043,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
int flags;
/* Whether authorization has been already tried. */
int auth_tried_already = 0;
int auth_tried_already;
/* Whether our connection to the remote host is through SSL. */
int using_ssl = 0;
@ -1427,8 +1427,6 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
proxy ? "Proxy" : "HTTP");
contlen = -1;
contrange = 0;
type = NULL;
statcode = -1;
*dt &= ~RETROKF;
head = fd_read_http_head (sock);
@ -2585,9 +2583,8 @@ basic_authentication_encode (const char *user, const char *passwd)
static int
extract_header_attr (const char *au, const char *attr_name, char **ret)
{
const char *cp, *ep;
ep = cp = au;
const char *ep;
const char *cp = au;
if (strncmp (cp, attr_name, strlen (attr_name)) == 0)
{

View File

@ -399,7 +399,7 @@ run_wgetrc (const char *file)
}
enable_tilde_expansion = 1;
ln = 1;
while ((line = read_whole_line (fp)))
while ((line = read_whole_line (fp)) != NULL)
{
char *com, *val;
int comind, status;

View File

@ -315,7 +315,7 @@ logputs (enum log_options o, const char *s)
FILE *fp;
check_redirect_output ();
if (!(fp = get_log_fp ()))
if ((fp = get_log_fp ()) == NULL)
return;
CHECK_VERBOSE (o);

View File

@ -660,7 +660,7 @@ main (int argc, char *const *argv)
#ifdef WINDOWS
/* Drop extension (typically .EXE) from executable filename. */
windows_main_junk (&argc, (char **) argv, (char **) &exec_name);
windows_main (&argc, (char **) argv, (char **) &exec_name);
#endif
/* Set option defaults; read the system wgetrc and ~/.wgetrc. */
@ -712,7 +712,7 @@ main (int argc, char *const *argv)
break;
case OPT_FUNCALL:
{
void (*func) PARAMS ((void)) = opt->data;
void (*func) PARAMS ((void)) = (void (*) PARAMS ((void))) opt->data;
func ();
}
break;

View File

@ -27,9 +27,6 @@ modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
/* Needed for FDP. */
#include <stdio.h>
struct options
{
int verbose; /* Are we verbose? */

View File

@ -536,9 +536,7 @@ fopen_excl (const char *fname, int binary)
int
make_directory (const char *directory)
{
int quit = 0;
int i;
int ret = 0;
int i, ret, quit = 0;
char *dir;
/* Make a copy of dir, to be able to write to it. Otherwise, the
@ -876,7 +874,7 @@ read_file (const char *file)
{
int fd;
struct file_memory *fm;
wgint size;
long size;
int inhibit_close = 0;
/* Some magic in the finest tradition of Perl and its kin: if FILE

View File

@ -45,7 +45,7 @@ struct hash_table;
struct file_memory {
char *content;
wgint length;
long length;
int mmap_p;
};