pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/x11/rxvt In XChangeProperty(), format = 32 means long ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f7f8c4ad990d
branches:  trunk
changeset: 514886:f7f8c4ad990d
user:      martin <martin%pkgsrc.org@localhost>
date:      Tue Jun 20 13:07:20 2006 +0000

description:
In XChangeProperty(), format = 32 means long - no matter how many bits
long has. The format value furthermore is not arbitrary, but needs to
be 8, 16 or 32. So don't pass Atom32 instead of long, or some sizeof()
calculation as format, hardcode the value and make sure the arg is
properly aligned.
Fixes PR 33680 (old problem), and an alignement related crash with gcc4
on sparc64.

diffstat:

 x11/rxvt/distinfo         |   3 ++-
 x11/rxvt/patches/patch-al |  40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletions(-)

diffs (58 lines):

diff -r 30439abf459b -r f7f8c4ad990d x11/rxvt/distinfo
--- a/x11/rxvt/distinfo Tue Jun 20 12:54:48 2006 +0000
+++ b/x11/rxvt/distinfo Tue Jun 20 13:07:20 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.19 2005/06/16 13:19:17 hira Exp $
+$NetBSD: distinfo,v 1.20 2006/06/20 13:07:20 martin Exp $
 
 SHA1 (rxvt-2.7.10.tar.bz2) = 16eae23c3227e28e5e7a53a58eaa3226affe65f9
 RMD160 (rxvt-2.7.10.tar.bz2) = 83fab8df589e2413ba820d04bafb069e6af8c445
@@ -14,3 +14,4 @@
 SHA1 (patch-ai) = 0f3e800efc5b87243208de9fb9fafe9abde73201
 SHA1 (patch-aj) = 43ca25f034e6160f3a3dabbf1488df31cdecf95b
 SHA1 (patch-ak) = 960d0bd263a6b8776df93603dc5322b685a6afae
+SHA1 (patch-al) = 7107ec12205d0a5011a5828f8d30fbd577de41b7
diff -r 30439abf459b -r f7f8c4ad990d x11/rxvt/patches/patch-al
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/rxvt/patches/patch-al Tue Jun 20 13:07:20 2006 +0000
@@ -0,0 +1,40 @@
+$NetBSD: patch-al,v 1.1 2006/06/20 13:07:20 martin Exp $
+
+--- src/screen.c.orig  2003-03-23 17:56:06.000000000 +0100
++++ src/screen.c       2006-06-20 14:52:21.000000000 +0200
+@@ -3515,11 +3515,12 @@ rxvt_selection_send(rxvt_t *r, const XSe
+ {
+     XSelectionEvent ev;
+ #ifdef USE_XIM
+-    Atom32          target_list[4];
++    long            target_list[4];
+ #else
+-    Atom32          target_list[3];
++    long            target_list[3];
+ #endif
+     Atom            target;
++    long            time;
+     XTextProperty   ct;
+     XICCEncodingStyle style;
+     char           *cl[2], dummy[1];
+@@ -3540,16 +3541,17 @@ rxvt_selection_send(rxvt_t *r, const XSe
+       target_list[3] = (Atom32) r->h->xa[XA_COMPOUND_TEXT];
+ #endif
+       XChangeProperty(r->Xdisplay, rq->requestor, rq->property, XA_ATOM,
+-                      (8 * sizeof(target_list[0])), PropModeReplace,
++                      32, PropModeReplace,
+                       (unsigned char *)target_list,
+                       (sizeof(target_list) / sizeof(target_list[0])));
+       ev.property = rq->property;
+     } else if (rq->target == r->h->xa[XA_MULTIPLE]) {
+       /* TODO: Handle MULTIPLE */
+     } else if (rq->target == r->h->xa[XA_TIMESTAMP] && r->selection.text) {
++      time = r->h->selection_time;
+       XChangeProperty(r->Xdisplay, rq->requestor, rq->property, XA_INTEGER,
+-                      (8 * sizeof(Time)), PropModeReplace,
+-                      (unsigned char *)&r->h->selection_time, 1);
++                      32, PropModeReplace,
++                      (unsigned char *)&time, 1);
+       ev.property = rq->property;
+     } else if (rq->target == XA_STRING
+              || rq->target == r->h->xa[XA_COMPOUND_TEXT]



Home | Main Index | Thread Index | Old Index