aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-06-03 11:22:12 -0700
committerPaul Eggert2011-06-03 11:22:12 -0700
commit9ca05932715b387d963f7dd490a2b78a67ad200a (patch)
treebd8d5ce682cc3fcad686d16559a6979a3f4b3293
parente2f51f38c3626e888a81cc77834596c542a71731 (diff)
downloademacs-9ca05932715b387d963f7dd490a2b78a67ad200a.tar.gz
emacs-9ca05932715b387d963f7dd490a2b78a67ad200a.zip
* xselect.c: Use 'unsigned' more consistently.
(selection_data_to_lisp_data, lisp_data_to_selection_data): Use 'unsigned' consistently when computing sizes of unsigned objects.
-rw-r--r--src/ChangeLog4
-rw-r--r--src/xselect.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ff36dd33102..2b81f66d8b6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12011-06-03 Paul Eggert <eggert@cs.ucla.edu> 12011-06-03 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * xselect.c: Use 'unsigned' more consistently.
4 (selection_data_to_lisp_data, lisp_data_to_selection_data):
5 Use 'unsigned' consistently when computing sizes of unsigned objects.
6
3 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow 7 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
4 if b->modtime has its maximal value. 8 if b->modtime has its maximal value.
5 9
diff --git a/src/xselect.c b/src/xselect.c
index 73ef4abc0a4..ca2b1812a61 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1651,9 +1651,9 @@ selection_data_to_lisp_data (Display *display, const unsigned char *data,
1651 If the number is 32 bits and won't fit in a Lisp_Int, 1651 If the number is 32 bits and won't fit in a Lisp_Int,
1652 convert it to a cons of integers, 16 bits in each half. 1652 convert it to a cons of integers, 16 bits in each half.
1653 */ 1653 */
1654 else if (format == 32 && size == sizeof (int)) 1654 else if (format == 32 && size == sizeof (unsigned int))
1655 return long_to_cons (((unsigned int *) data) [0]); 1655 return long_to_cons (((unsigned int *) data) [0]);
1656 else if (format == 16 && size == sizeof (short)) 1656 else if (format == 16 && size == sizeof (unsigned short))
1657 return make_number ((int) (((unsigned short *) data) [0])); 1657 return make_number ((int) (((unsigned short *) data) [0]));
1658 1658
1659 /* Convert any other kind of data to a vector of numbers, represented 1659 /* Convert any other kind of data to a vector of numbers, represented
@@ -1753,8 +1753,8 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
1753 { 1753 {
1754 *format_ret = 32; 1754 *format_ret = 32;
1755 *size_ret = 1; 1755 *size_ret = 1;
1756 *data_ret = (unsigned char *) xmalloc (sizeof (long) + 1); 1756 *data_ret = (unsigned char *) xmalloc (sizeof (unsigned long) + 1);
1757 (*data_ret) [sizeof (long)] = 0; 1757 (*data_ret) [sizeof (unsigned long)] = 0;
1758 (*(unsigned long **) data_ret) [0] = cons_to_long (obj); 1758 (*(unsigned long **) data_ret) [0] = cons_to_long (obj);
1759 if (NILP (type)) type = QINTEGER; 1759 if (NILP (type)) type = QINTEGER;
1760 } 1760 }