xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Fri Apr 3 08:08:42 PDT 2009


 hw/kdrive/ephyr/ephyr.c    |    4 ++--
 hw/kdrive/linux/bus.c      |    2 +-
 hw/kdrive/linux/evdev.c    |    6 +++---
 hw/kdrive/linux/keyboard.c |    4 ++--
 hw/kdrive/linux/mouse.c    |    2 +-
 hw/kdrive/linux/ms.c       |    4 ++--
 hw/kdrive/linux/ps2.c      |    4 ++--
 hw/kdrive/linux/tslib.c    |    2 +-
 hw/kdrive/src/kdrive.c     |   11 -----------
 hw/kdrive/src/kdrive.h     |    4 +---
 hw/kdrive/src/kinfo.c      |    2 +-
 hw/kdrive/src/kinput.c     |   14 +++++++-------
 12 files changed, 23 insertions(+), 36 deletions(-)

New commits:
commit d2690375dfd994817f004cda133ca2a492c0b956
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Apr 3 11:06:50 2009 -0400

    kdrive: s/KdSaveString/strdup/g
    
    This isn't even funny anymore.

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index fc3d940..345ae5b 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -1073,7 +1073,7 @@ MouseInit (KdPointerInfo *pi)
     ((EphyrPointerPrivate *)pi->driverPrivate)->enabled = FALSE;
     pi->nAxes = 3;
     pi->nButtons = 32;
-    pi->name = KdSaveString("Xephyr virtual mouse");
+    pi->name = strdup("Xephyr virtual mouse");
     ephyrMouse = pi;
     return Success;
 }
@@ -1127,7 +1127,7 @@ EphyrKeyboardInit (KdKeyboardInfo *ki)
   ki->keySyms.mapWidth = ephyrKeySyms.mapWidth;
   xfree(ki->keySyms.map);
   ki->keySyms.map = ephyrKeySyms.map;
-  ki->name = KdSaveString("Xephyr virtual keyboard");
+  ki->name = strdup("Xephyr virtual keyboard");
   ephyrKbd = ki;
   return Success;
 }
diff --git a/hw/kdrive/linux/bus.c b/hw/kdrive/linux/bus.c
index a0d9b12..ba8a6cd 100644
--- a/hw/kdrive/linux/bus.c
+++ b/hw/kdrive/linux/bus.c
@@ -77,7 +77,7 @@ BusInit (KdPointerInfo *pi)
                 close(fd);
                 if (pi->path)
                     xfree(pi->path);
-                pi->path = KdSaveString(BusNames[i]);
+                pi->path = strdup(BusNames[i]);
                 return Success;
             }
         }
diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c
index fcec0f8..e831c9a 100644
--- a/hw/kdrive/linux/evdev.c
+++ b/hw/kdrive/linux/evdev.c
@@ -209,7 +209,7 @@ EvdevPtrInit (KdPointerInfo *pi)
         for (i = 0; i < NUM_DEFAULT_EVDEV; i++) {
             fd = open (kdefaultEvdev[i], 2);
             if (fd >= 0) {
-                pi->path = KdSaveString (kdefaultEvdev[i]);
+                pi->path = strdup (kdefaultEvdev[i]);
                 break;
             }
         }
@@ -224,7 +224,7 @@ EvdevPtrInit (KdPointerInfo *pi)
 
     close(fd);
 
-    pi->name = KdSaveString("Evdev mouse");
+    pi->name = strdup("Evdev mouse");
 
     return Success;
 }
@@ -411,7 +411,7 @@ EvdevKbdInit (KdKeyboardInfo *ki)
 
     close (fd);
 
-    ki->name = KdSaveString("Evdev keyboard");
+    ki->name = strdup("Evdev keyboard");
 
     readMapping(ki);
 
diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c
index d36c31d..28ece3d 100644
--- a/hw/kdrive/linux/keyboard.c
+++ b/hw/kdrive/linux/keyboard.c
@@ -737,10 +737,10 @@ LinuxKeyboardInit (KdKeyboardInfo *ki)
 
     if (ki->path)
         xfree(ki->path);
-    ki->path = KdSaveString("console");
+    ki->path = strdup("console");
     if (ki->name)
         xfree(ki->name);
-    ki->name = KdSaveString("Linux console keyboard");
+    ki->name = strdup("Linux console keyboard");
 
     readKernelMapping (ki);
 
diff --git a/hw/kdrive/linux/mouse.c b/hw/kdrive/linux/mouse.c
index f2fae94..02214b3 100644
--- a/hw/kdrive/linux/mouse.c
+++ b/hw/kdrive/linux/mouse.c
@@ -944,7 +944,7 @@ MouseInit (KdPointerInfo *pi)
         for (i = 0; i < NUM_DEFAULT_MOUSE; i++) {
             fd = open (kdefaultMouse[i], 2);
             if (fd >= 0) {
-                pi->path = KdSaveString (kdefaultMouse[i]);
+                pi->path = strdup (kdefaultMouse[i]);
                 break;
             }
         }
diff --git a/hw/kdrive/linux/ms.c b/hw/kdrive/linux/ms.c
index 4cf8822..5786ed1 100644
--- a/hw/kdrive/linux/ms.c
+++ b/hw/kdrive/linux/ms.c
@@ -100,9 +100,9 @@ MsInit (KdPointerInfo *pi)
         return BadImplementation;
 
     if (!pi->path || strcmp(pi->path, "auto"))
