Mercurial > emacs
comparison src/lread.c @ 25663:a5eaace0fa01
Use XCAR and XCDR instead of explicit member access.
author | Ken Raeburn <raeburn@raeburn.org> |
---|---|
date | Mon, 13 Sep 1999 03:35:33 +0000 |
parents | 301ce7f0b398 |
children | 3d1138357287 |
comparison
equal
deleted
inserted
replaced
25662:0a7261c1d487 | 25663:a5eaace0fa01 |
---|---|
746 message_with_string ("Loading %s...", file, 1); | 746 message_with_string ("Loading %s...", file, 1); |
747 } | 747 } |
748 | 748 |
749 GCPRO1 (file); | 749 GCPRO1 (file); |
750 lispstream = Fcons (Qnil, Qnil); | 750 lispstream = Fcons (Qnil, Qnil); |
751 XSETFASTINT (XCONS (lispstream)->car, (EMACS_UINT)stream >> 16); | 751 XSETFASTINT (XCAR (lispstream), (EMACS_UINT)stream >> 16); |
752 XSETFASTINT (XCONS (lispstream)->cdr, (EMACS_UINT)stream & 0xffff); | 752 XSETFASTINT (XCDR (lispstream), (EMACS_UINT)stream & 0xffff); |
753 record_unwind_protect (load_unwind, lispstream); | 753 record_unwind_protect (load_unwind, lispstream); |
754 record_unwind_protect (load_descriptor_unwind, load_descriptor_list); | 754 record_unwind_protect (load_descriptor_unwind, load_descriptor_list); |
755 specbind (Qload_file_name, found); | 755 specbind (Qload_file_name, found); |
756 specbind (Qinhibit_file_name_operation, Qnil); | 756 specbind (Qinhibit_file_name_operation, Qnil); |
757 load_descriptor_list | 757 load_descriptor_list |
791 | 791 |
792 static Lisp_Object | 792 static Lisp_Object |
793 load_unwind (stream) /* used as unwind-protect function in load */ | 793 load_unwind (stream) /* used as unwind-protect function in load */ |
794 Lisp_Object stream; | 794 Lisp_Object stream; |
795 { | 795 { |
796 fclose ((FILE *) (XFASTINT (XCONS (stream)->car) << 16 | 796 fclose ((FILE *) (XFASTINT (XCAR (stream)) << 16 |
797 | XFASTINT (XCONS (stream)->cdr))); | 797 | XFASTINT (XCDR (stream)))); |
798 if (--load_in_progress < 0) load_in_progress = 0; | 798 if (--load_in_progress < 0) load_in_progress = 0; |
799 return Qnil; | 799 return Qnil; |
800 } | 800 } |
801 | 801 |
802 static Lisp_Object | 802 static Lisp_Object |
813 void | 813 void |
814 close_load_descs () | 814 close_load_descs () |
815 { | 815 { |
816 #ifndef WINDOWSNT | 816 #ifndef WINDOWSNT |
817 Lisp_Object tail; | 817 Lisp_Object tail; |
818 for (tail = load_descriptor_list; !NILP (tail); tail = XCONS (tail)->cdr) | 818 for (tail = load_descriptor_list; !NILP (tail); tail = XCDR (tail)) |
819 close (XFASTINT (XCONS (tail)->car)); | 819 close (XFASTINT (XCAR (tail))); |
820 #endif | 820 #endif |
821 } | 821 } |
822 | 822 |
823 static int | 823 static int |
824 complete_filename_p (pathname) | 824 complete_filename_p (pathname) |
2452 item = Fread (bytestr); | 2452 item = Fread (bytestr); |
2453 if (!CONSP (item)) | 2453 if (!CONSP (item)) |
2454 error ("invalid byte code"); | 2454 error ("invalid byte code"); |
2455 | 2455 |
2456 otem = XCONS (item); | 2456 otem = XCONS (item); |
2457 bytestr = XCONS (item)->car; | 2457 bytestr = XCAR (item); |
2458 item = XCONS (item)->cdr; | 2458 item = XCDR (item); |
2459 free_cons (otem); | 2459 free_cons (otem); |
2460 } | 2460 } |
2461 | 2461 |
2462 /* Now handle the bytecode slot. */ | 2462 /* Now handle the bytecode slot. */ |
2463 ptr[COMPILED_BYTECODE] = read_pure ? Fpurecopy (bytestr) : bytestr; | 2463 ptr[COMPILED_BYTECODE] = read_pure ? Fpurecopy (bytestr) : bytestr; |
2545 return val; | 2545 return val; |
2546 if (ch == '.') | 2546 if (ch == '.') |
2547 { | 2547 { |
2548 GCPRO2 (val, tail); | 2548 GCPRO2 (val, tail); |
2549 if (!NILP (tail)) | 2549 if (!NILP (tail)) |
2550 XCONS (tail)->cdr = read0 (readcharfun); | 2550 XCDR (tail) = read0 (readcharfun); |
2551 else | 2551 else |
2552 val = read0 (readcharfun); | 2552 val = read0 (readcharfun); |
2553 read1 (readcharfun, &ch, 0); | 2553 read1 (readcharfun, &ch, 0); |
2554 UNGCPRO; | 2554 UNGCPRO; |
2555 if (ch == ')') | 2555 if (ch == ')') |
2558 return make_number (0); | 2558 return make_number (0); |
2559 if (doc_reference == 2) | 2559 if (doc_reference == 2) |
2560 { | 2560 { |
2561 /* Get a doc string from the file we are loading. | 2561 /* Get a doc string from the file we are loading. |
2562 If it's in saved_doc_string, get it from there. */ | 2562 If it's in saved_doc_string, get it from there. */ |
2563 int pos = XINT (XCONS (val)->cdr); | 2563 int pos = XINT (XCDR (val)); |
2564 /* Position is negative for user variables. */ | 2564 /* Position is negative for user variables. */ |
2565 if (pos < 0) pos = -pos; | 2565 if (pos < 0) pos = -pos; |
2566 if (pos >= saved_doc_string_position | 2566 if (pos >= saved_doc_string_position |
2567 && pos < (saved_doc_string_position | 2567 && pos < (saved_doc_string_position |
2568 + saved_doc_string_length)) | 2568 + saved_doc_string_length)) |
2638 } | 2638 } |
2639 tem = (read_pure && flag <= 0 | 2639 tem = (read_pure && flag <= 0 |
2640 ? pure_cons (elt, Qnil) | 2640 ? pure_cons (elt, Qnil) |
2641 : Fcons (elt, Qnil)); | 2641 : Fcons (elt, Qnil)); |
2642 if (!NILP (tail)) | 2642 if (!NILP (tail)) |
2643 XCONS (tail)->cdr = tem; | 2643 XCDR (tail) = tem; |
2644 else | 2644 else |
2645 val = tem; | 2645 val = tem; |
2646 tail = tem; | 2646 tail = tem; |
2647 if (defunflag < 0) | 2647 if (defunflag < 0) |
2648 defunflag = EQ (elt, Qdefun); | 2648 defunflag = EQ (elt, Qdefun); |
3263 { | 3263 { |
3264 Lisp_Object path_tail; | 3264 Lisp_Object path_tail; |
3265 | 3265 |
3266 for (path_tail = Vload_path; | 3266 for (path_tail = Vload_path; |
3267 !NILP (path_tail); | 3267 !NILP (path_tail); |
3268 path_tail = XCONS (path_tail)->cdr) | 3268 path_tail = XCDR (path_tail)) |
3269 { | 3269 { |
3270 Lisp_Object dirfile; | 3270 Lisp_Object dirfile; |
3271 dirfile = Fcar (path_tail); | 3271 dirfile = Fcar (path_tail); |
3272 if (STRINGP (dirfile)) | 3272 if (STRINGP (dirfile)) |
3273 { | 3273 { |
3274 dirfile = Fdirectory_file_name (dirfile); | 3274 dirfile = Fdirectory_file_name (dirfile); |
3275 if (access (XSTRING (dirfile)->data, 0) < 0) | 3275 if (access (XSTRING (dirfile)->data, 0) < 0) |
3276 dir_warning ("Warning: Lisp directory `%s' does not exist.\n", | 3276 dir_warning ("Warning: Lisp directory `%s' does not exist.\n", |
3277 XCONS (path_tail)->car); | 3277 XCAR (path_tail)); |
3278 } | 3278 } |
3279 } | 3279 } |
3280 } | 3280 } |
3281 #endif /* WINDOWSNT */ | 3281 #endif /* WINDOWSNT */ |
3282 | 3282 |