commit 304f731555f2b29448b87593f91e6f06f7f94b49
parent 602a1c94804f3d745a203d8490b824c1fa37efdc
Author: ukai <ukai>
Date: Tue, 20 Nov 2001 04:11:16 +0000
remove gcc warnings
Diffstat:
9 files changed, 40 insertions(+), 70 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,18 @@
+2001-11-20 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * main.c (MAIN): add braces to avoid ambiguous `else'
+ * main.c (set_buffer_environ): remove unused variables
+ * linein.c (_rcompl): not EMACS_LIKE_LINEEDIT only
+ * local.c (localcgi_get): remove unused variables
+ * mailcap.c (unquote_mailcap_loop): remove unused variables
+ * url.c (init_PRNG) add parentheses around assignment used as true value
+ * url.c (parseURL): remove unsed label
+ * url.c (parseURL2): remove unused variables
+ * ftp.c (ftp_escape_str ftp_restore_str): remove not used functions
+ * indep.c (getescapechar): remove unused variable
+
+ * proto.h: add missin prototypes
+
2001-11-20 Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
* terms.c (skip_escseq): [w3m-dev 02447]
diff --git a/ftp.c b/ftp.c
@@ -376,8 +376,6 @@ Str FTPDIRtmp;
static int ex_ftpdir_name_size_date(char *, char **, char **, char **);
static int ftp_system(FTP);
-static char *ftp_escape_str(char *);
-static char *ftp_restore_str(char *);
#define SERVER_NONE 0
#define UNIXLIKE_SERVER 1
@@ -676,29 +674,6 @@ ftp_system(FTP ftp)
return (sv_type);
}
-static char *
-ftp_escape_str(char *str)
-{
- Str s = Strnew();
- char *p, buf[5];
- unsigned char c;
-
- for (; (c = (unsigned char) *str) != '\0'; str++) {
- p = NULL;
- if (c < '!' || c > '~'
- || c == '#' || c == '?' || c == '+'
- || c == '&' || c == '<' || c == '>' || c == '"' || c == '%') {
- sprintf(buf, "%%%02X", c);
- p = buf;
- }
- if (p)
- Strcat_charp(s, p);
- else
- Strcat_char(s, *str);
- }
- return s->ptr;
-}
-
#define XD_CTOD(c) {\
if (c >= '0' && c <= '9') {\
c -= (unsigned char)'0';\
@@ -711,35 +686,6 @@ ftp_escape_str(char *str)
}\
}
-static char *
-ftp_restore_str(char *str)
-{
- Str s = Strnew();
- char *p;
- unsigned char c, code[2];
-
- for (; *str; str++) {
- p = NULL;
- if (*str == '%' && str[1] != '\0' && str[2] != '\0') {
- c = (unsigned char) str[1];
- XD_CTOD(c)
- code[0] = c * (unsigned char) 16;
- c = (unsigned char) str[2];
- XD_CTOD(c)
- code[0] += c;
- code[1] = '\0';
- p = (char *) code;
- str += 2;
- }
- skip:
- if (p)
- Strcat_charp(s, p);
- else
- Strcat_char(s, *str);
- }
- return s->ptr;
-}
-
#define EX_SKIP_SPACE(cp) {\
while (IS_SPACE(*cp) && *cp != '\0') cp++;\
if (*cp == '\0') {\
diff --git a/indep.c b/indep.c
@@ -280,7 +280,7 @@ cleanup_line(Str s, int mode)
int
getescapechar(char **str)
{
- int i, dummy = -1;
+ int dummy = -1;
char *p = *str, *q;
if (*p == '&')
diff --git a/linein.c b/linein.c
@@ -43,8 +43,11 @@ static void insertself(char c),
_mvR(void), _mvL(void), _mvRw(void), _mvLw(void), delC(void), insC(void),
_mvB(void), _mvE(void), _enter(void), _quo(void), _bs(void), _bsw(void),
killn(void), killb(void), _inbrk(void), _esc(void),
- _prev(void), _next(void), _compl(void), _rcompl(void), _tcompl(void),
+ _prev(void), _next(void), _compl(void), _tcompl(void),
_dcompl(void), _rdcompl(void);
+#ifndef EMACS_LIKE_LINEEDIT
+static void _rcompl(void);
+#endif
#ifdef __EMX__
static int getcntrl(void);
#endif
@@ -722,11 +725,13 @@ _compl(void)
next_compl(1);
}
+#ifndef EMACS_LIKE_LINEEDIT
static void
_rcompl(void)
{
next_compl(-1);
}
+#endif
static void
_tcompl(void)
diff --git a/local.c b/local.c
@@ -459,7 +459,7 @@ localcgi_get(char *uri, char *request, char *referer)
FILE *f;
int status;
pid_t pid;
- char *file, *sh;
+ char *file;
file = cgi_filename(uri, &status);
if (check_local_cgi(file, status) < 0)
diff --git a/mailcap.c b/mailcap.c
@@ -303,7 +303,7 @@ static Str
unquote_mailcap_loop(char *qstr, char *type, char *name, char *attr, int *stat, int flag0)
{
Str str, tmp, test, then;
- char *p, *q;
+ char *p;
int status = MC_NORMAL, prev_status = MC_NORMAL, sp = 0, flag;
if (stat)
diff --git a/main.c b/main.c
@@ -9,6 +9,7 @@
#include <sys/wait.h>
#include "terms.h"
#include "myctype.h"
+#include "regex.h"
#ifdef MOUSE
#ifdef USE_GPM
#include <gpm.h>
@@ -505,11 +506,12 @@ MAIN(int argc, char **argv, char **envp)
Str hs;
if (++i >= argc)
usage();
- if ((hs = make_optional_header_string(argv[i])) != NULL)
+ if ((hs = make_optional_header_string(argv[i])) != NULL) {
if (header_string == NULL)
header_string = hs;
else
Strcat (header_string, hs);
+ }
}
#ifdef MOUSE
else if (!strcmp("-no-mouse", argv[i])) {
@@ -4497,9 +4499,6 @@ set_buffer_environ(Buffer *buf)
Anchor *a;
Str s;
ParsedURL pu;
- TextListItem *ti;
- struct frameset *f_set = NULL;
- int all;
if (buf == NULL)
return;
diff --git a/proto.h b/proto.h
@@ -365,6 +365,7 @@ extern char str_to_code(char *str);
extern char *code_to_str(char code);
extern void put_sjis(Str os, unsigned char ub, unsigned char lb);
#endif /* JP_CHARSET */
+extern void free_ssl_ctx();
extern ParsedURL *baseURL(Buffer * buf);
extern int openSocket(char *hostname, char *remoteport_name, unsigned short remoteport_num);
extern void parseURL(char *url, ParsedURL * p_url, ParsedURL * current);
@@ -374,13 +375,16 @@ extern Str parsedURL2Str(ParsedURL * pu);
extern int getURLScheme(char **url);
extern void init_stream(URLFile *uf, int scheme, InputStream stream);
extern URLFile openURL(char *url, ParsedURL * pu, ParsedURL * current, URLOption * option, FormList * request, TextList * extra_header, URLFile * ouf, unsigned char *status);
+extern char *guessContentType(char *filename);
+extern TextList* make_domain_list(char *domain_list);
+extern int check_no_proxy(char *domain);
+extern char *filename_extension(char *path, int is_url);
extern int mailcapMatch(struct mailcap *mcap, char *type);
extern struct mailcap *loadMailcap(char *filename);
extern struct mailcap *searchMailcap(struct mailcap *table, char *type);
extern void initMailcap();
extern struct mailcap *searchExtViewer(char *type);
extern Str unquote_mailcap(char *qstr, char *type, char *name, char *attr, int *stat);
-extern char *guessContentTypeFromTable(struct table2 *table, char *filename);
extern char *guessContentType(char *filename);
extern TextList *make_domain_list(char *domain_list);
extern int check_no_proxy(char *domain);
@@ -426,6 +430,7 @@ extern char *libFile(char *base);
extern char *helpFile(char *base);
extern void setLocalCookie(void);
extern Buffer *dirBuffer(char *dirname);
+extern void set_environ(char *var, char *value);
extern FILE *localcgi_post(char *, char *, FormList *, char*);
extern FILE *localcgi_get(char *, char *, char*);
extern Str find_auth_cookie(char *host, char *realm);
diff --git a/url.c b/url.c
@@ -178,7 +178,7 @@ free_ssl_ctx()
#if SSLEAY_VERSION_NUMBER >= 0x00905100
#include <rand.h>
-void
+static void
init_PRNG()
{
char buffer[256];
@@ -186,7 +186,7 @@ init_PRNG()
long l;
if (RAND_status())
return;
- if (file = RAND_file_name(buffer, sizeof(buffer))) {
+ if ((file = RAND_file_name(buffer, sizeof(buffer)))) {
#ifdef USE_EGD
if (RAND_egd(file) > 0)
return;
@@ -206,7 +206,7 @@ init_PRNG()
}
#endif /* SSLEAY_VERSION_NUMBER >= 0x00905100 */
-SSL *
+static SSL *
openSSLHandle(int sock)
{
SSL *handle;
@@ -824,7 +824,7 @@ parseURL(char *url, ParsedURL * p_url, ParsedURL * current)
else
p_url->file = copyPath(q, p - q, COPYPATH_SPC_IGNORE);
}
- do_query:
+
if (*p == '?') {
q = ++p;
while (*p && *p != '#')
@@ -864,7 +864,7 @@ copyParsedURL(ParsedURL * p, ParsedURL * q)
void
parseURL2(char *url, ParsedURL * pu, ParsedURL * current)
{
- char *p, *q;
+ char *p;
Str tmp;
int relative_uri = FALSE;
@@ -1165,7 +1165,7 @@ otherinfo(ParsedURL * target, ParsedURL * current, char *referer)
return s->ptr;
}
-Str
+static Str
HTTPrequest(ParsedURL * pu, ParsedURL * current, HRequest * hr, TextList * extra)
{
Str tmp;
@@ -1685,7 +1685,7 @@ add_index_file(ParsedURL * pu, URLFile *uf)
return;
}
-char *
+static char *
guessContentTypeFromTable(struct table2 *table, char *filename)
{
char *p;