diff options
| author | Paul Eggert | 2011-03-17 09:51:42 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-03-17 09:51:42 -0700 |
| commit | a3a6c54ec72118e8d22d2ecd608df5193c8926a3 (patch) | |
| tree | de018428bd736fd37ec25ac07152199664d3f08b /src/doc.c | |
| parent | d6cd56f187a791983579bf5d4ce3702d2ddf2499 (diff) | |
| parent | b1d876f1a19ae65c8a8dd61c4ce17055ca53f16c (diff) | |
| download | emacs-a3a6c54ec72118e8d22d2ecd608df5193c8926a3.tar.gz emacs-a3a6c54ec72118e8d22d2ecd608df5193c8926a3.zip | |
Merge: Fix more problems found by GCC 4.5.2's static checks.
Diffstat (limited to 'src/doc.c')
| -rw-r--r-- | src/doc.c | 36 |
1 files changed, 21 insertions, 15 deletions
| @@ -322,17 +322,20 @@ string is passed through `substitute-command-keys'. */) | |||
| 322 | { | 322 | { |
| 323 | Lisp_Object fun; | 323 | Lisp_Object fun; |
| 324 | Lisp_Object funcar; | 324 | Lisp_Object funcar; |
| 325 | Lisp_Object tem, doc; | 325 | Lisp_Object doc; |
| 326 | int try_reload = 1; | 326 | int try_reload = 1; |
| 327 | 327 | ||
| 328 | documentation: | 328 | documentation: |
| 329 | 329 | ||
| 330 | doc = Qnil; | 330 | doc = Qnil; |
| 331 | 331 | ||
| 332 | if (SYMBOLP (function) | 332 | if (SYMBOLP (function)) |
| 333 | && (tem = Fget (function, Qfunction_documentation), | 333 | { |
| 334 | !NILP (tem))) | 334 | Lisp_Object tem = Fget (function, Qfunction_documentation); |
| 335 | return Fdocumentation_property (function, Qfunction_documentation, raw); | 335 | if (!NILP (tem)) |
| 336 | return Fdocumentation_property (function, Qfunction_documentation, | ||
| 337 | raw); | ||
| 338 | } | ||
| 336 | 339 | ||
| 337 | fun = Findirect_function (function, Qnil); | 340 | fun = Findirect_function (function, Qnil); |
| 338 | if (SUBRP (fun)) | 341 | if (SUBRP (fun)) |
| @@ -348,13 +351,16 @@ string is passed through `substitute-command-keys'. */) | |||
| 348 | { | 351 | { |
| 349 | if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING) | 352 | if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING) |
| 350 | return Qnil; | 353 | return Qnil; |
| 351 | tem = AREF (fun, COMPILED_DOC_STRING); | ||
| 352 | if (STRINGP (tem)) | ||
| 353 | doc = tem; | ||
| 354 | else if (NATNUMP (tem) || CONSP (tem)) | ||
| 355 | doc = tem; | ||
| 356 | else | 354 | else |
| 357 | return Qnil; | 355 | { |
| 356 | Lisp_Object tem = AREF (fun, COMPILED_DOC_STRING); | ||
| 357 | if (STRINGP (tem)) | ||
| 358 | doc = tem; | ||
| 359 | else if (NATNUMP (tem) || CONSP (tem)) | ||
| 360 | doc = tem; | ||
| 361 | else | ||
| 362 | return Qnil; | ||
| 363 | } | ||
| 358 | } | 364 | } |
| 359 | else if (STRINGP (fun) || VECTORP (fun)) | 365 | else if (STRINGP (fun) || VECTORP (fun)) |
| 360 | { | 366 | { |
| @@ -370,9 +376,8 @@ string is passed through `substitute-command-keys'. */) | |||
| 370 | else if (EQ (funcar, Qlambda) | 376 | else if (EQ (funcar, Qlambda) |
| 371 | || EQ (funcar, Qautoload)) | 377 | || EQ (funcar, Qautoload)) |
| 372 | { | 378 | { |
| 373 | Lisp_Object tem1; | 379 | Lisp_Object tem1 = Fcdr (Fcdr (fun)); |
| 374 | tem1 = Fcdr (Fcdr (fun)); | 380 | Lisp_Object tem = Fcar (tem1); |
| 375 | tem = Fcar (tem1); | ||
| 376 | if (STRINGP (tem)) | 381 | if (STRINGP (tem)) |
| 377 | doc = tem; | 382 | doc = tem; |
| 378 | /* Handle a doc reference--but these never come last | 383 | /* Handle a doc reference--but these never come last |
| @@ -539,7 +544,7 @@ the same file name is found in the `doc-directory'. */) | |||
| 539 | char buf[1024 + 1]; | 544 | char buf[1024 + 1]; |
| 540 | register EMACS_INT filled; | 545 | register EMACS_INT filled; |
| 541 | register EMACS_INT pos; | 546 | register EMACS_INT pos; |
| 542 | register char *p, *end; | 547 | register char *p; |
| 543 | Lisp_Object sym; | 548 | Lisp_Object sym; |
| 544 | char *name; | 549 | char *name; |
| 545 | int skip_file = 0; | 550 | int skip_file = 0; |
| @@ -598,6 +603,7 @@ the same file name is found in the `doc-directory'. */) | |||
| 598 | pos = 0; | 603 | pos = 0; |
| 599 | while (1) | 604 | while (1) |
| 600 | { | 605 | { |
| 606 | register char *end; | ||
| 601 | if (filled < 512) | 607 | if (filled < 512) |
| 602 | filled += emacs_read (fd, &buf[filled], sizeof buf - 1 - filled); | 608 | filled += emacs_read (fd, &buf[filled], sizeof buf - 1 - filled); |
| 603 | if (!filled) | 609 | if (!filled) |