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

libxrandr: Changes to 'upstream-unstable'



 configure.ac                    |    2 -
 include/X11/extensions/Xrandr.h |    2 -
 src/XrrCrtc.c                   |    1 
 src/XrrProperty.c               |   60 ++++++++++++++++++++--------------------
 4 files changed, 33 insertions(+), 32 deletions(-)

New commits:
commit 3e753542bcf0fd49fe977e56b7ab7e540bbd4282
Author: Keith Packard <keithp@neko.keithp.com>
Date:   Sun Mar 4 20:03:59 2007 -0800

    Set version to 1.2.1 for release.

diff --git a/configure.ac b/configure.ac
index 5395a54..16e5a14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,7 @@ dnl try to keep these the same.  Note that the library has an extra
 dnl digit in the version number to track changes which don't affect the
 dnl protocol, so Xrandr version l.n.m corresponds to protocol version l.n
 dnl
-AC_INIT(libXrandr, 1.2.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
+AC_INIT(libXrandr, 1.2.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
 AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE([dist-bzip2])
 AM_MAINTAINER_MODE

commit c279b64ccca18b14974e413b0b1d55ac81abceda
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Tue Feb 20 22:30:00 2007 +0100

    Fix the use of a C++ keyword as a parameter name in Xrandr.h

diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index 448c32d..d87976b 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -296,7 +296,7 @@ XRRDeleteOutputProperty (Display *dpy, RROutput output, Atom property);
 int
 XRRGetOutputProperty (Display *dpy, RROutput output,
 		      Atom property, long offset, long length,
-		      Bool delete, Bool pending, Atom req_type, 
+		      Bool _delete, Bool pending, Atom req_type,
 		      Atom *actual_type, int *actual_format,
 		      unsigned long *nitems, unsigned long *bytes_after,
 		      unsigned char **prop);

commit 75d9944484651d4180e3079a739be4edb36545fe
Author: Keith Packard <keithp@neko.keithp.com>
Date:   Sun Feb 18 20:57:31 2007 -0800

    Reset version from 1.2.0.0 to 1.2.0

diff --git a/configure.ac b/configure.ac
index 8caa6f7..5395a54 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,7 @@ dnl try to keep these the same.  Note that the library has an extra
 dnl digit in the version number to track changes which don't affect the
 dnl protocol, so Xrandr version l.n.m corresponds to protocol version l.n
 dnl
-AC_INIT(libXrandr, 1.2.0.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
+AC_INIT(libXrandr, 1.2.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
 AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE([dist-bzip2])
 AM_MAINTAINER_MODE

commit ac82ee50f3938b7b4d6dbcec850d38500258bfe0
Author: Keith Packard <keithp@neko.keithp.com>
Date:   Thu Feb 15 16:56:11 2007 -0800

    Must pass size information in SetCrtcGamma request.

diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index 1fa5cf7..5e5c813 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -253,6 +253,7 @@ XRRSetCrtcGamma (Display *dpy, RRCrtc crtc, XRRCrtcGamma *crtc_gamma)
     req->reqType = info->codes->major_opcode;
     req->randrReqType = X_RRSetCrtcGamma;
     req->crtc = crtc;
+    req->size = crtc_gamma->size;
     req->length += (crtc_gamma->size * 2 * 3 + 3) >> 2;
     /*
      * Note this assumes the structure was allocated with XRRAllocGamma,

commit c85237a1651ae8e1abe9ae442ffa04dcb20c1d3e
Author: Keith Packard <keithp@neko.keithp.com>
Date:   Wed Jan 31 14:20:33 2007 -0800

    Fix read sizes for 64-bit machines.
    
    Be consistent in variable usage:
    	nbytes = network byte length.
    	rbytes = memory byte length.
    	nbytesRead = actual network bytes read.
    Malloc rbytes data to pass to _XRead*, but use nbytes as the
    amount of data to read (yes, this is insane, welcome to Xlib).
    Some of this patch is semi-gratuitous, but the goal is to be consistent
    everywhere.

diff --git a/src/XrrProperty.c b/src/XrrProperty.c
index 5367e1e..07226d8 100644
--- a/src/XrrProperty.c
+++ b/src/XrrProperty.c
@@ -38,7 +38,7 @@ XRRListOutputProperties (Display *dpy, RROutput output, int *nprop)
     XExtDisplayInfo		*info = XRRFindDisplay(dpy);
     xRRListOutputPropertiesReply rep;
     xRRListOutputPropertiesReq	*req;
-    int				nbytes, nbytesRead, netbytes;
+    int				nbytes, nbytesRead, rbytes;
     int				i;
     xRRQueryVersionReq		*vreq;
     Atom			*props;
@@ -59,12 +59,12 @@ XRRListOutputProperties (Display *dpy, RROutput output, int *nprop)
     }
 
     if (rep.nAtoms) {
-	nbytes = rep.nAtoms * sizeof (Atom);
-	netbytes = rep.nAtoms << 2;
+	rbytes = rep.nAtoms * sizeof (Atom);
+	nbytes = rep.nAtoms << 2;
 
-	props = (Atom *) Xmalloc (nbytes);
+	props = (Atom *) Xmalloc (rbytes);
 	if (props == NULL) {
-	    _XEatData (dpy, netbytes);
+	    _XEatData (dpy, nbytes);
 	    UnlockDisplay (dpy);
 	    SyncHandle ();
 	    *nprop = 0;
@@ -86,7 +86,7 @@ XRRQueryOutputProperty (Display *dpy, RROutput output, Atom property)
     XExtDisplayInfo		*info = XRRFindDisplay(dpy);
     xRRQueryOutputPropertyReply rep;
     xRRQueryOutputPropertyReq	*req;
-    int				nbytes, nbytesRead, netbytes;
+    int				rbytes, nbytes;
     int				i;
     xRRQueryVersionReq		*vreq;
     XRRPropertyInfo		*prop_info;
@@ -107,13 +107,12 @@ XRRQueryOutputProperty (Display *dpy, RROutput output, Atom property)
     }
 
     if (rep.length) {
-	nbytes = rep.length * sizeof (long);
-	netbytes = rep.length << 2;
+	rbytes = sizeof (XRRPropertyInfo) + rep.length * sizeof (long);
+	nbytes = rep.length << 2;
 
-	prop_info = (XRRPropertyInfo *) Xmalloc (nbytes +
-						 sizeof (XRRPropertyInfo));
+	prop_info = (XRRPropertyInfo *) Xmalloc (rbytes);
 	if (prop_info == NULL) {
-	    _XEatData (dpy, netbytes);
+	    _XEatData (dpy, nbytes);
 	    UnlockDisplay (dpy);
 	    SyncHandle ();
 	    return NULL;
@@ -257,7 +256,7 @@ XRRGetOutputProperty (Display *dpy, RROutput output,
     XExtDisplayInfo		*info = XRRFindDisplay(dpy);
     xRRGetOutputPropertyReply	rep;
     xRRGetOutputPropertyReq	*req;
-    int				nbytes, nbytesRead;
+    long    			nbytes, rbytes, nbytesRead;
     int				i;
     xRRQueryVersionReq		*vreq;
 
@@ -284,7 +283,6 @@ XRRGetOutputProperty (Display *dpy, RROutput output,
 
     *prop = (unsigned char *) NULL;
     if (rep.propertyType != None) {
-	long nbytes, netbytes;
 	/*
 	 * One extra byte is malloced than is needed to contain the property
 	 * data, but this last byte is null terminated and convenient for
@@ -293,26 +291,27 @@ XRRGetOutputProperty (Display *dpy, RROutput output,
 	 */
 	switch (rep.format) {
 	case 8:
-	    nbytes = netbytes = rep.nItems;
-	    if (nbytes + 1 > 0 &&
-		(*prop = (unsigned char *) Xmalloc ((unsigned)nbytes + 1)))
-		_XReadPad (dpy, (char *) *prop, netbytes);
+	    nbytes = rep.nItems;
+	    rbytes = rep.nItems + 1;
+	    if (rbytes > 0 &&
+		(*prop = (unsigned char *) Xmalloc ((unsigned)rbytes)))
+		_XReadPad (dpy, (char *) *prop, nbytes);
 	    break;
 
 	case 16:
-	    nbytes = rep.nItems * sizeof (short);
-	    netbytes = rep.nItems << 1;
-	    if (nbytes + 1 > 0 &&
-		(*prop = (unsigned char *) Xmalloc ((unsigned)nbytes + 1)))
-		_XRead16Pad (dpy, (short *) *prop, netbytes);
+	    nbytes = rep.nItems << 1;
+	    rbytes = rep.nItems * sizeof (short) + 1;
+	    if (rbytes > 0 &&
+		(*prop = (unsigned char *) Xmalloc ((unsigned)rbytes)))
+		_XRead16Pad (dpy, (short *) *prop, nbytes);
 	    break;
 
 	case 32:
-	    nbytes = rep.nItems * sizeof (long);
-	    netbytes = rep.nItems << 2;
-	    if (nbytes + 1 > 0 &&
-		(*prop = (unsigned char *) Xmalloc ((unsigned)nbytes + 1)))
-		_XRead32 (dpy, (long *) *prop, netbytes);
+	    nbytes = rep.nItems << 2;
+	    rbytes = rep.nItems * sizeof (long) + 1;
+	    if (rbytes > 0 &&
+		(*prop = (unsigned char *) Xmalloc ((unsigned)rbytes)))
+		_XRead32 (dpy, (long *) *prop, nbytes);
 	    break;
 
 	default:
@@ -320,18 +319,19 @@ XRRGetOutputProperty (Display *dpy, RROutput output,
 	     * This part of the code should never be reached.  If it is,
 	     * the server sent back a property with an invalid format.
 	     */
-	    _XEatData(dpy, (unsigned long) netbytes);
+	    nbytes = rep.length << 2;
+	    _XEatData(dpy, (unsigned long) nbytes);
 	    UnlockDisplay(dpy);
 	    SyncHandle();
 	    return(BadImplementation);
 	}
 	if (! *prop) {
-	    _XEatData(dpy, (unsigned long) netbytes);
+	    _XEatData(dpy, (unsigned long) nbytes);
 	    UnlockDisplay(dpy);
 	    SyncHandle();
 	    return(BadAlloc);
 	}
-	(*prop)[nbytes] = '\0';
+	(*prop)[rbytes - 1] = '\0';
     }
 
     *actual_type = rep.propertyType;



Reply to: