dtwm: Remove define MOTIF_ONE_DOT_ONE, backwards compatibility for motif 1.1, CDE...
[oweals/cde.git] / cde / programs / dtscreen / pyro.c
index a40323efcd37178313603994a3a5dc73011c888e..4cc3ce2a7b553a8efee03ccc011902fd73593af5 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these libraries and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
 /* $XConsortium: pyro.c /main/3 1995/11/02 16:07:59 rswiston $ */
 /*
  */
@@ -28,6 +50,8 @@
 
 #include "dtscreen.h"
 #include <math.h>
+#include <stdlib.h>
+
 #define TWOPI 6.2831853
 
 /* Define this >1 to get small rectangles instead of points */
@@ -119,8 +143,7 @@ static int  orig_p_ignite;
 static int  just_started = True;/* Greet the user right away */
 
 void
-initpyro(pwin)
-    perwindow *pwin;
+initpyro(perwindow *pwin)
 {
     pyrostruct *pp;
     rocket     *rp;
@@ -186,8 +209,7 @@ initpyro(pwin)
 
 /*ARGSUSED*/
 void
-drawpyro(pwin)
-    perwindow *pwin;
+drawpyro(perwindow *pwin)
 {
     pyrostruct *pp;
     rocket     *rp;
@@ -215,9 +237,7 @@ drawpyro(pwin)
 }
 
 static void
-ignite(pwin, pp)
-    perwindow *pwin;
-    pyrostruct *pp;
+ignite(perwindow *pwin, pyrostruct *pp)
 {
     rocket     *rp;
     int         multi, shelltype, nstars, fuse, npix, pix, color1, color2;
@@ -226,7 +246,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);
@@ -268,10 +288,7 @@ ignite(pwin, pp)
 }
 
 static void
-animate(pwin, pp, rp)
-    perwindow *pwin;
-    pyrostruct *pp;
-    rocket     *rp;
+animate(perwindow *pwin, pyrostruct *pp, rocket *rp)
 {
     int         starn;
     float       r, theta;
@@ -305,10 +322,7 @@ animate(pwin, pp, rp)
 }
 
 static void
-shootup(pwin, pp, rp)
-    perwindow *pwin;
-    pyrostruct *pp;
-    rocket     *rp;
+shootup(perwindow *pwin, pyrostruct *pp, rocket *rp)
 {
     XFillRectangle(dsp, pwin->w, pp->bgGC, (int) (rp->x), (int) (rp->y),
                   ROCKETW, ROCKETH + 3);
@@ -326,10 +340,7 @@ shootup(pwin, pp, rp)
 }
 
 static void
-burst(pwin, pp, rp)
-    perwindow *pwin;
-    pyrostruct *pp;
-    rocket     *rp;
+burst(perwindow *pwin, pyrostruct *pp, rocket *rp)
 {
     register int starn;
     register int nstars, stype;