comparison src/doc.c @ 5581:56144c8593a8

Mechanically change INT to FIXNUM in our sources. src/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT (where it refers to non-bignum Lisp integers) to FIXNUM in our sources. Done for the following functions, enums, and macros: Lisp_Type_Int_Even, Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(), XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(), EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT. The EMACS_INT typedef was not changed, it does not describe non-bignum Lisp integers. Script that did the change available in http://mid.gmane.org/20067.17650.181273.12014@parhasard.net . modules/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers. See the src/ChangeLog entry for more details. man/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> * internals/internals.texi (How Lisp Objects Are Represented in C): * internals/internals.texi (Integers and Characters): Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Oct 2011 09:51:57 +0100
parents 308d34e9f07d
children 3b1d4fa716a4
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
64 { 64 {
65 if (name_nonreloc) 65 if (name_nonreloc)
66 name_reloc = build_istring (name_nonreloc); 66 name_reloc = build_istring (name_nonreloc);
67 return_me = list3 (build_msg_string 67 return_me = list3 (build_msg_string
68 ("Position out of range in doc string file"), 68 ("Position out of range in doc string file"),
69 name_reloc, make_int (position)); 69 name_reloc, make_fixnum (position));
70 goto done; 70 goto done;
71 } 71 }
72 72
73 fdstream = make_filedesc_input_stream (fd, 0, -1, 0); 73 fdstream = make_filedesc_input_stream (fd, 0, -1, 0);
74 Lstream_set_buffering (XLSTREAM (fdstream), LSTREAM_UNBUFFERED, 0); 74 Lstream_set_buffering (XLSTREAM (fdstream), LSTREAM_UNBUFFERED, 0);
179 { 179 {
180 if (name_nonreloc) 180 if (name_nonreloc)
181 name_reloc = build_istring (name_nonreloc); 181 name_reloc = build_istring (name_nonreloc);
182 return_me = list3 (build_msg_string 182 return_me = list3 (build_msg_string
183 ("Position out of range in doc string file"), 183 ("Position out of range in doc string file"),
184 name_reloc, make_int (position)); 184 name_reloc, make_fixnum (position));
185 goto done; 185 goto done;
186 } 186 }
187 187
188 fdstream = make_filedesc_input_stream (fd, 0, -1, 0); 188 fdstream = make_filedesc_input_stream (fd, 0, -1, 0);
189 Lstream_set_buffering (XLSTREAM (fdstream), LSTREAM_UNBUFFERED, 0); 189 Lstream_set_buffering (XLSTREAM (fdstream), LSTREAM_UNBUFFERED, 0);
269 case '0': *to++ = '\0'; break; 269 case '0': *to++ = '\0'; break;
270 case '_': *to++ = '\037'; break; 270 case '_': *to++ = '\037'; break;
271 default: 271 default:
272 return_me = list2 (build_msg_string 272 return_me = list2 (build_msg_string
273 ("Invalid data in documentation file -- ^A followed by weird code"), 273 ("Invalid data in documentation file -- ^A followed by weird code"),
274 make_int (c)); 274 make_fixnum (c));
275 goto done; 275 goto done;
276 } 276 }
277 } 277 }
278 } 278 }
279 279
315 EMACS_INT position; 315 EMACS_INT position;
316 Lisp_Object file, tem; 316 Lisp_Object file, tem;
317 Lisp_Object name_reloc = Qnil; 317 Lisp_Object name_reloc = Qnil;
318 int standard_doc_file = 0; 318 int standard_doc_file = 0;
319 319
320 if (INTP (filepos)) 320 if (FIXNUMP (filepos))
321 { 321 {
322 file = Vinternal_doc_file_name; 322 file = Vinternal_doc_file_name;
323 standard_doc_file = 1; 323 standard_doc_file = 1;
324 position = XINT (filepos); 324 position = XFIXNUM (filepos);
325 } 325 }
326 else if (CONSP (filepos) && INTP (XCDR (filepos))) 326 else if (CONSP (filepos) && FIXNUMP (XCDR (filepos)))
327 { 327 {
328 file = XCAR (filepos); 328 file = XCAR (filepos);
329 position = XINT (XCDR (filepos)); 329 position = XFIXNUM (XCDR (filepos));
330 if (position < 0) 330 if (position < 0)
331 position = - position; 331 position = - position;
332 } 332 }
333 else 333 else
334 return Qnil; 334 return Qnil;
412 EMACS_INT position; 412 EMACS_INT position;
413 Lisp_Object file, tem; 413 Lisp_Object file, tem;
414 Lisp_Object name_reloc = Qnil; 414 Lisp_Object name_reloc = Qnil;
415 int standard_doc_file = 0; 415 int standard_doc_file = 0;
416 416
417 if (INTP (filepos)) 417 if (FIXNUMP (filepos))
418 { 418 {
419 file = Vinternal_doc_file_name; 419 file = Vinternal_doc_file_name;
420 standard_doc_file = 1; 420 standard_doc_file = 1;
421 position = XINT (filepos); 421 position = XFIXNUM (filepos);
422 } 422 }
423 else if (CONSP (filepos) && INTP (XCDR (filepos))) 423 else if (CONSP (filepos) && FIXNUMP (XCDR (filepos)))
424 { 424 {
425 file = XCAR (filepos); 425 file = XCAR (filepos);
426 position = XINT (XCDR (filepos)); 426 position = XFIXNUM (XCDR (filepos));
427 if (position < 0) 427 if (position < 0)
428 position = - position; 428 position = - position;
429 } 429 }
430 else 430 else
431 return Qnil; 431 return Qnil;
530 return Qnil; 530 return Qnil;
531 } 531 }
532 else 532 else
533 { 533 {
534 filename = get_object_file_name 534 filename = get_object_file_name
535 (make_int (- (EMACS_INT) XSUBR (fun)->doc)); 535 (make_fixnum (- (EMACS_INT) XSUBR (fun)->doc));
536 return filename; 536 return filename;
537 } 537 }
538 } 538 }
539 539
540 if (COMPILED_FUNCTIONP (fun) || (CONSP(fun) && 540 if (COMPILED_FUNCTIONP (fun) || (CONSP(fun) &&
560 { 560 {
561 Lisp_Object doc_offset = Fget (symbol, Qvariable_documentation, Qnil); 561 Lisp_Object doc_offset = Fget (symbol, Qvariable_documentation, Qnil);
562 562
563 if (!NILP(doc_offset)) 563 if (!NILP(doc_offset))
564 { 564 {
565 if (INTP(doc_offset)) 565 if (FIXNUMP(doc_offset))
566 { 566 {
567 filename = get_object_file_name 567 filename = get_object_file_name
568 (XINT (doc_offset) > 0 ? doc_offset 568 (XFIXNUM (doc_offset) > 0 ? doc_offset
569 : make_int (- XINT (doc_offset))); 569 : make_fixnum (- XFIXNUM (doc_offset)));
570 } 570 }
571 else if (CONSP(doc_offset)) 571 else if (CONSP(doc_offset))
572 { 572 {
573 filename = get_object_file_name(doc_offset); 573 filename = get_object_file_name(doc_offset);
574 } 574 }
597 if (XSUBR (fun)->doc == 0) 597 if (XSUBR (fun)->doc == 0)
598 return Qnil; 598 return Qnil;
599 if ((EMACS_INT) XSUBR (fun)->doc >= 0) 599 if ((EMACS_INT) XSUBR (fun)->doc >= 0)
600 doc = build_cistring (XSUBR (fun)->doc); 600 doc = build_cistring (XSUBR (fun)->doc);
601 else 601 else
602 doc = get_doc_string (make_int (- (EMACS_INT) XSUBR (fun)->doc)); 602 doc = get_doc_string (make_fixnum (- (EMACS_INT) XSUBR (fun)->doc));
603 } 603 }
604 else if (COMPILED_FUNCTIONP (fun)) 604 else if (COMPILED_FUNCTIONP (fun))
605 { 605 {
606 Lisp_Object tem; 606 Lisp_Object tem;
607 Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun); 607 Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
697 struct gcpro gcpro1; 697 struct gcpro gcpro1;
698 698
699 GCPRO1 (doc); 699 GCPRO1 (doc);
700 700
701 doc = Fget (symbol, prop, Qnil); 701 doc = Fget (symbol, prop, Qnil);
702 if (INTP (doc)) 702 if (FIXNUMP (doc))
703 doc = get_doc_string (XINT (doc) > 0 ? doc : make_int (- XINT (doc))); 703 doc = get_doc_string (XFIXNUM (doc) > 0 ? doc : make_fixnum (- XFIXNUM (doc)));
704 else if (CONSP (doc)) 704 else if (CONSP (doc))
705 doc = get_doc_string (doc); 705 doc = get_doc_string (doc);
706 #ifdef I18N3 706 #ifdef I18N3
707 if (!NILP (doc)) 707 if (!NILP (doc))
708 { 708 {
784 file. */ 784 file. */
785 assert((end - p - 2) > -1); 785 assert((end - p - 2) > -1);
786 sym = oblookup (Vobarray, p + 2, end - p - 2); 786 sym = oblookup (Vobarray, p + 2, end - p - 2);
787 if (SYMBOLP (sym)) 787 if (SYMBOLP (sym))
788 { 788 {
789 Lisp_Object offset = make_int (pos + end + 1 - buf); 789 Lisp_Object offset = make_fixnum (pos + end + 1 - buf);
790 /* Attach a docstring to a variable */ 790 /* Attach a docstring to a variable */
791 if (p[1] == 'V') 791 if (p[1] == 'V')
792 { 792 {
793 /* Install file-position as variable-documentation property 793 /* Install file-position as variable-documentation property
794 and make it negative for a user-variable 794 and make it negative for a user-variable
799 weird_doc (sym, "duplicate", 799 weird_doc (sym, "duplicate",
800 "variable", pos); 800 "variable", pos);
801 /* In the case of duplicate doc file entries, always 801 /* In the case of duplicate doc file entries, always
802 take the later one. But if the doc is not an int 802 take the later one. But if the doc is not an int
803 (a string, say) leave it alone. */ 803 (a string, say) leave it alone. */
804 if (!INTP (old)) 804 if (!FIXNUMP (old))
805 goto weird; 805 goto weird;
806 } 806 }
807 Fput (sym, Qvariable_documentation, 807 Fput (sym, Qvariable_documentation,
808 ((end[1] == '*') 808 ((end[1] == '*')
809 ? make_int (- XINT (offset)) 809 ? make_fixnum (- XFIXNUM (offset))
810 : offset)); 810 : offset));
811 } 811 }
812 /* Attach a docstring to a function. 812 /* Attach a docstring to a function.
813 The type determines where the docstring is stored. */ 813 The type determines where the docstring is stored. */
814 else if (p[1] == 'F') 814 else if (p[1] == 'F')
849 { 849 {
850 weird_doc (sym, "duplicate", 850 weird_doc (sym, "duplicate",
851 "subr", pos); 851 "subr", pos);
852 goto weird; 852 goto weird;
853 } 853 }
854 XSUBR (fun)->doc = (char *) (- XINT (offset)); 854 XSUBR (fun)->doc = (char *) (- XFIXNUM (offset));
855 } 855 }
856 else if (CONSP (fun)) 856 else if (CONSP (fun))
857 { 857 {
858 /* If it's a lisp form, stick it in the form. */ 858 /* If it's a lisp form, stick it in the form. */
859 tem = XCAR (fun); 859 tem = XCAR (fun);
860 if (EQ (tem, Qlambda) || EQ (tem, Qautoload)) 860 if (EQ (tem, Qlambda) || EQ (tem, Qautoload))
861 { 861 {
862 tem = Fcdr (Fcdr (fun)); 862 tem = Fcdr (Fcdr (fun));
863 if (CONSP (tem) && 863 if (CONSP (tem) &&
864 INTP (XCAR (tem))) 864 FIXNUMP (XCAR (tem)))
865 { 865 {
866 Lisp_Object old = XCAR (tem); 866 Lisp_Object old = XCAR (tem);
867 if (!ZEROP (old)) 867 if (!ZEROP (old))
868 { 868 {
869 if (EQ (tem, Qlambda)) 869 if (EQ (tem, Qlambda))
874 pos); 874 pos);
875 /* In the case of duplicate doc file entries, 875 /* In the case of duplicate doc file entries,
876 always take the later one. But if the doc 876 always take the later one. But if the doc
877 is not an int (a string, say) leave it 877 is not an int (a string, say) leave it
878 alone. */ 878 alone. */
879 if (!INTP (old)) 879 if (!FIXNUMP (old))
880 goto weird; 880 goto weird;
881 } 881 }
882 XCAR (tem) = offset; 882 XCAR (tem) = offset;
883 } 883 }
884 else if (!CONSP (tem)) 884 else if (!CONSP (tem))
888 } 888 }
889 else 889 else
890 { 890 {
891 /* DOC string is a string not integer 0 */ 891 /* DOC string is a string not integer 0 */
892 #if 0 892 #if 0
893 weird_doc (sym, "!INTP(XCAR(tem))", 893 weird_doc (sym, "!FIXNUMP(XCAR(tem))",
894 "function", pos); 894 "function", pos);
895 #endif 895 #endif
896 goto cont; 896 goto cont;
897 } 897 }
898 } 898 }
918 { 918 {
919 weird_doc (sym, "duplicate", "bytecode", pos); 919 weird_doc (sym, "duplicate", "bytecode", pos);
920 /* In the case of duplicate doc file entries, 920 /* In the case of duplicate doc file entries,
921 always take the later one. But if the doc is 921 always take the later one. But if the doc is
922 not an int (a string, say) leave it alone. */ 922 not an int (a string, say) leave it alone. */
923 if (!INTP (old)) 923 if (!FIXNUMP (old))
924 goto weird; 924 goto weird;
925 } 925 }
926 926
927 /* This may be a function or variable where we want 927 /* This may be a function or variable where we want
928 to make the file name available. */ 928 to make the file name available. */
938 } 938 }
939 else 939 else
940 { 940 {
941 /* lose: */ 941 /* lose: */
942 signal_error (Qfile_error, "DOC file invalid at position", 942 signal_error (Qfile_error, "DOC file invalid at position",
943 make_int (pos)); 943 make_fixnum (pos));
944 weird: 944 weird:
945 /* goto lose */; 945 /* goto lose */;
946 } 946 }
947 } 947 }
948 } 948 }
997 if (EQ (tem, Qlambda) || EQ (tem, Qautoload)) 997 if (EQ (tem, Qlambda) || EQ (tem, Qautoload))
998 { 998 {
999 doc = -1; 999 doc = -1;
1000 tem = Fcdr (Fcdr (fun)); 1000 tem = Fcdr (Fcdr (fun));
1001 if (CONSP (tem) && 1001 if (CONSP (tem) &&
1002 INTP (XCAR (tem))) 1002 FIXNUMP (XCAR (tem)))
1003 doc = XINT (XCAR (tem)); 1003 doc = XFIXNUM (XCAR (tem));
1004 } 1004 }
1005 } 1005 }
1006 else if (COMPILED_FUNCTIONP (fun)) 1006 else if (COMPILED_FUNCTIONP (fun))
1007 { 1007 {
1008 Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun); 1008 Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
1009 if (! (f->flags.documentationp)) 1009 if (! (f->flags.documentationp))
1010 doc = -1; 1010 doc = -1;
1011 else 1011 else
1012 { 1012 {
1013 Lisp_Object tem = compiled_function_documentation (f); 1013 Lisp_Object tem = compiled_function_documentation (f);
1014 if (INTP (tem)) 1014 if (FIXNUMP (tem))
1015 doc = XINT (tem); 1015 doc = XFIXNUM (tem);
1016 } 1016 }
1017 } 1017 }
1018 1018
1019 if (doc == 0 && !kludgily_ignore_lost_doc_p (sym)) 1019 if (doc == 0 && !kludgily_ignore_lost_doc_p (sym))
1020 { 1020 {