[PATCH 07/10] xfree86: improve readability of synthesized device.

Peter Hutterer peter.hutterer at who-t.net
Sun Jul 3 23:09:13 PDT 2011


No functional changes.

The options we assign are the ones from the Pointer/Keyboard device so we
might as well use those readable names instead of dev[count-1]->options.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 hw/xfree86/common/xf86Config.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 5a64b8a..74a7702 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1208,15 +1208,15 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     if (foundPointer && confInput) {
 	foundPointer = configInput(&Pointer, confInput, from);
         if (foundPointer) {
+	    Pointer.options = xf86addNewOption(Pointer.options,
+					       xnfstrdup("CorePointer"), "on");
 	    count++;
 	    devs = xnfrealloc(servlayoutp->inputs,
 			      (count + 1) * sizeof(InputInfoPtr));
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
-	    *devs[count - 1] = Pointer;
-	    devs[count - 1]->options =
-				xf86addNewOption(devs[count -1]->options,
-				    xnfstrdup("CorePointer"), "on");
 	    devs[count] = NULL;
+
+	    *devs[count - 1] = Pointer;
 	    servlayoutp->inputs = devs;
 	}
     }
@@ -1253,14 +1253,15 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	confInput = &defPtr;
 	foundPointer = configInput(&Pointer, confInput, from);
         if (foundPointer) {
+	    Pointer.options = xf86addNewOption(NULL,
+					       xnfstrdup("AlwaysCore"), "on");
 	    count++;
 	    devs = xnfrealloc(servlayoutp->inputs,
 			      (count + 1) * sizeof(InputInfoPtr));
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
-	    *devs[count - 1] = Pointer;
-	    devs[count - 1]->options =
-				xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), "on");
 	    devs[count] = NULL;
+
+	    *devs[count - 1] = Pointer;
 	    servlayoutp->inputs = devs;
 	}
     }
@@ -1349,15 +1350,15 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     if (foundKeyboard && confInput) {
 	foundKeyboard = configInput(&Keyboard, confInput, from);
         if (foundKeyboard) {
+	    Keyboard.options = xf86addNewOption(Keyboard.options,
+						xnfstrdup("CoreKeyboard"), "on");
 	    count++;
 	    devs = xnfrealloc(servlayoutp->inputs,
 			      (count + 1) * sizeof(InputInfoPtr));
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
-	    *devs[count - 1] = Keyboard;
-	    devs[count - 1]->options =
-				xf86addNewOption(devs[count - 1]->options,
-				    xnfstrdup("CoreKeyboard"), "on");
 	    devs[count] = NULL;
+
+	    *devs[count - 1] = Keyboard;
 	    servlayoutp->inputs = devs;
 	}
     }
-- 
1.7.5.4



More information about the xorg-devel mailing list