http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.16.tar.gz
[xscreensaver] / hacks / glx / engine.c
index 2febb1d42bd31857c8938de2eddce8c058830813..4744f3cb58ab8d88b22b38bb1e8b1c97d447b9b2 100644 (file)
@@ -88,10 +88,10 @@ static XrmOptionDescRec opts[] = {
 };
 
 static argtype vars[] = {
-  {(caddr_t *) &which_engine, "engine", "Engine", DEF_ENGINE, t_String},
-  {(caddr_t *) &move,         "move",   "Move",   DEF_WANDER, t_Bool},
-  {(caddr_t *) &spin,         "spin",   "Spin",   DEF_SPIN,   t_Bool},
-  {(caddr_t *) &do_titles,    "titles", "Titles", DEF_TITLES, t_Bool},
+  {&which_engine, "engine", "Engine", DEF_ENGINE, t_String},
+  {&move,         "move",   "Move",   DEF_WANDER, t_Bool},
+  {&spin,         "spin",   "Spin",   DEF_SPIN,   t_Bool},
+  {&do_titles,    "titles", "Titles", DEF_TITLES, t_Bool},
 };
 
 ModeSpecOpt engine_opts = {countof(opts), opts, countof(vars), vars, NULL};
@@ -251,13 +251,18 @@ engine_type engines[] = {
 #define ENG engines[engineType]
 
 /* given a number of cylinders and an included angle, finds matching engine */
-int find_engine(const char *name)
+int
+find_engine(char *name)
 {
-  int i;
+  unsigned int i;
+  char *s;
 
   if (!name || !*name || !strcasecmp (name, "(none)"))
     return (random() % countof(engines));
 
+  for (s = name; *s; s++)
+    if (*s == '-' || *s == '_') *s = ' ';
+
   for (i = 0; i < countof(engines); i++) {
     if (!strcasecmp(name, engines[i].engineName))
       return i;
@@ -762,8 +767,8 @@ void makeshaft (void)
 {
   int i;
   int j;
-  const static float crankThick = 0.2;
-  const static float crankDiam = 0.3;
+  static const float crankThick = 0.2;
+  static const float crankDiam = 0.3;
 
   i = glGenLists(1);
   glNewList(i, GL_COMPILE);
@@ -866,7 +871,7 @@ print_title_string (ModeInfo *mi, const char *string, GLfloat x, GLfloat y)
       glMatrixMode(GL_MODELVIEW);
       glPushMatrix();
       {
-        int i;
+        unsigned int i;
         int x2 = x;
         glLoadIdentity();