diff options
| author | Andreas Schwab | 2004-04-26 21:28:40 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2004-04-26 21:28:40 +0000 |
| commit | d1ca81d9a8aaf60d46e3f8e4838b2dfd3831764d (patch) | |
| tree | 96f6c08bb428db63cddcf118ba560f0caef88c36 /src/lread.c | |
| parent | 4435a68af69eccce12ff5702d9d7ea38846648d1 (diff) | |
| download | emacs-d1ca81d9a8aaf60d46e3f8e4838b2dfd3831764d.tar.gz emacs-d1ca81d9a8aaf60d46e3f8e4838b2dfd3831764d.zip | |
(read1): Use BOOL_VECTOR_BITS_PER_CHAR instead of BITS_PER_CHAR for
bool vectors.
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lread.c b/src/lread.c index 0910dda61cd..db83623e054 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1993,8 +1993,9 @@ read1 (readcharfun, pch, first_in_list) | |||
| 1993 | if (c == '"') | 1993 | if (c == '"') |
| 1994 | { | 1994 | { |
| 1995 | Lisp_Object tmp, val; | 1995 | Lisp_Object tmp, val; |
| 1996 | int size_in_chars = ((XFASTINT (length) + BITS_PER_CHAR - 1) | 1996 | int size_in_chars |
| 1997 | / BITS_PER_CHAR); | 1997 | = ((XFASTINT (length) + BOOL_VECTOR_BITS_PER_CHAR - 1) |
| 1998 | / BOOL_VECTOR_BITS_PER_CHAR); | ||
| 1998 | 1999 | ||
| 1999 | UNREAD (c); | 2000 | UNREAD (c); |
| 2000 | tmp = read1 (readcharfun, pch, first_in_list); | 2001 | tmp = read1 (readcharfun, pch, first_in_list); |
| @@ -2003,7 +2004,7 @@ read1 (readcharfun, pch, first_in_list) | |||
| 2003 | when the number of bits was a multiple of 8. | 2004 | when the number of bits was a multiple of 8. |
| 2004 | Accept such input in case it came from an old version. */ | 2005 | Accept such input in case it came from an old version. */ |
| 2005 | && ! (XFASTINT (length) | 2006 | && ! (XFASTINT (length) |
| 2006 | == (SCHARS (tmp) - 1) * BITS_PER_CHAR)) | 2007 | == (SCHARS (tmp) - 1) * BOOL_VECTOR_BITS_PER_CHAR)) |
| 2007 | Fsignal (Qinvalid_read_syntax, | 2008 | Fsignal (Qinvalid_read_syntax, |
| 2008 | Fcons (make_string ("#&...", 5), Qnil)); | 2009 | Fcons (make_string ("#&...", 5), Qnil)); |
| 2009 | 2010 | ||
| @@ -2011,9 +2012,9 @@ read1 (readcharfun, pch, first_in_list) | |||
| 2011 | bcopy (SDATA (tmp), XBOOL_VECTOR (val)->data, | 2012 | bcopy (SDATA (tmp), XBOOL_VECTOR (val)->data, |
| 2012 | size_in_chars); | 2013 | size_in_chars); |
| 2013 | /* Clear the extraneous bits in the last byte. */ | 2014 | /* Clear the extraneous bits in the last byte. */ |
| 2014 | if (XINT (length) != size_in_chars * BITS_PER_CHAR) | 2015 | if (XINT (length) != size_in_chars * BOOL_VECTOR_BITS_PER_CHAR) |
| 2015 | XBOOL_VECTOR (val)->data[size_in_chars - 1] | 2016 | XBOOL_VECTOR (val)->data[size_in_chars - 1] |
| 2016 | &= (1 << (XINT (length) % BITS_PER_CHAR)) - 1; | 2017 | &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; |
| 2017 | return val; | 2018 | return val; |
| 2018 | } | 2019 | } |
| 2019 | Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#&...", 5), | 2020 | Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#&...", 5), |