xserver: Branch 'master' - 2 commits

Alan Coopersmith alanc at kemper.freedesktop.org
Wed Jan 9 18:46:03 PST 2008


 hw/xfree86/dixmods/extmod/xf86misc.c |   33 ++++++++++++++++++---------------
 hw/xfree86/doc/man/xorg.conf.man.pre |    2 +-
 2 files changed, 19 insertions(+), 16 deletions(-)

New commits:
commit 0883e838e25227f0af84d2a90979175724166d16
Author: Peter Harris <peter.harris at hummingbird.com>
Date:   Wed Jan 9 14:52:33 2008 -0500

    xf86misc.c: Avoid use of swapped values

diff --git a/hw/xfree86/dixmods/extmod/xf86misc.c b/hw/xfree86/dixmods/extmod/xf86misc.c
index 66278a2..8f44346 100644
--- a/hw/xfree86/dixmods/extmod/xf86misc.c
+++ b/hw/xfree86/dixmods/extmod/xf86misc.c
@@ -250,6 +250,7 @@ ProcXF86MiscGetMouseSettings(client)
     char *devname;
     pointer mouse;
     register int n;
+    int devnamelen;
 
     DEBUG_P("XF86MiscGetMouseSettings");
 
@@ -269,7 +270,7 @@ ProcXF86MiscGetMouseSettings(client)
     rep.emulate3timeout = MiscExtGetMouseValue(mouse, MISC_MSE_EM3TIMEOUT);
     rep.chordmiddle =	  MiscExtGetMouseValue(mouse, MISC_MSE_CHORDMIDDLE);
     rep.flags =		  MiscExtGetMouseValue(mouse, MISC_MSE_FLAGS);
-    rep.devnamelen = (devname? strlen(devname): 0);
+    devnamelen = rep.devnamelen = (devname? strlen(devname): 0);
     rep.length = (sizeof(xXF86MiscGetMouseSettingsReply) -
 		  sizeof(xGenericReply) + ((rep.devnamelen+3) & ~3)) >> 2;
     
@@ -289,8 +290,8 @@ ProcXF86MiscGetMouseSettings(client)
     WriteToClient(client, SIZEOF(xXF86MiscGetMouseSettingsReply), (char *)&rep);
     MiscExtDestroyStruct(mouse, MISC_POINTER);
     
-    if (rep.devnamelen)
-        WriteToClient(client, rep.devnamelen, devname);
+    if (devnamelen)
+        WriteToClient(client, devnamelen, devname);
     return (client->noClientException);
 }
 
@@ -508,6 +509,7 @@ ProcXF86MiscGetFilePaths(client)
     const char *modulepath;
     const char *logfile;
     register int n;
+    int configlen, modulelen, loglen;
 
     DEBUG_P("XF86MiscGetFilePaths");
 
@@ -518,9 +520,9 @@ ProcXF86MiscGetFilePaths(client)
     if (!MiscExtGetFilePaths(&configfile, &modulepath, &logfile))
 	return BadValue;
 
-    rep.configlen = (configfile? strlen(configfile): 0);
-    rep.modulelen = (modulepath? strlen(modulepath): 0);
-    rep.loglen = (logfile? strlen(logfile): 0);
+    configlen = rep.configlen = (configfile? strlen(configfile): 0);
+    modulelen = rep.modulelen = (modulepath? strlen(modulepath): 0);
+    loglen = rep.loglen = (logfile? strlen(logfile): 0);
     rep.length = (SIZEOF(xXF86MiscGetFilePathsReply) - SIZEOF(xGenericReply) +
 		  ((rep.configlen + 3) & ~3) +
 		  ((rep.modulelen + 3) & ~3) +
@@ -535,12 +537,12 @@ ProcXF86MiscGetFilePaths(client)
     }
     WriteToClient(client, SIZEOF(xXF86MiscGetFilePathsReply), (char *)&rep);
     
-    if (rep.configlen)
-        WriteToClient(client, rep.configlen, (char *)configfile);
-    if (rep.modulelen)
-        WriteToClient(client, rep.modulelen, (char *)modulepath);
-    if (rep.loglen)
-        WriteToClient(client, rep.loglen, (char *)logfile);
+    if (configlen)
+        WriteToClient(client, configlen, (char *)configfile);
+    if (modulelen)
+        WriteToClient(client, modulelen, (char *)modulepath);
+    if (loglen)
+        WriteToClient(client, loglen, (char *)logfile);
 
     return (client->noClientException);
 }
@@ -553,6 +555,7 @@ ProcXF86MiscPassMessage(client)
     char *msgtype, *msgval, *retstr;
     int retval, size;
     register int n;
+    int mesglen;
 
     REQUEST(xXF86MiscPassMessageReq);
 
@@ -589,7 +592,7 @@ ProcXF86MiscPassMessage(client)
 
     rep.type = X_Reply;
     rep.sequenceNumber = client->sequence;
-    rep.mesglen = (retstr? strlen(retstr): 0);
+    mesglen = rep.mesglen = (retstr? strlen(retstr): 0);
     rep.length = (SIZEOF(xXF86MiscPassMessageReply) - SIZEOF(xGenericReply) +
 		  ((rep.mesglen + 3) & ~3)) >> 2;
     rep.status = 0;
@@ -601,8 +604,8 @@ ProcXF86MiscPassMessage(client)
     }
     WriteToClient(client, SIZEOF(xXF86MiscPassMessageReply), (char *)&rep);
     
-    if (rep.mesglen)
-        WriteToClient(client, rep.mesglen, (char *)retstr);
+    if (mesglen)
+        WriteToClient(client, mesglen, (char *)retstr);
 
     xfree(msgtype);
     xfree(msgval);
commit 59a63d72a1407a8aaf9878eeff7ee7a66f65a42b
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Wed Jan 9 18:42:58 2008 -0800

    Fix reference to old versions of XFree86 to not say "Xorg 4.2 or earlier"

diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 7eaf5d5..1369a16 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -2029,7 +2029,7 @@ These both specify that the upper left corner's coordinates are
 The
 .B Absolute
 keyword is optional.
-Some older versions of __xservername__ (4.2 and earlier) don't recognise the
+Some older versions of XFree86 (4.2 and earlier) don't recognise the
 .B Absolute
 keyword, so it's safest to just specify the coordinates without it.
 .TP 4


More information about the xorg-commit mailing list