Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
70949dac
Commit
70949dac
authored
Sep 12, 1999
by
Ken Raeburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use XCAR, XCDR, XFLOAT_DATA instead of explicit member access.
parent
e952bf44
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
163 additions
and
163 deletions
+163
-163
src/alloc.c
src/alloc.c
+20
-20
src/bytecode.c
src/bytecode.c
+7
-7
src/callint.c
src/callint.c
+14
-14
src/callproc.c
src/callproc.c
+16
-16
src/dired.c
src/dired.c
+4
-4
src/floatfns.c
src/floatfns.c
+9
-9
src/fns.c
src/fns.c
+42
-42
src/indent.c
src/indent.c
+12
-12
src/process.c
src/process.c
+27
-27
src/textprop.c
src/textprop.c
+12
-12
No files found.
src/alloc.c
View file @
70949dac
...
...
@@ -680,7 +680,7 @@ make_float (float_value)
}
XSETFLOAT
(
val
,
&
float_block
->
floats
[
float_block_index
++
]);
}
XFLOAT
(
val
)
->
data
=
float_value
;
XFLOAT
_DATA
(
val
)
=
float_value
;
XSETFASTINT
(
XFLOAT
(
val
)
->
type
,
0
);
/* bug chasing -wsr */
consing_since_gc
+=
sizeof
(
struct
Lisp_Float
);
floats_consed
++
;
...
...
@@ -765,8 +765,8 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
}
XSETCONS
(
val
,
&
cons_block
->
conses
[
cons_block_index
++
]);
}
XC
ONS
(
val
)
->
car
=
car
;
XC
ONS
(
val
)
->
cdr
=
cdr
;
XC
AR
(
val
)
=
car
;
XC
DR
(
val
)
=
cdr
;
consing_since_gc
+=
sizeof
(
struct
Lisp_Cons
);
cons_cells_consed
++
;
return
val
;
...
...
@@ -1568,8 +1568,8 @@ pure_cons (car, cdr)
error
(
"Pure Lisp storage exhausted"
);
XSETCONS
(
new
,
PUREBEG
+
pureptr
);
pureptr
+=
sizeof
(
struct
Lisp_Cons
);
XC
ONS
(
new
)
->
car
=
Fpurecopy
(
car
);
XC
ONS
(
new
)
->
cdr
=
Fpurecopy
(
cdr
);
XC
AR
(
new
)
=
Fpurecopy
(
car
);
XC
DR
(
new
)
=
Fpurecopy
(
cdr
);
return
new
;
}
...
...
@@ -1606,7 +1606,7 @@ make_pure_float (num)
error
(
"Pure Lisp storage exhausted"
);
XSETFLOAT
(
new
,
PUREBEG
+
pureptr
);
pureptr
+=
sizeof
(
struct
Lisp_Float
);
XFLOAT
(
new
)
->
data
=
num
;
XFLOAT
_DATA
(
new
)
=
num
;
XSETFASTINT
(
XFLOAT
(
new
)
->
type
,
0
);
/* bug chasing -wsr */
return
new
;
}
...
...
@@ -1644,10 +1644,10 @@ Does not copy symbols.")
return
obj
;
if
(
CONSP
(
obj
))
return
pure_cons
(
XC
ONS
(
obj
)
->
car
,
XC
ONS
(
obj
)
->
cdr
);
return
pure_cons
(
XC
AR
(
obj
),
XC
DR
(
obj
));
#ifdef LISP_FLOAT_TYPE
else
if
(
FLOATP
(
obj
))
return
make_pure_float
(
XFLOAT
(
obj
)
->
data
);
return
make_pure_float
(
XFLOAT
_DATA
(
obj
));
#endif
/* LISP_FLOAT_TYPE */
else
if
(
STRINGP
(
obj
))
return
make_pure_string
(
XSTRING
(
obj
)
->
data
,
XSTRING
(
obj
)
->
size
,
...
...
@@ -1892,19 +1892,19 @@ Garbage collection happens automatically if you cons more than\n\
prev
=
Qnil
;
while
(
CONSP
(
tail
))
{
if
(
GC_CONSP
(
XC
ONS
(
tail
)
->
car
)
&&
GC_MARKERP
(
XC
ONS
(
XC
ONS
(
tail
)
->
car
)
->
car
)
&&
!
XMARKBIT
(
XMARKER
(
XC
ONS
(
XC
ONS
(
tail
)
->
car
)
->
car
)
->
chain
))
if
(
GC_CONSP
(
XC
AR
(
tail
))
&&
GC_MARKERP
(
XC
AR
(
XC
AR
(
tail
)
)
)
&&
!
XMARKBIT
(
XMARKER
(
XC
AR
(
XC
AR
(
tail
)
)
)
->
chain
))
{
if
(
NILP
(
prev
))
nextb
->
undo_list
=
tail
=
XC
ONS
(
tail
)
->
cdr
;
nextb
->
undo_list
=
tail
=
XC
DR
(
tail
);
else
tail
=
XC
ONS
(
prev
)
->
cdr
=
XC
ONS
(
tail
)
->
cdr
;
tail
=
XC
DR
(
prev
)
=
XC
DR
(
tail
);
}
else
{
prev
=
tail
;
tail
=
XC
ONS
(
tail
)
->
cdr
;
tail
=
XC
DR
(
tail
);
}
}
}
...
...
@@ -2462,7 +2462,7 @@ mark_object (argptr)
}
mark_object
(
&
ptr
->
car
);
/* See comment above under Lisp_Vector for why not use ptr here. */
objptr
=
&
XC
ONS
(
obj
)
->
cdr
;
objptr
=
&
XC
DR
(
obj
);
goto
loop
;
}
...
...
@@ -2509,11 +2509,11 @@ mark_buffer (buf)
break
;
XMARK
(
ptr
->
car
);
if
(
GC_CONSP
(
ptr
->
car
)
&&
!
XMARKBIT
(
XC
ONS
(
ptr
->
car
)
->
car
)
&&
GC_MARKERP
(
XC
ONS
(
ptr
->
car
)
->
car
))
&&
!
XMARKBIT
(
XC
AR
(
ptr
->
car
))
&&
GC_MARKERP
(
XC
AR
(
ptr
->
car
)))
{
XMARK
(
XC
ONS
(
ptr
->
car
)
->
car
);
mark_object
(
&
XC
ONS
(
ptr
->
car
)
->
cdr
);
XMARK
(
XC
AR
(
ptr
->
car
));
mark_object
(
&
XC
DR
(
ptr
->
car
));
}
else
mark_object
(
&
ptr
->
car
);
...
...
@@ -2524,7 +2524,7 @@ mark_buffer (buf)
break
;
}
mark_object
(
&
XC
ONS
(
tail
)
->
cdr
);
mark_object
(
&
XC
DR
(
tail
));
}
else
mark_object
(
&
buffer
->
undo_list
);
...
...
src/bytecode.c
View file @
70949dac
...
...
@@ -629,7 +629,7 @@ If the third argument is incorrect, Emacs may crash.")
while
(
--
op
>=
0
)
{
if
(
CONSP
(
v1
))
v1
=
XC
ONS
(
v1
)
->
cdr
;
v1
=
XC
DR
(
v1
);
else
if
(
!
NILP
(
v1
))
{
immediate_quit
=
0
;
...
...
@@ -674,14 +674,14 @@ If the third argument is incorrect, Emacs may crash.")
case
Bcar
:
v1
=
TOP
;
docar:
if
(
CONSP
(
v1
))
TOP
=
XC
ONS
(
v1
)
->
car
;
if
(
CONSP
(
v1
))
TOP
=
XC
AR
(
v1
);
else
if
(
NILP
(
v1
))
TOP
=
Qnil
;
else
Fcar
(
wrong_type_argument
(
Qlistp
,
v1
));
break
;
case
Bcdr
:
v1
=
TOP
;
if
(
CONSP
(
v1
))
TOP
=
XC
ONS
(
v1
)
->
cdr
;
if
(
CONSP
(
v1
))
TOP
=
XC
DR
(
v1
);
else
if
(
NILP
(
v1
))
TOP
=
Qnil
;
else
Fcdr
(
wrong_type_argument
(
Qlistp
,
v1
));
break
;
...
...
@@ -810,8 +810,8 @@ If the third argument is incorrect, Emacs may crash.")
{
double
f1
,
f2
;
f1
=
(
FLOATP
(
v1
)
?
XFLOAT
(
v1
)
->
data
:
XINT
(
v1
));
f2
=
(
FLOATP
(
v2
)
?
XFLOAT
(
v2
)
->
data
:
XINT
(
v2
));
f1
=
(
FLOATP
(
v1
)
?
XFLOAT
_DATA
(
v1
)
:
XINT
(
v1
));
f2
=
(
FLOATP
(
v2
)
?
XFLOAT
_DATA
(
v2
)
:
XINT
(
v2
));
TOP
=
(
f1
==
f2
?
Qt
:
Qnil
);
}
else
...
...
@@ -1097,7 +1097,7 @@ If the third argument is incorrect, Emacs may crash.")
case
Bcar_safe
:
v1
=
TOP
;
if
(
CONSP
(
v1
))
TOP
=
XC
ONS
(
v1
)
->
car
;
TOP
=
XC
AR
(
v1
);
else
TOP
=
Qnil
;
break
;
...
...
@@ -1105,7 +1105,7 @@ If the third argument is incorrect, Emacs may crash.")
case
Bcdr_safe
:
v1
=
TOP
;
if
(
CONSP
(
v1
))
TOP
=
XC
ONS
(
v1
)
->
cdr
;
TOP
=
XC
DR
(
v1
);
else
TOP
=
Qnil
;
break
;
...
...
src/callint.c
View file @
70949dac
...
...
@@ -314,17 +314,17 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
instead of the present values. */
if
(
CONSP
(
input
))
{
car
=
XC
ONS
(
input
)
->
car
;
car
=
XC
AR
(
input
);
/* Skip through certain special forms. */
while
(
EQ
(
car
,
Qlet
)
||
EQ
(
car
,
Qletx
)
||
EQ
(
car
,
Qsave_excursion
))
{
while
(
CONSP
(
XC
ONS
(
input
)
->
cdr
))
input
=
XC
ONS
(
input
)
->
cdr
;
input
=
XC
ONS
(
input
)
->
car
;
while
(
CONSP
(
XC
DR
(
input
)))
input
=
XC
DR
(
input
);
input
=
XC
AR
(
input
);
if
(
!
CONSP
(
input
))
break
;
car
=
XC
ONS
(
input
)
->
car
;
car
=
XC
AR
(
input
);
}
if
(
EQ
(
car
,
Qlist
))
{
...
...
@@ -353,7 +353,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
{
teml
=
Fnthcdr
(
Vhistory_length
,
Vcommand_history
);
if
(
CONSP
(
teml
))
XC
ONS
(
teml
)
->
cdr
=
Qnil
;
XC
DR
(
teml
)
=
Qnil
;
}
}
single_kboard_state
();
...
...
@@ -388,9 +388,9 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
event
=
XVECTOR
(
keys
)
->
contents
[
next_event
];
if
(
EVENT_HAS_PARAMETERS
(
event
)
&&
(
event
=
XC
ONS
(
event
)
->
cdr
,
CONSP
(
event
))
&&
(
event
=
XC
ONS
(
event
)
->
car
,
CONSP
(
event
))
&&
(
event
=
XC
ONS
(
event
)
->
car
,
WINDOWP
(
event
)))
&&
(
event
=
XC
DR
(
event
),
CONSP
(
event
))
&&
(
event
=
XC
AR
(
event
),
CONSP
(
event
))
&&
(
event
=
XC
AR
(
event
),
WINDOWP
(
event
)))
{
if
(
MINI_WINDOW_P
(
XWINDOW
(
event
))
&&
!
(
minibuf_level
>
0
&&
EQ
(
event
,
minibuf_window
)))
...
...
@@ -554,7 +554,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
discard the following up-event. */
teml
=
Faref
(
args
[
i
],
make_number
(
XINT
(
Flength
(
args
[
i
]))
-
1
));
if
(
CONSP
(
teml
))
teml
=
XC
ONS
(
teml
)
->
car
;
teml
=
XC
AR
(
teml
);
if
(
SYMBOLP
(
teml
))
{
Lisp_Object
tem2
;
...
...
@@ -582,7 +582,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
discard the following up-event. */
teml
=
Faref
(
args
[
i
],
make_number
(
XINT
(
Flength
(
args
[
i
]))
-
1
));
if
(
CONSP
(
teml
))
teml
=
XC
ONS
(
teml
)
->
car
;
teml
=
XC
AR
(
teml
);
if
(
SYMBOLP
(
teml
))
{
Lisp_Object
tem2
;
...
...
@@ -771,7 +771,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
{
teml
=
Fnthcdr
(
Vhistory_length
,
Vcommand_history
);
if
(
CONSP
(
teml
))
XC
ONS
(
teml
)
->
cdr
=
Qnil
;
XC
DR
(
teml
)
=
Qnil
;
}
}
...
...
@@ -807,8 +807,8 @@ Its numeric meaning is what you would get from `(interactive \"p\")'.")
XSETFASTINT
(
val
,
1
);
else
if
(
EQ
(
raw
,
Qminus
))
XSETINT
(
val
,
-
1
);
else
if
(
CONSP
(
raw
)
&&
INTEGERP
(
XC
ONS
(
raw
)
->
car
))
XSETINT
(
val
,
XINT
(
XC
ONS
(
raw
)
->
car
));
else
if
(
CONSP
(
raw
)
&&
INTEGERP
(
XC
AR
(
raw
)))
XSETINT
(
val
,
XINT
(
XC
AR
(
raw
)));
else
if
(
INTEGERP
(
raw
))
val
=
raw
;
else
...
...
src/callproc.c
View file @
70949dac
...
...
@@ -270,9 +270,9 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
for
(
i
=
0
;
i
<
nargs
;
i
++
)
args2
[
i
+
1
]
=
args
[
i
];
coding_systems
=
Ffind_operation_coding_system
(
nargs
+
1
,
args2
);
if
(
CONSP
(
coding_systems
))
val
=
XC
ONS
(
coding_systems
)
->
cdr
;
val
=
XC
DR
(
coding_systems
);
else
if
(
CONSP
(
Vdefault_process_coding_system
))
val
=
XC
ONS
(
Vdefault_process_coding_system
)
->
cdr
;
val
=
XC
DR
(
Vdefault_process_coding_system
);
else
val
=
Qnil
;
}
...
...
@@ -296,10 +296,10 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
(BUFFER-FOR-STDOUT FILE-FOR-STDERR). */
if
(
CONSP
(
buffer
))
{
if
(
CONSP
(
XC
ONS
(
buffer
)
->
cdr
))
if
(
CONSP
(
XC
DR
(
buffer
)))
{
Lisp_Object
stderr_file
;
stderr_file
=
XC
ONS
(
XC
ONS
(
buffer
)
->
cdr
)
->
car
;
stderr_file
=
XC
AR
(
XC
DR
(
buffer
)
)
;
if
(
NILP
(
stderr_file
)
||
EQ
(
Qt
,
stderr_file
))
error_file
=
stderr_file
;
...
...
@@ -307,7 +307,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
error_file
=
Fexpand_file_name
(
stderr_file
,
Qnil
);
}
buffer
=
XC
ONS
(
buffer
)
->
car
;
buffer
=
XC
AR
(
buffer
);
}
if
(
!
(
EQ
(
buffer
,
Qnil
)
...
...
@@ -698,9 +698,9 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
=
Ffind_operation_coding_system
(
nargs
+
1
,
args2
);
}
if
(
CONSP
(
coding_systems
))
val
=
XC
ONS
(
coding_systems
)
->
car
;
val
=
XC
AR
(
coding_systems
);
else
if
(
CONSP
(
Vdefault_process_coding_system
))
val
=
XC
ONS
(
Vdefault_process_coding_system
)
->
car
;
val
=
XC
AR
(
Vdefault_process_coding_system
);
else
val
=
Qnil
;
}
...
...
@@ -943,9 +943,9 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
for
(
i
=
0
;
i
<
nargs
;
i
++
)
args2
[
i
+
1
]
=
args
[
i
];
coding_systems
=
Ffind_operation_coding_system
(
nargs
+
1
,
args2
);
if
(
CONSP
(
coding_systems
))
val
=
XC
ONS
(
coding_systems
)
->
cdr
;
val
=
XC
DR
(
coding_systems
);
else
if
(
CONSP
(
Vdefault_process_coding_system
))
val
=
XC
ONS
(
Vdefault_process_coding_system
)
->
cdr
;
val
=
XC
DR
(
Vdefault_process_coding_system
);
else
val
=
Qnil
;
}
...
...
@@ -1088,8 +1088,8 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
new_length
=
0
;
for
(
tem
=
Vprocess_environment
;
CONSP
(
tem
)
&&
STRINGP
(
XC
ONS
(
tem
)
->
car
);
tem
=
XC
ONS
(
tem
)
->
cdr
)
CONSP
(
tem
)
&&
STRINGP
(
XC
AR
(
tem
));
tem
=
XC
DR
(
tem
))
new_length
++
;
/* new_length + 2 to include PWD and terminating 0. */
...
...
@@ -1102,11 +1102,11 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
/* Copy the Vprocess_environment strings into new_env. */
for
(
tem
=
Vprocess_environment
;
CONSP
(
tem
)
&&
STRINGP
(
XC
ONS
(
tem
)
->
car
);
tem
=
XC
ONS
(
tem
)
->
cdr
)
CONSP
(
tem
)
&&
STRINGP
(
XC
AR
(
tem
));
tem
=
XC
DR
(
tem
))
{
char
**
ep
=
env
;
char
*
string
=
(
char
*
)
XSTRING
(
XC
ONS
(
tem
)
->
car
)
->
data
;
char
*
string
=
(
char
*
)
XSTRING
(
XC
AR
(
tem
))
->
data
;
/* See if this string duplicates any string already in the env.
If so, don't put it in.
When an env var has multiple definitions,
...
...
@@ -1255,11 +1255,11 @@ getenv_internal (var, varlen, value, valuelen)
{
Lisp_Object
scan
;
for
(
scan
=
Vprocess_environment
;
CONSP
(
scan
);
scan
=
XC
ONS
(
scan
)
->
cdr
)
for
(
scan
=
Vprocess_environment
;
CONSP
(
scan
);
scan
=
XC
DR
(
scan
))
{
Lisp_Object
entry
;
entry
=
XC
ONS
(
scan
)
->
car
;
entry
=
XC
AR
(
scan
);
if
(
STRINGP
(
entry
)
&&
STRING_BYTES
(
XSTRING
(
entry
))
>
varlen
&&
XSTRING
(
entry
)
->
data
[
varlen
]
==
'='
...
...
src/dired.c
View file @
70949dac
...
...
@@ -486,9 +486,9 @@ file_name_completion (file, dirname, all_flag, ver_flag)
if
(
!
passcount
&&
len
>
XSTRING
(
encoded_file
)
->
size
)
/* and exit this for loop if a match is found */
for
(
tem
=
Vcompletion_ignored_extensions
;
CONSP
(
tem
);
tem
=
XC
ONS
(
tem
)
->
cdr
)
CONSP
(
tem
);
tem
=
XC
DR
(
tem
))
{
elt
=
XC
ONS
(
tem
)
->
car
;
elt
=
XC
AR
(
tem
);
if
(
!
STRINGP
(
elt
))
continue
;
skip
=
len
-
XSTRING
(
elt
)
->
size
;
if
(
skip
<
0
)
continue
;
...
...
@@ -514,9 +514,9 @@ file_name_completion (file, dirname, all_flag, ver_flag)
/* Ignore this element if it fails to match all the regexps. */
for
(
regexps
=
Vcompletion_regexp_list
;
CONSP
(
regexps
);
regexps
=
XC
ONS
(
regexps
)
->
cdr
)
regexps
=
XC
DR
(
regexps
))
{
tem
=
Fstring_match
(
XC
ONS
(
regexps
)
->
car
,
elt
,
zero
);
tem
=
Fstring_match
(
XC
AR
(
regexps
),
elt
,
zero
);
if
(
NILP
(
tem
))
break
;
}
...
...
src/floatfns.c
View file @
70949dac
...
...
@@ -222,7 +222,7 @@ extract_float (num)
CHECK_NUMBER_OR_FLOAT
(
num
,
0
);
if
(
FLOATP
(
num
))
return
XFLOAT
(
num
)
->
data
;
return
XFLOAT
_DATA
(
num
);
return
(
double
)
XINT
(
num
);
}
...
...
@@ -480,8 +480,8 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
XSETINT
(
val
,
acc
);
return
val
;
}
f1
=
FLOATP
(
arg1
)
?
XFLOAT
(
arg1
)
->
data
:
XINT
(
arg1
);
f2
=
FLOATP
(
arg2
)
?
XFLOAT
(
arg2
)
->
data
:
XINT
(
arg2
);
f1
=
FLOATP
(
arg1
)
?
XFLOAT
_DATA
(
arg1
)
:
XINT
(
arg1
);
f2
=
FLOATP
(
arg2
)
?
XFLOAT
_DATA
(
arg2
)
:
XINT
(
arg2
);
/* Really should check for overflow, too */
if
(
f1
==
0
.
0
&&
f2
==
0
.
0
)
f1
=
1
.
0
;
...
...
@@ -650,7 +650,7 @@ DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
CHECK_NUMBER_OR_FLOAT
(
arg
,
0
);
if
(
FLOATP
(
arg
))
IN_FLOAT
(
arg
=
make_float
(
fabs
(
XFLOAT
(
arg
)
->
data
)),
"abs"
,
arg
);
IN_FLOAT
(
arg
=
make_float
(
fabs
(
XFLOAT
_DATA
(
arg
))),
"abs"
,
arg
);
else
if
(
XINT
(
arg
)
<
0
)
XSETINT
(
arg
,
-
XINT
(
arg
));
...
...
@@ -743,8 +743,8 @@ rounding_driver (arg, divisor, double_round, int_round2, name)
{
double
f1
,
f2
;
f1
=
FLOATP
(
arg
)
?
XFLOAT
(
arg
)
->
data
:
XINT
(
arg
);
f2
=
(
FLOATP
(
divisor
)
?
XFLOAT
(
divisor
)
->
data
:
XINT
(
divisor
));
f1
=
FLOATP
(
arg
)
?
XFLOAT
_DATA
(
arg
)
:
XINT
(
arg
);
f2
=
(
FLOATP
(
divisor
)
?
XFLOAT
_DATA
(
divisor
)
:
XINT
(
divisor
));
if
(
!
IEEE_FLOATING_POINT
&&
f2
==
0
)
Fsignal
(
Qarith_error
,
Qnil
);
...
...
@@ -769,7 +769,7 @@ rounding_driver (arg, divisor, double_round, int_round2, name)
{
double
d
;
IN_FLOAT
(
d
=
(
*
double_round
)
(
XFLOAT
(
arg
)
->
data
),
name
,
arg
);
IN_FLOAT
(
d
=
(
*
double_round
)
(
XFLOAT
_DATA
(
arg
)),
name
,
arg
);
FLOAT_TO_INT
(
d
,
arg
,
name
,
arg
);
}
#endif
...
...
@@ -890,8 +890,8 @@ fmod_float (x, y)
{
double
f1
,
f2
;
f1
=
FLOATP
(
x
)
?
XFLOAT
(
x
)
->
data
:
XINT
(
x
);
f2
=
FLOATP
(
y
)
?
XFLOAT
(
y
)
->
data
:
XINT
(
y
);
f1
=
FLOATP
(
x
)
?
XFLOAT
_DATA
(
x
)
:
XINT
(
x
);
f2
=
FLOATP
(
y
)
?
XFLOAT
_DATA
(
y
)
:
XINT
(
y
);
if
(
!
IEEE_FLOATING_POINT
&&
f2
==
0
)
Fsignal
(
Qarith_error
,
Qnil
);
...
...
src/fns.c
View file @
70949dac
...
...
@@ -182,13 +182,13 @@ which is at least the number of distinct elements.")
/* halftail is used to detect circular lists. */
halftail
=
list
;
for
(
tail
=
list
;
CONSP
(
tail
);
tail
=
XC
ONS
(
tail
)
->
cdr
)
for
(
tail
=
list
;
CONSP
(
tail
);
tail
=
XC
DR
(
tail
))
{
if
(
EQ
(
tail
,
halftail
)
&&
len
!=
0
)
break
;
len
++
;
if
((
len
&
1
)
==
0
)
halftail
=
XC
ONS
(
halftail
)
->
cdr
;
halftail
=
XC
DR
(
halftail
);
}
XSETINT
(
length
,
len
);
...
...
@@ -630,9 +630,9 @@ concat (nargs, args, target_type, last_special)
else
if
(
BOOL_VECTOR_P
(
this
)
&&
XBOOL_VECTOR
(
this
)
->
size
>
0
)
wrong_type_argument
(
Qintegerp
,
Faref
(
this
,
make_number
(
0
)));
else
if
(
CONSP
(
this
))
for
(;
CONSP
(
this
);
this
=
XC
ONS
(
this
)
->
cdr
)
for
(;
CONSP
(
this
);
this
=
XC
DR
(
this
))
{
ch
=
XC
ONS
(
this
)
->
car
;
ch
=
XC
AR
(
this
);
if
(
!
INTEGERP
(
ch
))
wrong_type_argument
(
Qintegerp
,
ch
);
this_len_byte
=
CHAR_BYTES
(
XINT
(
ch
));
...
...
@@ -744,7 +744,7 @@ concat (nargs, args, target_type, last_special)
`this' is exhausted. */
if
(
NILP
(
this
))
break
;
if
(
CONSP
(
this
))
elt
=
XC
ONS
(
this
)
->
car
,
this
=
XC
ONS
(
this
)
->
cdr
;
elt
=
XC
AR
(
this
),
this
=
XC
DR
(
this
);
else
if
(
thisindex
>=
thisleni
)
break
;
else
if
(
STRINGP
(
this
))
...
...
@@ -787,9 +787,9 @@ concat (nargs, args, target_type, last_special)
/* Store this element into the result. */
if
(
toindex
<
0
)
{
XC
ONS
(
tail
)
->
car
=
elt
;
XC
AR
(
tail
)
=
elt
;
prev
=
tail
;
tail
=
XC
ONS
(
tail
)
->
cdr
;
tail
=
XC
DR
(
tail
);
}
else
if
(
VECTORP
(
val
))
XVECTOR
(
val
)
->
contents
[
toindex
++
]
=
elt
;
...
...
@@ -826,7 +826,7 @@ concat (nargs, args, target_type, last_special)
}
}
if
(
!
NILP
(
prev
))
XC
ONS
(
prev
)
->
cdr
=
last_tail
;
XC
DR
(
prev
)
=
last_tail
;
if
(
num_textprops
>
0
)
{
...
...
@@ -1127,13 +1127,13 @@ Elements of ALIST that are not conses are also shared.")
if
(
NILP
(
alist
))
return
alist
;
alist
=
concat
(
1
,
&
alist
,
Lisp_Cons
,
0
);
for
(
tem
=
alist
;
CONSP
(
tem
);
tem
=
XC
ONS
(
tem
)
->
cdr
)
for
(
tem
=
alist
;
CONSP
(
tem
);
tem
=
XC
DR
(
tem
))
{
register
Lisp_Object
car
;
car
=
XC
ONS
(
tem
)
->
car
;
car
=
XC
AR
(
tem
);
if
(
CONSP
(
car
))
XC
ONS
(
tem
)
->
car
=
Fcons
(
XC
ONS
(
car
)
->
car
,
XC
ONS
(
car
)
->
cdr
);
XC
AR
(
tem
)
=
Fcons
(
XC
AR
(
car
),
XC
DR
(
car
));
}
return
alist
;
}
...
...
@@ -1302,7 +1302,7 @@ The value is actually the tail of LIST whose car is ELT.")
Lisp_Object
list
;
{
register
Lisp_Object
tail
;
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
ONS
(
tail
)
->
cdr
)
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
DR
(
tail
))
{
register
Lisp_Object
tem
;
tem
=
Fcar
(
tail
);
...
...
@@ -1321,7 +1321,7 @@ The value is actually the tail of LIST whose car is ELT.")
Lisp_Object
list
;
{
register
Lisp_Object
tail
;
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
ONS
(
tail
)
->
cdr
)
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
DR
(
tail
))
{
register
Lisp_Object
tem
;
tem
=
Fcar
(
tail
);
...
...
@@ -1340,12 +1340,12 @@ Elements of LIST that are not conses are ignored.")
Lisp_Object
list
;
{
register
Lisp_Object
tail
;
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
ONS
(
tail
)
->
cdr
)
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
DR
(
tail
))
{
register
Lisp_Object
elt
,
tem
;
elt
=
Fcar
(
tail
);
if
(
!
CONSP
(
elt
))
continue
;
tem
=
XC
ONS
(
elt
)
->
car
;
tem
=
XC
AR
(
elt
);
if
(
EQ
(
key
,
tem
))
return
elt
;
QUIT
;
}
...
...
@@ -1361,12 +1361,12 @@ assq_no_quit (key, list)
Lisp_Object
list
;
{
register
Lisp_Object
tail
;
for
(
tail
=
list
;
CONSP
(
tail
);
tail
=
XC
ONS
(
tail
)
->
cdr
)
for
(
tail
=
list
;
CONSP
(
tail
);
tail
=
XC
DR
(
tail
))
{
register
Lisp_Object
elt
,
tem
;
elt
=
Fcar
(
tail
);
if
(
!
CONSP
(
elt
))
continue
;
tem
=
XC
ONS
(
elt
)
->
car
;
tem
=
XC
AR
(
elt
);
if
(
EQ
(
key
,
tem
))
return
elt
;
}
return
Qnil
;
...
...
@@ -1380,12 +1380,12 @@ The value is actually the element of LIST whose car equals KEY.")
Lisp_Object
list
;
{
register
Lisp_Object
tail
;
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
ONS
(
tail
)
->
cdr
)
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
DR
(
tail
))
{
register
Lisp_Object
elt
,
tem
;
elt
=
Fcar
(
tail
);
if
(
!
CONSP
(
elt
))
continue
;
tem
=
Fequal
(
XC
ONS
(
elt
)
->
car
,
key
);
tem
=
Fequal
(
XC
AR
(
elt
),
key
);
if
(
!
NILP
(
tem
))
return
elt
;
QUIT
;
}
...
...
@@ -1400,12 +1400,12 @@ The value is actually the element of LIST whose cdr is ELT.")
Lisp_Object
list
;
{
register
Lisp_Object
tail
;
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
ONS
(
tail
)
->
cdr
)
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
DR
(
tail
))
{
register
Lisp_Object
elt
,
tem
;
elt
=
Fcar
(
tail
);
if
(
!
CONSP
(
elt
))
continue
;
tem
=
XC
ONS
(
elt
)
->
cdr
;
tem
=
XC
DR
(
elt
);
if
(
EQ
(
key
,
tem
))
return
elt
;
QUIT
;
}
...
...
@@ -1420,12 +1420,12 @@ The value is actually the element of LIST whose cdr equals KEY.")
Lisp_Object
list
;
{
register
Lisp_Object
tail
;
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
ONS
(
tail
)
->
cdr
)
for
(
tail
=
list
;
!
NILP
(
tail
);
tail
=
XC
DR
(
tail
))
{
register
Lisp_Object
elt
,
tem
;
elt
=
Fcar
(
tail
);
if
(
!
CONSP
(
elt
))
continue
;
tem
=
Fequal
(
XC
ONS
(
elt
)
->
cdr
,
key
);
tem
=
Fequal
(
XC
DR
(
elt
),
key
);
if
(
!
NILP
(
tem
))
return
elt
;
QUIT
;
}
...
...
@@ -1453,13 +1453,13 @@ to be sure of changing the value of `foo'.")
if
(
EQ
(
elt
,
tem
))
{
if
(
NILP
(
prev
))
list
=
XC
ONS
(
tail
)
->
cdr
;
list
=
XC
DR
(
tail
);
else
Fsetcdr
(
prev
,
XC
ONS
(
tail
)
->
cdr
);
Fsetcdr
(
prev
,
XC
DR
(
tail
));
}
else
prev
=
tail
;
tail
=
XC
ONS
(
tail
)
->
cdr
;
tail
=
XC
DR
(
tail
);
QUIT
;
}
return
list
;
...
...
@@ -1487,13 +1487,13 @@ to be sure of changing the value of `foo'.")
if
(
!
NILP
(
Fequal
(
elt
,
tem
)))
{
if
(
NILP
(
prev
))
list
=
XC
ONS
(
tail
)
->
cdr
;
list
=
XC
DR
(
tail
);
else
Fsetcdr
(
prev
,
XC
ONS
(
tail
)
->
cdr
);
Fsetcdr
(
prev
,
XC
DR
(
tail
));
}
else
prev
=
tail
;
tail
=
XC
ONS
(
tail
)
->
cdr
;
tail
=
XC
DR
(
tail
);
QUIT
;