comparison src/lread.c @ 39973:579177964efa

Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting with lisp system changes.
author Ken Raeburn <raeburn@raeburn.org>
date Tue, 16 Oct 2001 09:09:51 +0000
parents 6235c0f8e52c
children 19a89ce104dd
comparison
equal deleted inserted replaced
39972:b2479b43184b 39973:579177964efa
830 message_with_string ("Loading %s...", file, 1); 830 message_with_string ("Loading %s...", file, 1);
831 } 831 }
832 832
833 GCPRO1 (file); 833 GCPRO1 (file);
834 lispstream = Fcons (Qnil, Qnil); 834 lispstream = Fcons (Qnil, Qnil);
835 XSETFASTINT (XCAR (lispstream), (EMACS_UINT)stream >> 16); 835 XSETCARFASTINT (lispstream, (EMACS_UINT)stream >> 16);
836 XSETFASTINT (XCDR (lispstream), (EMACS_UINT)stream & 0xffff); 836 XSETCDRFASTINT (lispstream, (EMACS_UINT)stream & 0xffff);
837 record_unwind_protect (load_unwind, lispstream); 837 record_unwind_protect (load_unwind, lispstream);
838 record_unwind_protect (load_descriptor_unwind, load_descriptor_list); 838 record_unwind_protect (load_descriptor_unwind, load_descriptor_list);
839 specbind (Qload_file_name, found); 839 specbind (Qload_file_name, found);
840 specbind (Qinhibit_file_name_operation, Qnil); 840 specbind (Qinhibit_file_name_operation, Qnil);
841 load_descriptor_list 841 load_descriptor_list
961 struct stat st; 961 struct stat st;
962 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 962 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
963 Lisp_Object string, tail; 963 Lisp_Object string, tail;
964 int max_suffix_len = 0; 964 int max_suffix_len = 0;
965 965
966 for (tail = suffixes; CONSP (tail); tail = XCDR (tail))
967 {
968 CHECK_STRING (XCAR (tail), 0);
969 max_suffix_len = max (max_suffix_len,
970 STRING_BYTES (XSTRING (XCAR (tail))));
971 }
972
973 string = filename = Qnil; 966 string = filename = Qnil;
974 GCPRO5 (str, string, filename, path, suffixes); 967 GCPRO5 (str, string, filename, path, suffixes);
975 968
969 for (tail = suffixes; CONSP (tail); tail = XCDR (tail))
970 {
971 string = XCAR (tail);
972 CHECK_STRING (string, 0);
973 if (! EQ (string, XCAR (tail)))
974 XSETCAR (tail, string);
975 max_suffix_len = max (max_suffix_len,
976 STRING_BYTES (XSTRING (string)));
977 }
978
976 if (storeptr) 979 if (storeptr)
977 *storeptr = Qnil; 980 *storeptr = Qnil;
978 981
979 if (complete_filename_p (str)) 982 if (complete_filename_p (str))
980 absolute = 1; 983 absolute = 1;
2722 return val; 2725 return val;
2723 if (ch == '.') 2726 if (ch == '.')
2724 { 2727 {
2725 GCPRO2 (val, tail); 2728 GCPRO2 (val, tail);
2726 if (!NILP (tail)) 2729 if (!NILP (tail))
2727 XCDR (tail) = read0 (readcharfun); 2730 XSETCDR (tail, read0 (readcharfun));
2728 else 2731 else
2729 val = read0 (readcharfun); 2732 val = read0 (readcharfun);
2730 read1 (readcharfun, &ch, 0); 2733 read1 (readcharfun, &ch, 0);
2731 UNGCPRO; 2734 UNGCPRO;
2732 if (ch == ')') 2735 if (ch == ')')
2815 } 2818 }
2816 tem = (read_pure && flag <= 0 2819 tem = (read_pure && flag <= 0
2817 ? pure_cons (elt, Qnil) 2820 ? pure_cons (elt, Qnil)
2818 : Fcons (elt, Qnil)); 2821 : Fcons (elt, Qnil));
2819 if (!NILP (tail)) 2822 if (!NILP (tail))
2820 XCDR (tail) = tem; 2823 XSETCDR (tail, tem);
2821 else 2824 else
2822 val = tem; 2825 val = tem;
2823 tail = tem; 2826 tail = tem;
2824 if (defunflag < 0) 2827 if (defunflag < 0)
2825 defunflag = EQ (elt, Qdefun); 2828 defunflag = EQ (elt, Qdefun);