diff options
| author | Joakim Verona | 2011-06-23 01:28:30 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-06-23 01:28:30 +0200 |
| commit | c5082a753011dacef505e91f1fc30a84fa75a2eb (patch) | |
| tree | 2c995eff276b6e9e68f54b4ebe76bf012231c86d /src/alloc.c | |
| parent | 787c27e81f046cfa1c457ed405551f8ca0ddb0e8 (diff) | |
| parent | 297dde5a97c0c5c8020db72213c7f84067f1ee21 (diff) | |
| download | emacs-c5082a753011dacef505e91f1fc30a84fa75a2eb.tar.gz emacs-c5082a753011dacef505e91f1fc30a84fa75a2eb.zip | |
merge upstream
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c index 00d330c1b6a..69623d103c3 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2257,12 +2257,14 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */) | |||
| 2257 | p = XBOOL_VECTOR (val); | 2257 | p = XBOOL_VECTOR (val); |
| 2258 | p->size = XFASTINT (length); | 2258 | p->size = XFASTINT (length); |
| 2259 | 2259 | ||
| 2260 | memset (p->data, NILP (init) ? 0 : -1, length_in_chars); | 2260 | if (length_in_chars) |
| 2261 | { | ||
| 2262 | memset (p->data, ! NILP (init) ? -1 : 0, length_in_chars); | ||
| 2261 | 2263 | ||
| 2262 | /* Clear the extraneous bits in the last byte. */ | 2264 | /* Clear any extraneous bits in the last byte. */ |
| 2263 | if (XINT (length) != length_in_chars * BOOL_VECTOR_BITS_PER_CHAR) | 2265 | p->data[length_in_chars - 1] |
| 2264 | p->data[length_in_chars - 1] | 2266 | &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; |
| 2265 | &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; | 2267 | } |
| 2266 | 2268 | ||
| 2267 | return val; | 2269 | return val; |
| 2268 | } | 2270 | } |