diff options
| author | Richard M. Stallman | 2003-04-06 20:33:59 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-04-06 20:33:59 +0000 |
| commit | 55a91ea3b58f0bf998f5138b7b61fada48cf25c0 (patch) | |
| tree | 964c648ed41aa09e66e631f5882a8d1a95a9e81f /src | |
| parent | 727fec2d40c0eaffc9f48e9d2da0cb33c5ccff0f (diff) | |
| download | emacs-55a91ea3b58f0bf998f5138b7b61fada48cf25c0.tar.gz emacs-55a91ea3b58f0bf998f5138b7b61fada48cf25c0.zip | |
(verify_bytepos): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/marker.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/marker.c b/src/marker.c index 0c1635fd2cb..b91609ca084 100644 --- a/src/marker.c +++ b/src/marker.c | |||
| @@ -252,6 +252,24 @@ buf_charpos_to_bytepos (b, charpos) | |||
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | #undef CONSIDER | 254 | #undef CONSIDER |
| 255 | |||
| 256 | /* Used for debugging: recompute the bytepos corresponding to CHARPOS | ||
| 257 | in the simplest, most reliable way. */ | ||
| 258 | |||
| 259 | int | ||
| 260 | verify_bytepos (charpos) | ||
| 261 | { | ||
| 262 | int below = 1; | ||
| 263 | int below_byte = 1; | ||
| 264 | |||
| 265 | while (below != charpos) | ||
| 266 | { | ||
| 267 | below++; | ||
| 268 | BUF_INC_POS (current_buffer, below_byte); | ||
| 269 | } | ||
| 270 | |||
| 271 | return below_byte; | ||
| 272 | } | ||
| 255 | 273 | ||
| 256 | /* bytepos_to_charpos returns the char position corresponding to BYTEPOS. */ | 274 | /* bytepos_to_charpos returns the char position corresponding to BYTEPOS. */ |
| 257 | 275 | ||