aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-01-31 18:28:24 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-01-31 18:28:24 +0000
commit4c7c352e4702973aa067da874124458130da6b69 (patch)
tree692a321abc5b1b3a32d256b9be9fb9dff2f6d63e
parentw3m-img merge (w3m-0.2.4+cvs-1.278-img-2.2.patch.gz) (diff)
downloadw3m-4c7c352e4702973aa067da874124458130da6b69.tar.gz
w3m-4c7c352e4702973aa067da874124458130da6b69.zip
gcc -Wall -Werror safe
* anchor.c (addMultirowsImg): unused variable: fi * display.c (redrawLineImage): unused variable: ncol * file.c (process_img): uninitialized variables: r2, ni, w0, i0, ismap unused variable: url, ext * file.c (loadHTMLstream): need volatile image_flag * image.c (image_index): int * image.c (getCharSize): need prototype * image.c (getImage): uninitialized variable: key return NULL * map.c (follow_map_menu): used only USE_IMAGE: px, py, map * map.c (newMapArea): used only USE_IMAGE: p, i, max * proto.h (addMultirowsImg): added * w3mimgdisplay.c (main): format string fix * w3mimgdisplay.c (DrawImage): need (Pixmap) cast * inflate.c: indent From: Fumitoshi UKAI <ukai@debian.or.jp>
-rw-r--r--ChangeLog22
-rw-r--r--anchor.c3
-rw-r--r--display.c4
-rw-r--r--file.c10
-rw-r--r--image.c45
-rw-r--r--inflate.c4
-rw-r--r--map.c6
-rw-r--r--proto.h5
-rw-r--r--w3mimgdisplay.c21
9 files changed, 74 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index ce10d49..c22cc54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2002-02-01 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * gcc -Wall -Werror safe
+ * anchor.c (addMultirowsImg): unused variable: fi
+ * display.c (redrawLineImage): unused variable: ncol
+ * file.c (process_img): uninitialized variables: r2, ni, w0, i0, ismap
+ unused variable: url, ext
+ * file.c (loadHTMLstream): need volatile image_flag
+ * image.c (image_index): int
+ * image.c (getCharSize): need prototype
+ * image.c (getImage): uninitialized variable: key
+ return NULL
+ * map.c (follow_map_menu): used only USE_IMAGE: px, py, map
+ * map.c (newMapArea): used only USE_IMAGE: p, i, max
+ * proto.h (addMultirowsImg): added
+ * w3mimgdisplay.c (main): format string fix
+ * w3mimgdisplay.c (DrawImage): need (Pixmap) cast
+
+ * inflate.c: indent
+
2002-02-01 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* w3m-img merge (w3m-0.2.4+cvs-1.278-img-2.2.patch.gz)
@@ -2673,4 +2693,4 @@
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.287 2002/01/31 17:54:47 ukai Exp $
+$Id: ChangeLog,v 1.288 2002/01/31 18:28:24 ukai Exp $
diff --git a/anchor.c b/anchor.c
index 21ea1ab..7f864ee 100644
--- a/anchor.c
+++ b/anchor.c
@@ -1,4 +1,4 @@
-/* $Id: anchor.c,v 1.8 2002/01/31 17:54:48 ukai Exp $ */
+/* $Id: anchor.c,v 1.9 2002/01/31 18:28:24 ukai Exp $ */
#include "fm.h"
#include "myctype.h"
#include "regex.h"
@@ -470,7 +470,6 @@ addMultirowsImg(Buffer *buf, AnchorList *al)
l->propBuf[k] |= PE_ANCHOR;
}
if (a_form.url) {
- FormItemList *fi = (FormItemList *)a_form.url;
buf->formitem = putAnchor(buf->formitem, a_form.url,
a_form.target, &a, NULL,
l->linenumber, pos);
diff --git a/display.c b/display.c
index 275c301..a189a68 100644
--- a/display.c
+++ b/display.c
@@ -1,4 +1,4 @@
-/* $Id: display.c,v 1.15 2002/01/31 17:54:50 ukai Exp $ */
+/* $Id: display.c,v 1.16 2002/01/31 18:28:24 ukai Exp $ */
#include <signal.h>
#include "fm.h"
@@ -620,7 +620,7 @@ redrawLine(Buffer *buf, Line *l, int i)
Line *
redrawLineImage(Buffer *buf, Line *l, int i)
{
- int j, pos, rcol, ncol;
+ int j, pos, rcol;
int column = buf->currentColumn;
Anchor *a;
int x, y, sx, sy, w, h;
diff --git a/file.c b/file.c
index 26ad0fc..02b5262 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.55 2002/01/31 17:54:50 ukai Exp $ */
+/* $Id: file.c,v 1.56 2002/01/31 18:28:24 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -2754,9 +2754,10 @@ restore_fonteffect(struct html_feed_environ *h_env, struct readbuffer *obuf)
Str
process_img(struct parsed_tag *tag, int width)
{
- char *p, *q, *r, *r2, *s;
+ char *p, *q, *r, *r2 = NULL, *s;
#ifdef USE_IMAGE
- int w, i, nw, ni, n, w0, i0, align, xoffset, yoffset, top, bottom, ismap;
+ int w, i, nw, ni = 1, n, w0 = -1, i0 = -1;
+ int align, xoffset, yoffset, top, bottom, ismap = 0;
int use_image = activeImage && displayImage;
#else
int w, i, nw, n;
@@ -2842,7 +2843,6 @@ process_img(struct parsed_tag *tag, int width)
w0 = w;
i0 = i;
if (w < 0 || i < 0) {
- char *url, *ext;
Image image;
ParsedURL u;
@@ -5726,7 +5726,7 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)
struct html_feed_environ htmlenv1;
struct readbuffer obuf;
#ifdef USE_IMAGE
- int image_flag;
+ int volatile image_flag;
#endif
MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL;
diff --git a/image.c b/image.c
index 86d2b8f..a8cfc4f 100644
--- a/image.c
+++ b/image.c
@@ -1,4 +1,4 @@
-/* $Id: image.c,v 1.1 2002/01/31 17:54:51 ukai Exp $ */
+/* $Id: image.c,v 1.2 2002/01/31 18:28:24 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
@@ -11,7 +11,7 @@
#ifdef USE_IMAGE
-static image_index = 0;
+static int image_index = 0;
/* display image */
@@ -32,6 +32,7 @@ static FILE *Imgdisplay_rf = NULL, *Imgdisplay_wf = NULL;
static pid_t Imgdisplay_pid = 0;
static int openImgdisplay();
static void closeImgdisplay();
+int getCharSize();
void
initImage()
@@ -60,9 +61,9 @@ getCharSize()
pclose(f);
if (!(w > 0 && h > 0))
return FALSE;
- if (! set_pixel_per_char)
+ if (!set_pixel_per_char)
pixel_per_char = (int)(1.0 * w / COLS + 0.5);
- if (! set_pixel_per_line)
+ if (!set_pixel_per_line)
pixel_per_line = (int)(1.0 * h / LINES + 0.5);
return TRUE;
}
@@ -211,7 +212,7 @@ drawImage()
fputs(i->cache->file, Imgdisplay_wf);
fputs("\n", Imgdisplay_wf);
fputs("4;\n", Imgdisplay_wf); /* put '\n' */
- again:
+ again:
if (fflush(Imgdisplay_wf) != 0) {
switch (errno) {
case EINTR:
@@ -225,7 +226,7 @@ drawImage()
}
if (!draw)
return;
- fputs("3;\n", Imgdisplay_wf); /* XSync() */
+ fputs("3;\n", Imgdisplay_wf); /* XSync() */
fputs("4;\n", Imgdisplay_wf); /* put '\n' */
again2:
if (fflush(Imgdisplay_wf) != 0) {
@@ -238,18 +239,18 @@ drawImage()
}
if (!fgetc(Imgdisplay_rf))
goto err;
-/*
- touch_line();
- touch_column(CurColumn);
-#ifdef JP_CHARSET
- if (CurColumn > 0 &&
- CHMODE(ScreenImage[CurLine]->lineprop[CurColumn]) == C_WCHAR2)
- touch_column(CurColumn - 1);
- else if (CurColumn < COLS - 1 &&
- CHMODE(ScreenImage[CurLine]->lineprop[CurColumn]) == C_WCHAR1)
- touch_column(CurColumn + 1);
-#endif
-*/
+ /*
+ * touch_line();
+ * touch_column(CurColumn);
+ * #ifdef JP_CHARSET
+ * if (CurColumn > 0 &&
+ * CHMODE(ScreenImage[CurLine]->lineprop[CurColumn]) == C_WCHAR2)
+ * touch_column(CurColumn - 1);
+ * else if (CurColumn < COLS - 1 &&
+ * CHMODE(ScreenImage[CurLine]->lineprop[CurColumn]) == C_WCHAR1)
+ * touch_column(CurColumn + 1);
+ * #endif
+ */
touch_cursor();
refresh();
return;
@@ -422,11 +423,11 @@ loadImage(int flag)
ImageCache *
getImage(Image * image, ParsedURL *current, int flag)
{
- Str key;
+ Str key = NULL;
ImageCache *cache;
if (!activeImage)
- return;
+ return NULL;
if (!image_hash)
image_hash = newHash_sv(100);
if (image->cache)
@@ -491,8 +492,8 @@ getImageSize(ImageCache * cache)
tmp = Strnew();
if (!strchr(Imgsize, '/'))
Strcat_m_charp(tmp, LIB_DIR, "/", NULL);
- Strcat_m_charp(tmp, Imgsize, " ", shell_quote(cache->file), " 2> /dev/null",
- NULL);
+ Strcat_m_charp(tmp, Imgsize, " ", shell_quote(cache->file),
+ " 2> /dev/null", NULL);
f = popen(tmp->ptr, "r");
if (!f)
return 0;
diff --git a/inflate.c b/inflate.c
index 3c30af0..c1847fa 100644
--- a/inflate.c
+++ b/inflate.c
@@ -1,4 +1,4 @@
-/* $Id: inflate.c,v 1.6 2002/01/31 15:26:19 ukai Exp $ */
+/* $Id: inflate.c,v 1.7 2002/01/31 18:28:24 ukai Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <zlib.h>
@@ -52,7 +52,7 @@ main(int argc, char **argv)
fwrite(outbuf, 1, sizeof(outbuf) - s.avail_out, stdout);
break;
}
- if (status == Z_DATA_ERROR && ! retry++) {
+ if (status == Z_DATA_ERROR && !retry++) {
status = inflateReset(&s);
if (status != Z_OK) {
fprintf(stderr, "%s: inflateReset() %s\n", argv[0],
diff --git a/map.c b/map.c
index 5a6a349..b581746 100644
--- a/map.c
+++ b/map.c
@@ -1,4 +1,4 @@
-/* $Id: map.c,v 1.5 2002/01/31 17:54:52 ukai Exp $ */
+/* $Id: map.c,v 1.6 2002/01/31 18:28:24 ukai Exp $ */
/*
* client-side image maps
*/
@@ -69,7 +69,9 @@ follow_map_menu(Buffer *buf, struct parsed_tagarg *arg, Anchor *a_img, int x,
char *name;
int i, n, selected = -1, initial;
char **label;
+#ifdef USE_IMAGE
int px, py, map = 0;
+#endif
name = tag_get_value(arg, "link");
if (name == NULL)
@@ -195,9 +197,11 @@ newMapArea(char *url, char *alt, char *shape, char *coords)
{
MapArea *a = New(MapArea);
#ifdef MENU_MAP
+#ifdef USE_IMAGE
char *p;
int i, max;
#endif
+#endif
a->url = url;
a->alt = alt ? alt : "";
diff --git a/proto.h b/proto.h
index 232231f..405ab34 100644
--- a/proto.h
+++ b/proto.h
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.33 2002/01/31 17:54:56 ukai Exp $ */
+/* $Id: proto.h,v 1.34 2002/01/31 18:28:24 ukai Exp $ */
/*
* This file was automatically generated by version 1.7 of cextract.
* Manual editing not recommended.
@@ -485,6 +485,9 @@ extern char *reAnchorNews(Buffer *buf, char *re);
extern void addMultirowsForm(Buffer *buf, AnchorList *al);
extern Anchor *closest_next_anchor(AnchorList *a, Anchor *an, int x, int y);
extern Anchor *closest_prev_anchor(AnchorList *a, Anchor *an, int x, int y);
+#ifdef USE_IMAGE
+void addMultirowsImg(Buffer *buf, AnchorList *al);
+#endif
extern HmarkerList *putHmarker(HmarkerList *ml, int line, int pos, int seq);
extern Str decodeB(char **ww);
extern Str decodeQ(char **ww);
diff --git a/w3mimgdisplay.c b/w3mimgdisplay.c
index 872068a..1ff442e 100644
--- a/w3mimgdisplay.c
+++ b/w3mimgdisplay.c
@@ -1,4 +1,4 @@
-/* $Id: w3mimgdisplay.c,v 1.1 2002/01/31 17:54:57 ukai Exp $ */
+/* $Id: w3mimgdisplay.c,v 1.2 2002/01/31 18:28:24 ukai Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <Imlib.h>
@@ -104,14 +104,15 @@ main(int argc, char **argv)
XQueryTree(display, window, &root, &parent, &children, &nchildren);
if (defined_debug)
fprintf(stderr,
- "window=%x root=%x parent=%x nchildren=%d width=%d height=%d\n",
- window, root, parent, nchildren, width, height);
+ "window=%lx root=%lx parent=%lx nchildren=%d width=%d height=%d\n",
+ (unsigned long)window, (unsigned long)root,
+ (unsigned long)parent, nchildren, width, height);
p_window = window;
for (i = 0; i < nchildren; i++) {
XGetWindowAttributes(display, children[i], &attr);
if (defined_debug)
fprintf(stderr,
- "children[%d]=%x x=%d y=%d width=%d height=%d\n", i,
+ "children[%d]=%lx x=%d y=%d width=%d height=%d\n", i,
children[i], attr.x, attr.y, attr.width, attr.height);
if (attr.width > width * 0.7 && attr.height > height * 0.7) {
/* maybe text window */
@@ -129,7 +130,7 @@ main(int argc, char **argv)
if (attr.x <= 0 && attr.width < 30 && attr.height > height * 0.7) {
if (defined_debug)
fprintf(stderr,
- "children[%d]=%x x=%d y=%d width=%d height=%d\n",
+ "children[%d]=%lx x=%d y=%d width=%d height=%d\n",
i, children[i], attr.x, attr.y, attr.width,
attr.height);
/* scrollbar of xterm/kterm ? */
@@ -165,9 +166,9 @@ main(int argc, char **argv)
XDestroyImage(i);
XFreeGC(display, gc);
XFreePixmap(display, p);
-/*
- background_pixel = WhitePixel(display, 0);
-*/
+ /*
+ * background_pixel = WhitePixel(display, 0);
+ */
}
while (fgets(buf, sizeof(buf), stdin) != NULL) {
@@ -319,11 +320,11 @@ DrawImage(char *buf, int redraw)
imageBuf = (Image *) realloc((void *)imageBuf,
sizeof(Image) * maxImage);
for (; i < maxImage; i++)
- imageBuf[i].pixmap = NULL;
+ imageBuf[i].pixmap = (Pixmap) NULL;
}
if (imageBuf[n].pixmap) {
XFreePixmap(display, imageBuf[n].pixmap);
- imageBuf[n].pixmap = NULL;
+ imageBuf[n].pixmap = (Pixmap) NULL;
}
im = Imlib_load_image(id, p);