Mercurial > emacs
comparison src/print.c @ 25717:3c6ad00e51a8
Use XCAR, XCDR, and XFLOAT_DATA instead of explicit member access.
author | Ken Raeburn <raeburn@raeburn.org> |
---|---|
date | Tue, 14 Sep 1999 15:12:57 +0000 |
parents | 475a9b6bd640 |
children | 9bfb1496cdd8 |
comparison
equal
deleted
inserted
replaced
25716:e2d5cd96727b | 25717:3c6ad00e51a8 |
---|---|
853 struct gcpro gcpro1; | 853 struct gcpro gcpro1; |
854 | 854 |
855 /* If OBJ is (error STRING), just return STRING. | 855 /* If OBJ is (error STRING), just return STRING. |
856 That is not only faster, it also avoids the need to allocate | 856 That is not only faster, it also avoids the need to allocate |
857 space here when the error is due to memory full. */ | 857 space here when the error is due to memory full. */ |
858 if (CONSP (obj) && EQ (XCONS (obj)->car, Qerror) | 858 if (CONSP (obj) && EQ (XCAR (obj), Qerror) |
859 && CONSP (XCONS (obj)->cdr) | 859 && CONSP (XCDR (obj)) |
860 && STRINGP (XCONS (XCONS (obj)->cdr)->car) | 860 && STRINGP (XCAR (XCDR (obj))) |
861 && NILP (XCONS (XCONS (obj)->cdr)->cdr)) | 861 && NILP (XCDR (XCDR (obj)))) |
862 return XCONS (XCONS (obj)->cdr)->car; | 862 return XCAR (XCDR (obj)); |
863 | 863 |
864 print_error_message (obj, Vprin1_to_string_buffer); | 864 print_error_message (obj, Vprin1_to_string_buffer); |
865 | 865 |
866 set_buffer_internal (XBUFFER (Vprin1_to_string_buffer)); | 866 set_buffer_internal (XBUFFER (Vprin1_to_string_buffer)); |
867 value = Fbuffer_string (); | 867 value = Fbuffer_string (); |
907 GCPRO1 (tail); | 907 GCPRO1 (tail); |
908 | 908 |
909 /* For file-error, make error message by concatenating | 909 /* For file-error, make error message by concatenating |
910 all the data items. They are all strings. */ | 910 all the data items. They are all strings. */ |
911 if (!NILP (file_error) && CONSP (tail)) | 911 if (!NILP (file_error) && CONSP (tail)) |
912 errmsg = XCONS (tail)->car, tail = XCONS (tail)->cdr; | 912 errmsg = XCAR (tail), tail = XCDR (tail); |
913 | 913 |
914 if (STRINGP (errmsg)) | 914 if (STRINGP (errmsg)) |
915 Fprinc (errmsg, stream); | 915 Fprinc (errmsg, stream); |
916 else | 916 else |
917 write_string_1 ("peculiar error", -1, stream); | 917 write_string_1 ("peculiar error", -1, stream); |
1264 #ifdef LISP_FLOAT_TYPE | 1264 #ifdef LISP_FLOAT_TYPE |
1265 case Lisp_Float: | 1265 case Lisp_Float: |
1266 { | 1266 { |
1267 char pigbuf[350]; /* see comments in float_to_string */ | 1267 char pigbuf[350]; /* see comments in float_to_string */ |
1268 | 1268 |
1269 float_to_string (pigbuf, XFLOAT(obj)->data); | 1269 float_to_string (pigbuf, XFLOAT_DATA (obj)); |
1270 strout (pigbuf, -1, -1, printcharfun, 0); | 1270 strout (pigbuf, -1, -1, printcharfun, 0); |
1271 } | 1271 } |
1272 break; | 1272 break; |
1273 #endif | 1273 #endif |
1274 | 1274 |
1812 strout ("[frame] ", -1, -1, printcharfun, 0); | 1812 strout ("[frame] ", -1, -1, printcharfun, 0); |
1813 print_object (XBUFFER_LOCAL_VALUE (obj)->frame, | 1813 print_object (XBUFFER_LOCAL_VALUE (obj)->frame, |
1814 printcharfun, escapeflag); | 1814 printcharfun, escapeflag); |
1815 } | 1815 } |
1816 strout ("[alist-elt] ", -1, -1, printcharfun, 0); | 1816 strout ("[alist-elt] ", -1, -1, printcharfun, 0); |
1817 print_object (XCONS (XBUFFER_LOCAL_VALUE (obj)->cdr)->car, | 1817 print_object (XCAR (XBUFFER_LOCAL_VALUE (obj)->cdr), |
1818 printcharfun, escapeflag); | 1818 printcharfun, escapeflag); |
1819 strout ("[default-value] ", -1, -1, printcharfun, 0); | 1819 strout ("[default-value] ", -1, -1, printcharfun, 0); |
1820 print_object (XCONS (XBUFFER_LOCAL_VALUE (obj)->cdr)->cdr, | 1820 print_object (XCDR (XBUFFER_LOCAL_VALUE (obj)->cdr), |
1821 printcharfun, escapeflag); | 1821 printcharfun, escapeflag); |
1822 PRINTCHAR ('>'); | 1822 PRINTCHAR ('>'); |
1823 break; | 1823 break; |
1824 | 1824 |
1825 default: | 1825 default: |