emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/xselect.c


From: Jan Djärv
Subject: [Emacs-diffs] Changes to emacs/src/xselect.c
Date: Tue, 08 Feb 2005 16:26:44 -0500

Index: emacs/src/xselect.c
diff -c emacs/src/xselect.c:1.147 emacs/src/xselect.c:1.148
*** emacs/src/xselect.c:1.147   Mon Feb  7 19:59:36 2005
--- emacs/src/xselect.c Tue Feb  8 21:26:44 2005
***************
*** 1769,1775 ****
  
     When converting an object to C, it may be of the form (SYMBOL . <data>)
     where SYMBOL is what we should claim that the type is.  Format and
!    representation are as above.  */
  
  
  
--- 1769,1779 ----
  
     When converting an object to C, it may be of the form (SYMBOL . <data>)
     where SYMBOL is what we should claim that the type is.  Format and
!    representation are as above.
! 
!    Important: When format is 32, data should contain an array of int,
!    not an array of long as the X library returns.  This makes a difference
!    when sizeof(long) != sizeof(int).  */
  
  
  
***************
*** 1811,1825 ****
    else if (type == XA_ATOM)
      {
        int i;
!       if (size == sizeof (Atom))
!       return x_atom_to_symbol (display, *((Atom *) data));
        else
        {
!         Lisp_Object v = Fmake_vector (make_number (size / sizeof (Atom)),
                                        make_number (0));
!         for (i = 0; i < size / sizeof (Atom); i++)
            Faset (v, make_number (i),
!                  x_atom_to_symbol (display, ((Atom *) data) [i]));
          return v;
        }
      }
--- 1815,1835 ----
    else if (type == XA_ATOM)
      {
        int i;
!       /* On a 64 bit machine sizeof(Atom) == sizeof(long) == 8.
!          But the callers of these function has made sure the data for
!          format == 32 is an array of int.  Thus, use int instead
!          of Atom.  */
!       int *idata = (int *) data;
! 
!       if (size == sizeof (int))
!       return x_atom_to_symbol (display, (Atom) idata[0]);
        else
        {
!         Lisp_Object v = Fmake_vector (make_number (size / sizeof (int)),
                                        make_number (0));
!         for (i = 0; i < size / sizeof (int); i++)
            Faset (v, make_number (i),
!                    x_atom_to_symbol (display, (Atom) idata[i]));
          return v;
        }
      }
***************
*** 2560,2565 ****
--- 2570,2579 ----
     be stored in RET.
     SIZE is the number of elements in DATA.
  
+    Important: When format is 32, data should contain an array of int,
+    not an array of long as the X library returns.  This makes a difference
+    when sizeof(long) != sizeof(int).
+ 
     Also see comment for selection_data_to_lisp_data above.  */
  
  Lisp_Object




reply via email to

[Prev in Thread] Current Thread [Next in Thread]