commit 34bf8f7310a880979501403b3b42fd9130e4142b
parent dc6d25d95630138b6d045240702116ba45760fc8
Author: ukai <ukai>
Date: Thu, 31 Jan 2002 18:28:24 +0000
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>
Diffstat:
9 files changed, 65 insertions(+), 37 deletions(-)
diff --git 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)
diff --git a/anchor.c b/anchor.c
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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);