Mercurial > emacs
comparison src/composite.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 | a61b3d907098 |
children | cdfd4d09b79a |
comparison
equal
deleted
inserted
replaced
39972:b2479b43184b | 39973:579177964efa |
---|---|
247 from Form-A above to Form-B while replacing COMPONENTS with | 247 from Form-A above to Form-B while replacing COMPONENTS with |
248 COMPONENTS-VEC stored in the hash table. We can directly | 248 COMPONENTS-VEC stored in the hash table. We can directly |
249 modify the cons cell of PROP because it is not shared. */ | 249 modify the cons cell of PROP because it is not shared. */ |
250 key = HASH_KEY (hash_table, hash_index); | 250 key = HASH_KEY (hash_table, hash_index); |
251 id = HASH_VALUE (hash_table, hash_index); | 251 id = HASH_VALUE (hash_table, hash_index); |
252 XCAR (prop) = id; | 252 XSETCAR (prop, id); |
253 XCDR (prop) = Fcons (make_number (nchars), Fcons (key, XCDR (prop))); | 253 XSETCDR (prop, Fcons (make_number (nchars), Fcons (key, XCDR (prop)))); |
254 return XINT (id); | 254 return XINT (id); |
255 } | 255 } |
256 | 256 |
257 /* This composition is a new one. We must register it. */ | 257 /* This composition is a new one. We must register it. */ |
258 | 258 |
295 } | 295 } |
296 | 296 |
297 /* Change PROP from Form-A above to Form-B. We can directly modify | 297 /* Change PROP from Form-A above to Form-B. We can directly modify |
298 the cons cell of PROP because it is not shared. */ | 298 the cons cell of PROP because it is not shared. */ |
299 XSETFASTINT (id, n_compositions); | 299 XSETFASTINT (id, n_compositions); |
300 XCAR (prop) = id; | 300 XSETCAR (prop, id); |
301 XCDR (prop) = Fcons (make_number (nchars), Fcons (key, XCDR (prop))); | 301 XSETCDR (prop, Fcons (make_number (nchars), Fcons (key, XCDR (prop)))); |
302 | 302 |
303 /* Register the composition in composition_hash_table. */ | 303 /* Register the composition in composition_hash_table. */ |
304 hash_index = hash_put (hash_table, key, id, hash_code); | 304 hash_index = hash_put (hash_table, key, id, hash_code); |
305 | 305 |
306 /* Register the composition in composition_table. */ | 306 /* Register the composition in composition_table. */ |
567 plist = XCAR (XCDR (XCDR (XCAR (list)))); | 567 plist = XCAR (XCDR (XCDR (XCAR (list)))); |
568 while (CONSP (plist) && CONSP (XCDR (plist))) | 568 while (CONSP (plist) && CONSP (XCDR (plist))) |
569 { | 569 { |
570 if (EQ (XCAR (plist), Qcomposition) | 570 if (EQ (XCAR (plist), Qcomposition) |
571 && (val = XCAR (XCDR (plist)), CONSP (val))) | 571 && (val = XCAR (XCDR (plist)), CONSP (val))) |
572 XCAR (XCDR (plist)) = Fcons (XCAR (val), XCDR (val)); | 572 XSETCAR (XCDR (plist), Fcons (XCAR (val), XCDR (val))); |
573 plist = XCDR (XCDR (plist)); | 573 plist = XCDR (XCDR (plist)); |
574 } | 574 } |
575 } | 575 } |
576 } | 576 } |
577 | 577 |