diff --git a/driver/lock.c b/driver/lock.c index 7c92be6..2ad1e0f 100644 --- a/driver/lock.c +++ b/driver/lock.c @@ -1,5 +1,5 @@ /* lock.c --- handling the password dialog for locking-mode. - * xscreensaver, Copyright (c) 1993-2014 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-2014, Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -534,7 +534,7 @@ make_passwd_window (saver_info *si, /* Measure the info_label. */ if (pw->info_label->overall_width > pw->width) pw->width = pw->info_label->overall_width; - h2 += pw->info_label->overall_height; + h2 += pw->info_label->overall_height; /* Measure the user string. */ XTextExtents (pw->passwd_font, diff --git a/hacks/barcode.c b/hacks/barcode.c index d659216..8feea68 100644 --- a/hacks/barcode.c +++ b/hacks/barcode.c @@ -824,7 +824,7 @@ static void drawDigitChar (struct state *st, Bitmap *b, int x, int y, char c) if ((c < '0') || (c > '9')) c = '0'; - bitmapDrawChar5x8 (b, x, y, c); + bitmapDrawChar5x8 (b, x, y, c); } /* draw a upc/ean digit at the given coordinates */ diff --git a/hacks/glx/engine.c b/hacks/glx/engine.c index b31cf0d..c7f87a3 100644 --- a/hacks/glx/engine.c +++ b/hacks/glx/engine.c @@ -326,8 +326,10 @@ static int cylinder (Engine *e, GLfloat x, GLfloat y, GLfloat z, for (a = sangle ; a <= angle || b <= angle ; a+= step) { y2=outer*(float)e->sin_table[a]+y; z2=outer*(float)e->cos_table[a]+z; - if (endcaps) - y2c[a] = y2; z2c[a] = z2; /* cache for later */ + if (endcaps) { + y2c[a] = y2; + z2c[a] = z2; /* cache for later */ + } if (tube) { Y2=inner*(float)e->sin_table[a]+y; Z2=inner*(float)e->cos_table[a]+z; diff --git a/hacks/glx/glcells.c b/hacks/glx/glcells.c index c312f0c..f5e486e 100644 --- a/hacks/glx/glcells.c +++ b/hacks/glx/glcells.c @@ -1147,9 +1147,11 @@ static void tick( State *st ) /* have a snack */ x = ((int)st->cell[b].x)/4; - if (x<0) x=0; if (x>=w4) x = w4-1; + if (x<0) x=0; + if (x>=w4) x = w4-1; y = ((int)st->cell[b].y)/4; - if (y<0) y=0; if (y>=h4) y = h4-1; + if (y<0) y=0; + if (y>=h4) y = h4-1; offset = x+y*w4; diff --git a/hacks/glx/glforestfire.c b/hacks/glx/glforestfire.c index 3697b2e..e880cfa 100644 --- a/hacks/glx/glforestfire.c +++ b/hacks/glx/glforestfire.c @@ -621,13 +621,15 @@ static Bool inittree(ModeInfo * mi) return False; } /* initialise positions */ - for(i=0;inum_trees;i++) - do { - fs->treepos[i].x =vrnd()*TREEOUTR*2.0-TREEOUTR; - fs->treepos[i].y =0.0; - fs->treepos[i].z =vrnd()*TREEOUTR*2.0-TREEOUTR; - dist=sqrt(fs->treepos[i].x *fs->treepos[i].x +fs->treepos[i].z *fs->treepos[i].z ); - } while((distTREEOUTR)); + for(i=0;inum_trees;i++) { + do { + fs->treepos[i].x =vrnd()*TREEOUTR*2.0-TREEOUTR; + fs->treepos[i].y =0.0; + fs->treepos[i].z =vrnd()*TREEOUTR*2.0-TREEOUTR; + dist = sqrt(fs->treepos[i].x * fs->treepos[i].x + + fs->treepos[i].z * fs->treepos[i].z); + } while((distTREEOUTR)); + } return True; } diff --git a/hacks/glx/molecule.c b/hacks/glx/molecule.c index cbc07b1..2423802 100644 --- a/hacks/glx/molecule.c +++ b/hacks/glx/molecule.c @@ -1,4 +1,4 @@ -/* molecule, Copyright (c) 2001-2014 Jamie Zawinski +/* molecule, Copyright (c) 2001-2016 Jamie Zawinski * Draws molecules, based on coordinates from PDB (Protein Data Base) files. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -479,9 +479,12 @@ draw_bounding_box (ModeInfo *mi) glColor3f (c2[0], c2[1], c2[2]); glBegin(GL_LINES); - if (x1 > 0) x1 = 0; if (x2 < 0) x2 = 0; - if (y1 > 0) y1 = 0; if (y2 < 0) y2 = 0; - if (z1 > 0) z1 = 0; if (z2 < 0) z2 = 0; + if (x1 > 0) x1 = 0; + if (x2 < 0) x2 = 0; + if (y1 > 0) y1 = 0; + if (y2 < 0) y2 = 0; + if (z1 > 0) z1 = 0; + if (z2 < 0) z2 = 0; glVertex3f(x1, 0, 0); glVertex3f(x2, 0, 0); glVertex3f(0 , y1, 0); glVertex3f(0, y2, 0); glVertex3f(0, 0, z1); glVertex3f(0, 0, z2); diff --git a/hacks/penetrate.c b/hacks/penetrate.c index 611cf84..2ce18e0 100644 --- a/hacks/penetrate.c +++ b/hacks/penetrate.c @@ -172,10 +172,11 @@ static void launch (struct state *st, int xlim, int ylim, int src) m->splits = 0; if (m->jenis < 50) { int j = ylim * 0.4; - if (j) + if (j) { m->splits = random() % j; if (m->splits < ylim * 0.08) m->splits = 0; + } } /* special if we're from another missile */ diff --git a/hacks/speedmine.c b/hacks/speedmine.c index 81c4686..02d9283 100644 --- a/hacks/speedmine.c +++ b/hacks/speedmine.c @@ -478,7 +478,8 @@ generate_terrain (struct state *st, int start, int end, int final) for (w= diff/2, l=TERRAIN_BREADTH/4; w >= final || l >= final; w /= 2, l /= 2) { - if (w<1) w=1; if (l<1) l=1; + if (w<1) w=1; + if (l<1) l=1; for (i=start+w-1; i < end; i += (w*2)) { ip = i-w; MODULO(ip, TERRAIN_LENGTH); diff --git a/hacks/swirl.c b/hacks/swirl.c index d647b04..49529f6 100644 --- a/hacks/swirl.c +++ b/hacks/swirl.c @@ -1355,78 +1355,78 @@ draw_swirl(ModeInfo * mi) rotate_colors(mi->xgwa.screen, MI_COLORMAP(mi), swirl->rgb_values, swirl->colours, 1); #else /* !STANDALONE */ - /* rotate the colours */ - install_map(MI_DISPLAY(mi), swirl, swirl->dshift); + /* rotate the colours */ + install_map(MI_DISPLAY(mi), swirl, swirl->dshift); #endif /* !STANDALONE */ - /* draw a batch of points */ - swirl->batch_todo = BATCH_DRAW; - while ((swirl->batch_todo > 0) && swirl->drawing) { - /* draw a point */ - draw_point(mi, swirl); + /* draw a batch of points */ + swirl->batch_todo = BATCH_DRAW; + while ((swirl->batch_todo > 0) && swirl->drawing) { + /* draw a point */ + draw_point(mi, swirl); - /* move to the next point */ - next_point(swirl); + /* move to the next point */ + next_point(swirl); - /* done a point */ - swirl->batch_todo--; - } + /* done a point */ + swirl->batch_todo--; + } } else { #ifdef STANDALONE if (mi->writable_p) rotate_colors(mi->xgwa.screen, MI_COLORMAP(mi), swirl->rgb_values, swirl->colours, 1); #else /* !STANDALONE */ - /* rotate the colours */ - install_map(MI_DISPLAY(mi), swirl, swirl->shift); + /* rotate the colours */ + install_map(MI_DISPLAY(mi), swirl, swirl->shift); #endif /* !STANDALONE */ - /* time for a higher resolution? */ - if (swirl->resolution > swirl->max_resolution) { - /* move to higher resolution */ - swirl->resolution--; - - /* calculate the pixel step for this resulution */ - swirl->r = (1 << (swirl->resolution - 1)); - - /* start drawing again */ - swirl->drawing = True; - - /* start in the middle of the screen */ - swirl->x = (swirl->width - swirl->r) / 2; - swirl->y = (swirl->height - swirl->r) / 2; - - /* initialise spiral drawing parameters */ - swirl->direction = DRAW_RIGHT; - swirl->dir_todo = 1; - swirl->dir_done = 0; - } else { - /* all done, decide when to restart */ - if (swirl->start_again == -1) { - /* start the counter */ - swirl->start_again = RESTART; - } else if (swirl->start_again == 0) { - /* reset the counter */ - swirl->start_again = -1; + /* time for a higher resolution? */ + if (swirl->resolution > swirl->max_resolution) { + /* move to higher resolution */ + swirl->resolution--; + + /* calculate the pixel step for this resulution */ + swirl->r = (1 << (swirl->resolution - 1)); + + /* start drawing again */ + swirl->drawing = True; + + /* start in the middle of the screen */ + swirl->x = (swirl->width - swirl->r) / 2; + swirl->y = (swirl->height - swirl->r) / 2; + + /* initialise spiral drawing parameters */ + swirl->direction = DRAW_RIGHT; + swirl->dir_todo = 1; + swirl->dir_done = 0; + } else { + /* all done, decide when to restart */ + if (swirl->start_again == -1) { + /* start the counter */ + swirl->start_again = RESTART; + } else if (swirl->start_again == 0) { + /* reset the counter */ + swirl->start_again = -1; #ifdef STANDALONE - /* Pick a new colormap! */ - XClearWindow (MI_DISPLAY(mi), MI_WINDOW(mi)); - free_colors (mi->xgwa.screen, MI_COLORMAP(mi), - mi->colors, mi->npixels); - make_smooth_colormap (mi->xgwa.screen, MI_VISUAL(mi), - MI_COLORMAP(mi), - mi->colors, &mi->npixels, True, - &mi->writable_p, True); - swirl->colours = mi->npixels; + /* Pick a new colormap! */ + XClearWindow (MI_DISPLAY(mi), MI_WINDOW(mi)); + free_colors (mi->xgwa.screen, MI_COLORMAP(mi), + mi->colors, mi->npixels); + make_smooth_colormap (mi->xgwa.screen, MI_VISUAL(mi), + MI_COLORMAP(mi), + mi->colors, &mi->npixels, True, + &mi->writable_p, True); + swirl->colours = mi->npixels; #endif /* STANDALONE */ - /* start again */ - init_swirl(mi); - } else - /* decrement the counter */ - swirl->start_again--; - } + /* start again */ + init_swirl(mi); + } else + /* decrement the counter */ + swirl->start_again--; + } } } } diff --git a/hacks/t3d.c b/hacks/t3d.c index 08df871..576ad3c 100644 --- a/hacks/t3d.c +++ b/hacks/t3d.c @@ -563,10 +563,15 @@ fill_kugel(struct state *st, int i, Pixmap buf, int setcol) else if(-ra<40.0) inc=2; if(setcol) { - if (m==27) col=33; + if (m==27) + col=33; else col=(int)(m); - if (col>33) col=33; col/=3; + + if (col>33) + col=33; + + col/=3; setink(st->colors[col].pixel); } diff --git a/hacks/xlyap.c b/hacks/xlyap.c index 2d36cb9..f3fb85e 100644 --- a/hacks/xlyap.c +++ b/hacks/xlyap.c @@ -827,7 +827,7 @@ Getkey(struct state *st, XKeyEvent *event) unsigned char key; int i; if (XLookupString(event, (char *)&key, sizeof(key), (KeySym *)0, - (XComposeStatus *) 0) > 0) + (XComposeStatus *) 0) > 0) { if (st->reset_countdown) st->reset_countdown = st->linger; @@ -956,6 +956,7 @@ Getkey(struct state *st, XKeyEvent *event) case 'H': print_help(st); return True; default: return False; } + } return False; }