summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwl <wl>2012-03-10 09:16:01 +0000
committerwl <wl>2012-03-10 09:16:01 +0000
commitc343eb6fd1b6352d3ae70806902534240c0f29ff (patch)
tree1072cbcdb42493a25dccf571c783c04055cdbc2a /src
parentd7748c87be941aebf6c1b545226e5b8a12b685fd (diff)
downloadgroff-c343eb6fd1b6352d3ae70806902534240c0f29ff.tar.gz
Fix compiler warnings.
* src/preproc/html/pre-html.cpp (alterDeviceTo): Avoid ambiguous if-else clause. * src/preproc/grn/main.cpp (sccsid): Comment out. * src/roff/troff/number.cpp (parse_expr) <case '*'>: Add cast. * src/devices/xditview/Makefile.sub (EXTRA_CFLAGS): Add `-Dlint' so that unused static ID arrays don't cause a warning. (Some) problems reported by Bjarni Ingi Gislason <bjarniig@rhi.hi.is>.
Diffstat (limited to 'src')
-rw-r--r--src/devices/xditview/Makefile.sub2
-rw-r--r--src/preproc/grn/main.cpp2
-rw-r--r--src/preproc/html/pre-html.cpp5
-rw-r--r--src/roff/troff/number.cpp4
4 files changed, 7 insertions, 6 deletions
diff --git a/src/devices/xditview/Makefile.sub b/src/devices/xditview/Makefile.sub
index f1958447..927807ef 100644
--- a/src/devices/xditview/Makefile.sub
+++ b/src/devices/xditview/Makefile.sub
@@ -2,7 +2,7 @@ PROG=gxditview$(EXEEXT)
MAN1=gxditview.n
MLIB=$(LIBM)
XLIBS=$(LIBXUTIL)
-EXTRA_CFLAGS=$(X_CFLAGS)
+EXTRA_CFLAGS=$(X_CFLAGS) -Dlint
EXTRA_LDFLAGS=$(X_LIBS) $(X_PRE_LIBS) -lXaw -lXmu -lXt -lX11 $(X_EXTRA_LIBS)
OBJS=\
device.$(OBJEXT) \
diff --git a/src/preproc/grn/main.cpp b/src/preproc/grn/main.cpp
index 401109ad..d6ae7543 100644
--- a/src/preproc/grn/main.cpp
+++ b/src/preproc/grn/main.cpp
@@ -119,7 +119,7 @@ extern POINT *PTMakePoint(double x, double y, POINT **pplist);
#define BIG 999999999999.0 /* unweildly large floating number */
-static char sccsid[] = "@(#) (Berkeley) 8/5/85, 12/28/99";
+/* static char sccsid[] = "@(#) (Berkeley) 8/5/85, 12/28/99"; */
int res; /* the printer's resolution goes here */
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index 50c2de5e..fae164cd 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009
+/* Copyright (C) 2000-2004, 2007-2009, 2012
* Free Software Foundation, Inc.
* Written by Gaius Mulley (gaius@glam.ac.uk).
*
@@ -1205,11 +1205,12 @@ static void alterDeviceTo(int argc, char *argv[], int toImage)
}
else {
while (i < argc) {
- if (strcmp(argv[i], IMAGE_DEVICE) == 0)
+ if (strcmp(argv[i], IMAGE_DEVICE) == 0) {
if (dialect == xhtml)
argv[i] = (char *)"-Txhtml";
else
argv[i] = (char *)"-Thtml";
+ }
i++;
}
argv[troff_arg] = (char *)"groff"; /* use groff -Z */
diff --git a/src/roff/troff/number.cpp b/src/roff/troff/number.cpp
index fc3f9803..1f4c6ee5 100644
--- a/src/roff/troff/number.cpp
+++ b/src/roff/troff/number.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2004, 2009
+/* Copyright (C) 1989-1992, 2001, 2002, 2004, 2009, 2012
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -355,7 +355,7 @@ static int parse_expr(units *v, int scale_indicator,
case '*':
if (v2 < 0) {
if (*v > 0) {
- if (*v > -(unsigned)INT_MIN / -(unsigned)v2)
+ if ((unsigned)*v > -(unsigned)INT_MIN / -(unsigned)v2)
overflow = 1;
}
else if (-(unsigned)*v > INT_MAX / -(unsigned)v2)