Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit/xorg-server/dist/hw/sun Remove redundant comm...



details:   https://anonhg.NetBSD.org/xsrc/rev/4f2defa763b8
branches:  trunk
changeset: 10538:4f2defa763b8
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Aug 09 07:35:42 2020 +0000

description:
Remove redundant command option arg checks.

diffstat:

 external/mit/xorg-server/dist/hw/sun/sun.h     |   2 ++
 external/mit/xorg-server/dist/hw/sun/sunCfb.c  |  26 +++++++++-----------------
 external/mit/xorg-server/dist/hw/sun/sunInit.c |   8 ++++----
 external/mit/xorg-server/dist/hw/sun/sunIo.c   |   2 ++
 4 files changed, 17 insertions(+), 21 deletions(-)

diffs (141 lines):

diff -r 10bde4dfb47c -r 4f2defa763b8 external/mit/xorg-server/dist/hw/sun/sun.h
--- a/external/mit/xorg-server/dist/hw/sun/sun.h        Sun Aug 09 07:29:32 2020 +0000
+++ b/external/mit/xorg-server/dist/hw/sun/sun.h        Sun Aug 09 07:35:42 2020 +0000
@@ -296,6 +296,8 @@
 extern sunFbDataRec    sunFbData[];
 extern fbFd            sunFbs[];
 extern Bool            sunSwapLkeys;
+extern Bool            sunForceMono;
+extern Bool            sunDebug;
 extern Bool            sunFlipPixels;
 extern Bool            sunFbInfo;
 extern Bool            sunCG4Frob;
diff -r 10bde4dfb47c -r 4f2defa763b8 external/mit/xorg-server/dist/hw/sun/sunCfb.c
--- a/external/mit/xorg-server/dist/hw/sun/sunCfb.c     Sun Aug 09 07:29:32 2020 +0000
+++ b/external/mit/xorg-server/dist/hw/sun/sunCfb.c     Sun Aug 09 07:35:42 2020 +0000
@@ -98,7 +98,7 @@
 static void CGRestoreColormap(ScreenPtr);
 static void CGScreenInitCommon(ScreenPtr);
 static void CGScreenInit(ScreenPtr);
-static void checkMono(int, char **);
+static void checkMono(void);
 #ifdef INCLUDE_CG2_HEADER
 static void CG2UpdateColormap(ScreenPtr, int, int, u_char *, u_char *, u_char *);
 static void CG2GetColormap(ScreenPtr, int, int, u_char *, u_char *, u_char *);
@@ -308,13 +308,11 @@
 }
 
 static void
-checkMono(int argc, char** argv)
+checkMono(void)
 {
-    int i;
 
-    for (i = 1; i < argc; i++)
-       if (strcmp (argv[i], "-mono") == 0)
-           ErrorF ("-mono not appropriate for CG3/CG4/CG6\n");
+    if (sunForceMono)
+       ErrorF("-mono not appropriate for CG3/CG4/CG6\n");
 }
 
 /*
@@ -336,7 +334,7 @@
 {
     int        screen = pScreen->myNum;
 
-    checkMono (argc, argv);
+    checkMono();
     sunFbs[screen].EnterLeave = (void (*)(ScreenPtr, int))NoopDDA;
     return sunInitCommon (screen, pScreen, (off_t) CG3_MMAP_OFFSET,
        sunCfbScreenInit, CGScreenInit,
@@ -352,7 +350,7 @@
 {
     int        screen = pScreen->myNum;
 
-    checkMono (argc, argv);
+    checkMono();
     sunFbs[screen].EnterLeave = (void (*)(ScreenPtr, int))NoopDDA;
     return sunInitCommon (screen, pScreen, (off_t) 0,
        sunCfbScreenInit, CGScreenInit,
@@ -457,18 +455,12 @@
 )
 {
     int        screen = pScreen->myNum;
-    int                i;
     Bool       ret;
-    Bool       mono = FALSE;
-
-    for (i = 1; i < argc; i++)
-       if (strcmp (argv[i], "-mono") == 0)
-           mono = TRUE;
 
     sunFbs[screen].EnterLeave = (void (*)(ScreenPtr, int))NoopDDA;
     pScreen->SaveScreen = CG2SaveScreen;
 #ifndef LOWMEMFTPT
-    if (mono) {
+    if (sunForceMono) {
        pScreen->whitePixel = 0;
        pScreen->blackPixel = 1;
        sunFbs[screen].info.fb_depth = 1;
@@ -518,7 +510,7 @@
 {
     int screen = pScreen->myNum;
 
-    checkMono (argc, argv);
+    checkMono();
     if (sunCG4Frob)
        sunFbs[screen].EnterLeave = (void (*)(ScreenPtr, int))NoopDDA;
     else
@@ -543,7 +535,7 @@
     void *fb;
     int screen = pScreen->myNum;
 
-    checkMono (argc, argv);
+    checkMono();
     if (!sunScreenAllocate (pScreen))
        return FALSE;
     if (!sunFbs[screen].fb) {
diff -r 10bde4dfb47c -r 4f2defa763b8 external/mit/xorg-server/dist/hw/sun/sunInit.c
--- a/external/mit/xorg-server/dist/hw/sun/sunInit.c    Sun Aug 09 07:29:32 2020 +0000
+++ b/external/mit/xorg-server/dist/hw/sun/sunInit.c    Sun Aug 09 07:35:42 2020 +0000
@@ -130,6 +130,8 @@
 static Bool    sunDevsInited = FALSE;
 
 Bool sunSwapLkeys = FALSE;
+Bool sunDebug = FALSE;
+Bool sunForceMono = FALSE;
 Bool sunFlipPixels = FALSE;
 Bool sunFbInfo = FALSE;
 Bool sunCG4Frob = FALSE;
@@ -589,10 +591,8 @@
        monitorResolution = 90;
     if (RunFromSigStopParent)
        nonBlockConsole = 1;
-    for (i = 1; i < argc; i++) {
-       if (!strcmp(argv[i],"-debug"))
-           nonBlockConsole = 0;
-    }
+    if (sunDebug)
+       nonBlockConsole = 0;
 
     /*
      * Writes to /dev/console can block - causing an
diff -r 10bde4dfb47c -r 4f2defa763b8 external/mit/xorg-server/dist/hw/sun/sunIo.c
--- a/external/mit/xorg-server/dist/hw/sun/sunIo.c      Sun Aug 09 07:29:32 2020 +0000
+++ b/external/mit/xorg-server/dist/hw/sun/sunIo.c      Sun Aug 09 07:35:42 2020 +0000
@@ -205,6 +205,7 @@
        return 1;
     }
     if (strcmp (argv[i], "-debug") == 0) {     /* -debug */
+       sunDebug = TRUE;
        return 1;
     }
     if (strcmp (argv[i], "-dev") == 0) {       /* -dev /dev/mumble */
@@ -212,6 +213,7 @@
        return 2;
     }
     if (strcmp (argv[i], "-mono") == 0) {      /* -mono */
+       sunForceMono = TRUE;
        return 1;
     }
     if (strcmp (argv[i], "-zaphod") == 0) {    /* -zaphod */



Home | Main Index | Thread Index | Old Index