X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=hacks%2Fglx%2Fengine.c;h=4744f3cb58ab8d88b22b38bb1e8b1c97d447b9b2;hb=9c9d475ff889ed8be02e8ce8c17da28b93278fca;hp=2febb1d42bd31857c8938de2eddce8c058830813;hpb=96bdd7cf6ea60c418a76921acaf0e34d6f5be930;p=xscreensaver diff --git a/hacks/glx/engine.c b/hacks/glx/engine.c index 2febb1d4..4744f3cb 100644 --- a/hacks/glx/engine.c +++ b/hacks/glx/engine.c @@ -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();