# HG changeset patch # User Aidan Kehoe # Date 1200749659 -3600 # Node ID 5998e37dc35e7afcd49aa10c250151138e7b07c9 # Parent 4b62544f513970f4d9a12c1723dc145bfe6cde84 Use bignums if necessary for file size in #'file-attributes. 2008-01-19 Aidan Kehoe * dired.c (Ffile_attributes): If bignums are available, use them for the file size when necessary. If they are not, be clearer about the check for whether the file size can fit in a Lisp integer. diff -r 4b62544f5139 -r 5998e37dc35e src/ChangeLog --- a/src/ChangeLog Fri Jan 18 22:06:01 2008 -0500 +++ b/src/ChangeLog Sat Jan 19 14:34:19 2008 +0100 @@ -1,3 +1,10 @@ +2008-01-19 Aidan Kehoe + + * dired.c (Ffile_attributes): If bignums are available, use them + for the file size when necessary. If they are not, be clearer + about the check for whether the file size can fit in a Lisp + integer. + 2008-01-18 Jerry James * device-x.c (x_init_device): Don't write to path or read from diff -r 4b62544f5139 -r 5998e37dc35e src/dired.c --- a/src/dired.c Fri Jan 18 22:06:01 2008 -0500 +++ b/src/dired.c Sat Jan 19 14:34:19 2008 +0100 @@ -824,7 +824,7 @@ First integer has high-order 16 bits of time, second has low 16 bits. 5. Last modification time, likewise. 6. Last status change time, likewise. - 7. Size in bytes. (-1, if number is out of range). + 7. Size in bytes. (-1, if number out of range and no bignum support.) 8. File modes, as a string of ten letters or dashes as in ls -l. 9. t iff file's gid would change if file were deleted and recreated. 10. inode number. @@ -900,11 +900,14 @@ values[4] = make_time (s.st_atime); values[5] = make_time (s.st_mtime); values[6] = make_time (s.st_ctime); - values[7] = make_int ((EMACS_INT) s.st_size); - /* If the size is out of range, give back -1. */ - /* #### Fix when Emacs gets bignums! */ - if (XINT (values[7]) != s.st_size) - values[7] = make_int (-1); + +#ifndef HAVE_BIGNUM + values[7] = make_integer (NUMBER_FITS_IN_AN_EMACS_INT (s.st_size) ? + (EMACS_INT)s.st_size : -1); +#else + values[7] = make_integer (s.st_size); +#endif + filemodestring (&s, modes); values[8] = make_string ((Ibyte *) modes, 10); #if defined (BSD4_2) || defined (BSD4_3) /* file gid will be dir gid */