From b556633ecab9464322aa5e6079a9f039c9ca81e6 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Fri, 16 Nov 2012 15:57:36 +0000 Subject: [PATCH] dtscreen: Resolve (all) 11 warnigns caused by -Wall --- cde/programs/dtscreen/dtscreen.c | 6 ++++-- cde/programs/dtscreen/dtscreen.h | 3 +++ cde/programs/dtscreen/flame.c | 8 ++------ cde/programs/dtscreen/pyro.c | 2 +- cde/programs/dtscreen/resource.c | 5 +++-- cde/programs/dtscreen/rotor.c | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cde/programs/dtscreen/dtscreen.c b/cde/programs/dtscreen/dtscreen.c index 6c227865..673c4d9a 100644 --- a/cde/programs/dtscreen/dtscreen.c +++ b/cde/programs/dtscreen/dtscreen.c @@ -112,6 +112,7 @@ nl_catd scmc_catd; /* Cat descriptor for scmc conversion */ #include #include #include +#include #include /* For Boolean */ #include @@ -219,7 +220,6 @@ main(argc, argv) { XSetWindowAttributes xswa; XGCValues xgcv; - XColor nullcolor; int nitems = 0; int window; int i; @@ -375,7 +375,9 @@ main(argc, argv) Win[window].gc = XCreateGC(dsp, Win[window].w, GCForeground | GCBackground, &xgcv); } - nice(nicelevel); + if(-1 == nice(nicelevel)) { + fprintf(stderr, "dtscreen: failed to set nice() level '%s'\n", strerror(errno)); + } justDisplay(); diff --git a/cde/programs/dtscreen/dtscreen.h b/cde/programs/dtscreen/dtscreen.h index 6bf8c8f0..8e27aae4 100644 --- a/cde/programs/dtscreen/dtscreen.h +++ b/cde/programs/dtscreen/dtscreen.h @@ -41,6 +41,8 @@ #include #include +#include
+ #define MAXSCREENS 3 #define NUMCOLORS 64 @@ -74,6 +76,7 @@ extern void (*callback) (); extern void (*init) (); extern void GetResources(); +extern void CheckResources(); extern void hsbramp(); extern void error(); extern long seconds(); diff --git a/cde/programs/dtscreen/flame.c b/cde/programs/dtscreen/flame.c index 9ba56a50..e4cfbca1 100644 --- a/cde/programs/dtscreen/flame.c +++ b/cde/programs/dtscreen/flame.c @@ -119,7 +119,7 @@ recurse(fs, x, y, l) register double x, y; register int l; { - int xp, yp, i; + int i; double nx, ny; if (l == fs->max_levels) { @@ -128,10 +128,6 @@ recurse(fs, x, y, l) return False; if (x > -1.0 && x < 1.0 && y > -1.0 && y < 1.0) { - xp = fs->pts[fs->num_points].x = (int) ((fs->width / 2) - * (x + 1.0)); - yp = fs->pts[fs->num_points].y = (int) ((fs->height / 2) - * (y + 1.0)); fs->num_points++; if (fs->num_points > MAXBATCH) { /* point buffer size */ XDrawPoints(dsp, fs->pwin->w, fs->pwin->gc, fs->pts, @@ -162,7 +158,7 @@ drawflame(pwin) flamestruct *fs = (flamestruct *)pwin->data; int i, j, k; - static alt = 0; + static int alt = 0; if (!(fs->cur_level++ % fs->max_levels)) { XClearWindow(dsp, fs->pwin->w); diff --git a/cde/programs/dtscreen/pyro.c b/cde/programs/dtscreen/pyro.c index 0501f55f..e485a25f 100644 --- a/cde/programs/dtscreen/pyro.c +++ b/cde/programs/dtscreen/pyro.c @@ -250,7 +250,7 @@ ignite(pwin, pp) x = random() % pp->width; xvel = FLOATRAND(-pp->maxvelx, pp->maxvelx); /* All this to stop too many rockets going offscreen: */ - if (x < pp->lmargin && xvel < 0.0 || x > pp->rmargin && xvel > 0.0) + if ((x < pp->lmargin && xvel < 0.0) || (x > pp->rmargin && xvel > 0.0)) xvel = -xvel; yvel = FLOATRAND(pp->minvely, pp->maxvely); fuse = INTRAND(MINFUSE, MAXFUSE); diff --git a/cde/programs/dtscreen/resource.c b/cde/programs/dtscreen/resource.c index 060a62e8..685207bd 100644 --- a/cde/programs/dtscreen/resource.c +++ b/cde/programs/dtscreen/resource.c @@ -101,6 +101,8 @@ extern void drawflame(); extern void initworm(); extern void drawworm(); +void CheckResources(void); + typedef struct { char *cmdline_arg; void (*lp_init) (); @@ -507,7 +509,6 @@ open_display() { if (display != NULL) { char *colon = strchr(display, ':'); - int n = colon - display; if (colon == NULL) #ifdef MIT_R5 @@ -710,7 +711,7 @@ GetResources(argc, argv) } -CheckResources() +void CheckResources(void) { int i; diff --git a/cde/programs/dtscreen/rotor.c b/cde/programs/dtscreen/rotor.c index ead68a8e..99ef7756 100644 --- a/cde/programs/dtscreen/rotor.c +++ b/cde/programs/dtscreen/rotor.c @@ -56,7 +56,7 @@ #define MAXANGLE 10000.0 /* irrectangular */ #define DEFAULTCOUNT 3 -typedef unsigned char Boolean; +/*typedef unsigned char Boolean; */ #define IDENT(X) X #if defined (__STDC__) || defined (AIXV3) -- 2.25.1