Mercurial > hg > xemacs-beta
comparison src/marker.c @ 227:0e522484dd2a r20-5b12
Import from CVS: tag r20-5b12
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:12:37 +0200 |
parents | 859a2309aef8 |
children | 8efd647ea9ca |
comparison
equal
deleted
inserted
replaced
226:eea38c7ad7b4 | 227:0e522484dd2a |
---|---|
294 struct buffer *b = marker->buffer; | 294 struct buffer *b = marker->buffer; |
295 | 295 |
296 if (b == 0) | 296 if (b == 0) |
297 return; | 297 return; |
298 | 298 |
299 #ifdef ERROR_CHECK_GC | |
299 assert (BUFFER_LIVE_P (b)); | 300 assert (BUFFER_LIVE_P (b)); |
301 #endif | |
300 | 302 |
301 if (marker_next (marker)) | 303 if (marker_next (marker)) |
302 marker_prev (marker_next (marker)) = marker_prev (marker); | 304 marker_prev (marker_next (marker)) = marker_prev (marker); |
303 if (marker_prev (marker)) | 305 if (marker_prev (marker)) |
304 marker_next (marker_prev (marker)) = marker_next (marker); | 306 marker_next (marker_prev (marker)) = marker_next (marker); |
305 else | 307 else |
306 BUF_MARKERS (b) = marker_next (marker); | 308 BUF_MARKERS (b) = marker_next (marker); |
307 | 309 |
310 #ifdef ERROR_CHECK_GC | |
308 assert (marker != XMARKER (b->point_marker)); | 311 assert (marker != XMARKER (b->point_marker)); |
312 #endif | |
309 | 313 |
310 marker->buffer = 0; | 314 marker->buffer = 0; |
311 } | 315 } |
312 | 316 |
313 Bytind | 317 Bytind |
326 shit, I don't think this can happen. In any case, the following | 330 shit, I don't think this can happen. In any case, the following |
327 macro has an assert() in it that will catch these denormalized | 331 macro has an assert() in it that will catch these denormalized |
328 positions. */ | 332 positions. */ |
329 pos = memind_to_bytind (buf, m->memind); | 333 pos = memind_to_bytind (buf, m->memind); |
330 | 334 |
335 #ifdef ERROR_CHECK_BUFPOS | |
331 if (pos < BI_BUF_BEG (buf) || pos > BI_BUF_Z (buf)) | 336 if (pos < BI_BUF_BEG (buf) || pos > BI_BUF_Z (buf)) |
332 abort (); | 337 abort (); |
338 #endif | |
333 | 339 |
334 return pos; | 340 return pos; |
335 } | 341 } |
336 | 342 |
337 Bufpos | 343 Bufpos |
352 struct buffer *buf = m->buffer; | 358 struct buffer *buf = m->buffer; |
353 | 359 |
354 if (!buf) | 360 if (!buf) |
355 error ("Marker does not point anywhere"); | 361 error ("Marker does not point anywhere"); |
356 | 362 |
363 #ifdef ERROR_CHECK_BUFPOS | |
357 if (pos < BI_BUF_BEG (buf) || pos > BI_BUF_Z (buf)) | 364 if (pos < BI_BUF_BEG (buf) || pos > BI_BUF_Z (buf)) |
358 abort (); | 365 abort (); |
366 #endif | |
359 | 367 |
360 m->memind = bytind_to_memind (buf, pos); | 368 m->memind = bytind_to_memind (buf, pos); |
361 } | 369 } |
362 | 370 |
363 void | 371 void |