1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtscreen: Resolve (all) 11 warnigns caused by -Wall

This commit is contained in:
Peter Howkins 2012-11-16 15:57:36 +00:00
parent a67b65198d
commit b556633eca
6 changed files with 14 additions and 12 deletions

View file

@ -112,6 +112,7 @@ nl_catd scmc_catd; /* Cat descriptor for scmc conversion */
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
#include <string.h> #include <string.h>
#include <errno.h>
#include <X11/Intrinsic.h> /* For Boolean */ #include <X11/Intrinsic.h> /* For Boolean */
#include <X11/Shell.h> #include <X11/Shell.h>
@ -219,7 +220,6 @@ main(argc, argv)
{ {
XSetWindowAttributes xswa; XSetWindowAttributes xswa;
XGCValues xgcv; XGCValues xgcv;
XColor nullcolor;
int nitems = 0; int nitems = 0;
int window; int window;
int i; int i;
@ -375,7 +375,9 @@ main(argc, argv)
Win[window].gc = XCreateGC(dsp, Win[window].w, Win[window].gc = XCreateGC(dsp, Win[window].w,
GCForeground | GCBackground, &xgcv); GCForeground | GCBackground, &xgcv);
} }
nice(nicelevel); if(-1 == nice(nicelevel)) {
fprintf(stderr, "dtscreen: failed to set nice() level '%s'\n", strerror(errno));
}
justDisplay(); justDisplay();

View file

@ -41,6 +41,8 @@
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xos.h> #include <X11/Xos.h>
#include <Dt/Dt.h>
#define MAXSCREENS 3 #define MAXSCREENS 3
#define NUMCOLORS 64 #define NUMCOLORS 64
@ -74,6 +76,7 @@ extern void (*callback) ();
extern void (*init) (); extern void (*init) ();
extern void GetResources(); extern void GetResources();
extern void CheckResources();
extern void hsbramp(); extern void hsbramp();
extern void error(); extern void error();
extern long seconds(); extern long seconds();

View file

@ -119,7 +119,7 @@ recurse(fs, x, y, l)
register double x, y; register double x, y;
register int l; register int l;
{ {
int xp, yp, i; int i;
double nx, ny; double nx, ny;
if (l == fs->max_levels) { if (l == fs->max_levels) {
@ -128,10 +128,6 @@ recurse(fs, x, y, l)
return False; return False;
if (x > -1.0 && x < 1.0 && y > -1.0 && y < 1.0) { 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++; fs->num_points++;
if (fs->num_points > MAXBATCH) { /* point buffer size */ if (fs->num_points > MAXBATCH) { /* point buffer size */
XDrawPoints(dsp, fs->pwin->w, fs->pwin->gc, fs->pts, XDrawPoints(dsp, fs->pwin->w, fs->pwin->gc, fs->pts,
@ -162,7 +158,7 @@ drawflame(pwin)
flamestruct *fs = (flamestruct *)pwin->data; flamestruct *fs = (flamestruct *)pwin->data;
int i, j, k; int i, j, k;
static alt = 0; static int alt = 0;
if (!(fs->cur_level++ % fs->max_levels)) { if (!(fs->cur_level++ % fs->max_levels)) {
XClearWindow(dsp, fs->pwin->w); XClearWindow(dsp, fs->pwin->w);

View file

@ -250,7 +250,7 @@ ignite(pwin, pp)
x = random() % pp->width; x = random() % pp->width;
xvel = FLOATRAND(-pp->maxvelx, pp->maxvelx); xvel = FLOATRAND(-pp->maxvelx, pp->maxvelx);
/* All this to stop too many rockets going offscreen: */ /* 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; xvel = -xvel;
yvel = FLOATRAND(pp->minvely, pp->maxvely); yvel = FLOATRAND(pp->minvely, pp->maxvely);
fuse = INTRAND(MINFUSE, MAXFUSE); fuse = INTRAND(MINFUSE, MAXFUSE);

View file

@ -101,6 +101,8 @@ extern void drawflame();
extern void initworm(); extern void initworm();
extern void drawworm(); extern void drawworm();
void CheckResources(void);
typedef struct { typedef struct {
char *cmdline_arg; char *cmdline_arg;
void (*lp_init) (); void (*lp_init) ();
@ -507,7 +509,6 @@ open_display()
{ {
if (display != NULL) { if (display != NULL) {
char *colon = strchr(display, ':'); char *colon = strchr(display, ':');
int n = colon - display;
if (colon == NULL) if (colon == NULL)
#ifdef MIT_R5 #ifdef MIT_R5
@ -710,7 +711,7 @@ GetResources(argc, argv)
} }
CheckResources() void CheckResources(void)
{ {
int i; int i;

View file

@ -56,7 +56,7 @@
#define MAXANGLE 10000.0 /* irrectangular */ #define MAXANGLE 10000.0 /* irrectangular */
#define DEFAULTCOUNT 3 #define DEFAULTCOUNT 3
typedef unsigned char Boolean; /*typedef unsigned char Boolean; */
#define IDENT(X) X #define IDENT(X) X
#if defined (__STDC__) || defined (AIXV3) #if defined (__STDC__) || defined (AIXV3)