]> thyrsus.com Git - xve.git/commitdiff
Remove the SVr4 dependency.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 25 Oct 1994 06:28:56 +0000 (06:28 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 25 Oct 1994 06:28:56 +0000 (06:28 +0000)
xve.c

diff --git a/xve.c b/xve.c
index ccdce42d8450ca5e93dbe2758547bf45523744ce..307152ac22e577bda4401bc1821c79e3d930bf4c 100644 (file)
--- a/xve.c
+++ b/xve.c
@@ -30,6 +30,9 @@ typedef int bool;
 #define XCONFIG        "/usr/X386/lib/X11/Xconfig"
 #endif
 
+/* Floating-point modulo operation.  SVr4 has this directly */
+#define fmodf(x, y)    (x - (floor(x/y) * y))
+
 /**************************************************************************
  *
  * Globals 
@@ -523,88 +526,6 @@ static struct vparam controls[] =
     {"RSH",    1,      EDIT,   "Right shift (in units of 8 pixels)"},
 };
 
-static int tweak_config()
-{
-    int        newlevel, c;
-    float diff;
-
-
-    c = '\0';
-    for (;;)
-    {
-       if (c)
-           c = getchoice("Command", "abx", 'x');
-       else
-       {
-           (void) printf("\nRecomputing...\n");
-           c = '?';
-       }
-
-       switch (c)
-       {
-       case 'a':                               /* change HSP */
-           diff = (hsp.value * dcf.value);
-           getfloat(&hsp);
-           diff -= (hsp.value * dcf.value);
-           hs1.value += (diff / 2);
-           hs2.value -= (diff / 2);
-           break;
-
-       case 'b':                               /* change VSP width */
-           diff = (vsp.value * dcf.value) / vfl.value;
-           getfloat(&vsp);
-           diff -= (vsp.value * dcf.value) / vfl.value;
-           vs1.value += (diff / 2);
-           vs2.value -= (diff / 2);
-           break;
-
-
-       case 'c':                               /* shift left */
-           getint(&lsh);
-           hs1.value += lsh.value;
-           hs2.value += lsh.value;
-           break;
-
-       case 'd':                               /* shift right */
-           getint(&rsh);
-           hs1.value += rsh.value;
-           hs2.value += rsh.value;
-           break;
-
-       case 'x':
-           return(DONE);
-
-       default:
-           (void) printf("Available commands are:\n");
-           /* FALL THROUGH */
-       case '?':
-           (void) printf("a -- change horizontal sync pulse width (HSP).\n");
-           (void) printf("b -- change vertical sync pulse width (VSP).\n");
-           (void) printf("c -- shift image to the left.\n");
-           (void) printf("d -- shift image to the right.\n");
-           (void) printf("? -- display commands.\n");
-           (void) printf("x -- return to main menu.\n");
-           break;
-       }
-
-       redisplay(&hfl, &vs2);
-
-       (void) printf("Current timing mumbers: %d %d %d %d    %d %d %d %d\n",
-             (int)hr.value, (int)hs1.value, (int)hs2.value, (int)hfl.value,
-             (int)vr.value, (int)vs1.value, (int)vs2.value, (int)vfl.value);
-
-       if ((newlevel = sanecheck(EDIT)) < EDIT)
-           return(newlevel);
-       (void) putchar('\n');
-    }
-}
-
-/**************************************************************************
- *
- * Main sequence
- *
- **************************************************************************/
-
 static int sanecheck(const int level)
 /* check for configuration problems */
 {
@@ -700,6 +621,88 @@ static int sanecheck(const int level)
        return(level + 1);
 }
 
+static int tweak_config()
+{
+    int        newlevel, c;
+    float diff;
+
+
+    c = '\0';
+    for (;;)
+    {
+       if (c)
+           c = getchoice("Command", "abx", 'x');
+       else
+       {
+           (void) printf("\nRecomputing...\n");
+           c = '?';
+       }
+
+       switch (c)
+       {
+       case 'a':                               /* change HSP */
+           diff = (hsp.value * dcf.value);
+           getfloat(&hsp);
+           diff -= (hsp.value * dcf.value);
+           hs1.value += (diff / 2);
+           hs2.value -= (diff / 2);
+           break;
+
+       case 'b':                               /* change VSP width */
+           diff = (vsp.value * dcf.value) / vfl.value;
+           getfloat(&vsp);
+           diff -= (vsp.value * dcf.value) / vfl.value;
+           vs1.value += (diff / 2);
+           vs2.value -= (diff / 2);
+           break;
+
+
+       case 'c':                               /* shift left */
+           getint(&lsh);
+           hs1.value += lsh.value;
+           hs2.value += lsh.value;
+           break;
+
+       case 'd':                               /* shift right */
+           getint(&rsh);
+           hs1.value += rsh.value;
+           hs2.value += rsh.value;
+           break;
+
+       case 'x':
+           return(DONE);
+
+       default:
+           (void) printf("Available commands are:\n");
+           /* FALL THROUGH */
+       case '?':
+           (void) printf("a -- change horizontal sync pulse width (HSP).\n");
+           (void) printf("b -- change vertical sync pulse width (VSP).\n");
+           (void) printf("c -- shift image to the left.\n");
+           (void) printf("d -- shift image to the right.\n");
+           (void) printf("? -- display commands.\n");
+           (void) printf("x -- return to main menu.\n");
+           break;
+       }
+
+       redisplay(&hfl, &vs2);
+
+       (void) printf("Current timing mumbers: %d %d %d %d    %d %d %d %d\n",
+             (int)hr.value, (int)hs1.value, (int)hs2.value, (int)hfl.value,
+             (int)vr.value, (int)vs1.value, (int)vs2.value, (int)vfl.value);
+
+       if ((newlevel = sanecheck(EDIT)) < EDIT)
+           return(newlevel);
+       (void) putchar('\n');
+    }
+}
+
+/**************************************************************************
+ *
+ * Main sequence
+ *
+ **************************************************************************/
+
 main(int argc, char **argv)
 {
     int        enable;