-        pi->path = KdSaveString("/dev/mouse");
+        pi->path = strdup("/dev/mouse");
     if (!pi->name)
-        pi->name = KdSaveString("Microsoft protocol mouse");
+        pi->name = strdup("Microsoft protocol mouse");
     
     return Success; 
 }
diff --git a/hw/kdrive/linux/ps2.c b/hw/kdrive/linux/ps2.c
index 31516a7..3967584 100644
--- a/hw/kdrive/linux/ps2.c
+++ b/hw/kdrive/linux/ps2.c
@@ -123,7 +123,7 @@ Ps2Init (KdPointerInfo *pi)
         for (i = 0; i < NUM_PS2_NAMES; i++) {
             ps2Port = open (Ps2Names[i], 0);
             if (ps2Port >= 0) {
-                pi->path = KdSaveString (Ps2Names[i]);
+                pi->path = strdup (Ps2Names[i]);
                 break;
             }
 	}
@@ -137,7 +137,7 @@ Ps2Init (KdPointerInfo *pi)
 
     close(ps2Port);
     if (!pi->name)
-        pi->name = KdSaveString ("PS/2 Mouse");
+        pi->name = strdup ("PS/2 Mouse");
 
     return Success;
 }
diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c
index 7ad7a88..19c8e84 100644
--- a/hw/kdrive/linux/tslib.c
+++ b/hw/kdrive/linux/tslib.c
@@ -169,7 +169,7 @@ TslibInit (KdPointerInfo *pi)
     /* hacktastic */
     private->phys_screen = 0;
     pi->nAxes = 3;
-    pi->name = KdSaveString("Touchscreen");
+    pi->name = strdup("Touchscreen");
     pi->inputClass = KD_TOUCHSCREEN;
 
     return Success;
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 97d167e..162a3db 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -521,17 +521,6 @@ KdParseScreen (KdScreenInfo *screen,
  *	{NMO}	    Reorder buttons
  */
 
-char *
-KdSaveString (char *str)
-{
-    char    *n = (char *) xalloc (strlen (str) + 1);
-
-    if (!n)
-	return 0;
-    strcpy (n, str);
-    return n;
-}
-
 void
 KdParseRgba (char *rgba)
 {
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index 6a9f493..c60559a 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -24,6 +24,7 @@
 #define _KDRIVE_H_
 
 #include <stdio.h>
+#include <string.h>
 #include <X11/X.h>
 #include <X11/Xproto.h>
 #include <X11/Xos.h>
@@ -468,9 +469,6 @@ void
 KdParseScreen (KdScreenInfo *screen,
 	       char	    *arg);
 
-char *
-KdSaveString (char *str);
-
 KdPointerInfo *
 KdParsePointer (char *arg);
 
diff --git a/hw/kdrive/src/kinfo.c b/hw/kdrive/src/kinfo.c
index d592e68..cb64613 100644
--- a/hw/kdrive/src/kinfo.c
+++ b/hw/kdrive/src/kinfo.c
@@ -118,7 +118,7 @@ KdNewPointer (void)
     if (!pi)
         return NULL;
 
-    pi->name = KdSaveString("Generic Pointer");
+    pi->name = strdup("Generic Pointer");
     pi->path = NULL;
     pi->inputClass = KD_MOUSE;
     pi->driver = NULL;
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 2875920..4b2d709 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -870,9 +870,9 @@ KdNewKeyboard (void)
     ki->bellDuration = 200;
     ki->next = NULL;
     ki->options = NULL;
-    ki->xkbRules = KdSaveString("base");
-    ki->xkbModel = KdSaveString("pc105");
-    ki->xkbLayout = KdSaveString("us");
+    ki->xkbRules = strdup("base");
+    ki->xkbModel = strdup("pc105");
+    ki->xkbLayout = strdup("us");
     ki->xkbVariant = NULL;
     ki->xkbOptions = NULL;
 
@@ -1065,7 +1065,7 @@ KdParseKbdOptions (KdKeyboardInfo *ki)
         else if (strcasecmp(option->key, "XkbOptions") == 0)
             ki->xkbOptions = option->value;
         else if (!strcasecmp (option->key, "device"))
-            ki->path = KdSaveString(option->value);
+            ki->path = strdup(option->value);
         else
            ErrorF("Kbd option key (%s) of value (%s) not assigned!\n", 
                     option->key, option->value);
@@ -1161,7 +1161,7 @@ KdParsePointerOptions (KdPointerInfo *pi)
         else if (!strcmp (option->key, "rawcoord"))
             pi->transformCoordinates = FALSE;
         else if (!strcasecmp (option->key, "device"))
-            pi->path = KdSaveString(option->value);
+            pi->path = strdup(option->value);
         else
             ErrorF("Pointer option key (%s) of value (%s) not assigned!\n", 
                     option->key, option->value);
@@ -2280,9 +2280,9 @@ NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
     for (option = options; option; option = option->next) {
         if (strcmp(option->key, "device") == 0) {
             if (pi && option->value)
-                pi->path = KdSaveString(option->value);
+                pi->path = strdup(option->value);
             else if (ki && option->value)
-                ki->path = KdSaveString(option->value);
+                ki->path = strdup(option->value);
         }
         else if (strcmp(option->key, "driver") == 0) {
             if (pi) {


More information about the xorg-commit mailing list