comparison src/xselect.c @ 50110:b8c1a5c8f9c0

(selection_data_to_lisp_data): Use int instead of long for an integer of size 4.
author Andreas Schwab <schwab@suse.de>
date Wed, 12 Mar 2003 23:48:40 +0000
parents 265dc22fb2c0
children d89a8e99c73b
comparison
equal deleted inserted replaced
50109:d23ab2416c49 50110:b8c1a5c8f9c0
1 /* X Selection processing for Emacs. 1 /* X Selection processing for Emacs.
2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001 2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003
3 Free Software Foundation. 3 Free Software Foundation.
4 4
5 This file is part of GNU Emacs. 5 This file is part of GNU Emacs.
6 6
7 GNU Emacs is free software; you can redistribute it and/or modify 7 GNU Emacs is free software; you can redistribute it and/or modify
1693 1693
1694 /* Convert a single 16 or small 32 bit number to a Lisp_Int. 1694 /* Convert a single 16 or small 32 bit number to a Lisp_Int.
1695 If the number is > 16 bits, convert it to a cons of integers, 1695 If the number is > 16 bits, convert it to a cons of integers,
1696 16 bits in each half. 1696 16 bits in each half.
1697 */ 1697 */
1698 else if (format == 32 && size == sizeof (long)) 1698 else if (format == 32 && size == sizeof (int))
1699 return long_to_cons (((unsigned long *) data) [0]); 1699 return long_to_cons (((unsigned int *) data) [0]);
1700 else if (format == 16 && size == sizeof (short)) 1700 else if (format == 16 && size == sizeof (short))
1701 return make_number ((int) (((unsigned short *) data) [0])); 1701 return make_number ((int) (((unsigned short *) data) [0]));
1702 1702
1703 /* Convert any other kind of data to a vector of numbers, represented 1703 /* Convert any other kind of data to a vector of numbers, represented
1704 as above (as an integer, or a cons of two 16 bit integers.) 1704 as above (as an integer, or a cons of two 16 bit integers.)
1719 { 1719 {
1720 int i; 1720 int i;
1721 Lisp_Object v = Fmake_vector (make_number (size / 4), make_number (0)); 1721 Lisp_Object v = Fmake_vector (make_number (size / 4), make_number (0));
1722 for (i = 0; i < size / 4; i++) 1722 for (i = 0; i < size / 4; i++)
1723 { 1723 {
1724 unsigned long j = ((unsigned long *) data) [i]; 1724 unsigned int j = ((unsigned int *) data) [i];
1725 Faset (v, make_number (i), long_to_cons (j)); 1725 Faset (v, make_number (i), long_to_cons (j));
1726 } 1726 }
1727 return v; 1727 return v;
1728 } 1728 }
1729 } 1729 }