Mercurial > emacs
comparison src/doc.c @ 10344:a6e8525a1a9d
(store_function_docstring, Fdocumentation): Use & PSEUDOVECTOR_SIZE_MASK on
`size' field of compiled byte-code object.
author | Roland McGrath <roland@gnu.org> |
---|---|
date | Thu, 05 Jan 1995 07:11:54 +0000 |
parents | 240a2c88d439 |
children | 9952a5ab70d1 |
comparison
equal
deleted
inserted
replaced
10343:daaf64864c1c | 10344:a6e8525a1a9d |
---|---|
1 /* Record indices of function doc strings stored in a file. | 1 /* Record indices of function doc strings stored in a file. |
2 Copyright (C) 1985, 1986, 1993, 1994 Free Software Foundation, Inc. | 2 Copyright (C) 1985, 1986, 1993, 1994, 1995 Free Software Foundation, Inc. |
3 | 3 |
4 This file is part of GNU Emacs. | 4 This file is part of GNU Emacs. |
5 | 5 |
6 GNU Emacs is free software; you can redistribute it and/or modify | 6 GNU Emacs is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation; either version 1, or (at your option) | 8 the Free Software Foundation; either version 2, or (at your option) |
9 any later version. | 9 any later version. |
10 | 10 |
11 GNU Emacs is distributed in the hope that it will be useful, | 11 GNU Emacs is distributed in the hope that it will be useful, |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
277 else | 277 else |
278 doc = get_doc_string (make_number (- (EMACS_INT) XSUBR (fun)->doc)); | 278 doc = get_doc_string (make_number (- (EMACS_INT) XSUBR (fun)->doc)); |
279 } | 279 } |
280 else if (COMPILEDP (fun)) | 280 else if (COMPILEDP (fun)) |
281 { | 281 { |
282 if (XVECTOR (fun)->size <= COMPILED_DOC_STRING) | 282 if (XVECTOR (fun)->size & PSEUDOVECTOR_SIZE_MASK <= COMPILED_DOC_STRING) |
283 return Qnil; | 283 return Qnil; |
284 tem = XVECTOR (fun)->contents[COMPILED_DOC_STRING]; | 284 tem = XVECTOR (fun)->contents[COMPILED_DOC_STRING]; |
285 if (STRINGP (tem)) | 285 if (STRINGP (tem)) |
286 doc = tem; | 286 doc = tem; |
287 else if (NATNUMP (tem) || CONSP (tem)) | 287 else if (NATNUMP (tem) || CONSP (tem)) |
392 /* Bytecode objects sometimes have slots for it. */ | 392 /* Bytecode objects sometimes have slots for it. */ |
393 else if (COMPILEDP (fun)) | 393 else if (COMPILEDP (fun)) |
394 { | 394 { |
395 /* This bytecode object must have a slot for the | 395 /* This bytecode object must have a slot for the |
396 docstring, since we've found a docstring for it. */ | 396 docstring, since we've found a docstring for it. */ |
397 if (XVECTOR (fun)->size > COMPILED_DOC_STRING) | 397 if (XVECTOR (fun)->size & PSEUDOVECTOR_SIZE_MASK > COMPILED_DOC_STRING) |
398 XSETFASTINT (XVECTOR (fun)->contents[COMPILED_DOC_STRING], offset); | 398 XSETFASTINT (XVECTOR (fun)->contents[COMPILED_DOC_STRING], offset); |
399 } | 399 } |
400 } | 400 } |
401 | 401 |
402 | 402 |