diff options
| author | Paul Eggert | 2016-03-10 07:34:52 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-03-10 07:59:19 -0800 |
| commit | 7352c6c695db8b90b63c2601277d64a32507d2bb (patch) | |
| tree | 1dc5f7af755a70f67efe13882099ff4920230571 /src/buffer.h | |
| parent | a589e9aed5255fb1ebfb38fa4b3c9df5f6ef7448 (diff) | |
| download | emacs-7352c6c695db8b90b63c2601277d64a32507d2bb.tar.gz emacs-7352c6c695db8b90b63c2601277d64a32507d2bb.zip | |
Rework C source files to avoid ^(
Work around Bug#22884 by rewording comments and strings to avoid ‘(’
at the start of a line unless it starts a function. This change
is a short-term hack; in the longer run we plan to fix cc-mode’s
performance for C files that have ‘(’ at the start of a line in a
comment or string.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/buffer.h b/src/buffer.h index 5783bfb51ab..87b7cee4413 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -7,8 +7,8 @@ This file is part of GNU Emacs. | |||
| 7 | 7 | ||
| 8 | GNU Emacs is free software: you can redistribute it and/or modify | 8 | GNU Emacs is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by | 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 3 of the License, or | 10 | the Free Software Foundation, either version 3 of the License, or (at |
| 11 | (at your option) any later version. | 11 | your option) any later version. |
| 12 | 12 | ||
| 13 | GNU Emacs is distributed in the hope that it will be useful, | 13 | GNU Emacs is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| @@ -352,9 +352,9 @@ extern void enlarge_buffer_text (struct buffer *, ptrdiff_t); | |||
| 352 | /* Convert PTR, the address of a byte in the buffer, into a byte position. */ | 352 | /* Convert PTR, the address of a byte in the buffer, into a byte position. */ |
| 353 | 353 | ||
| 354 | #define PTR_BYTE_POS(ptr) \ | 354 | #define PTR_BYTE_POS(ptr) \ |
| 355 | ((ptr) - (current_buffer)->text->beg \ | 355 | ((ptr) - (current_buffer)->text->beg \ |
| 356 | - (ptr - (current_buffer)->text->beg <= GPT_BYTE - BEG_BYTE ? 0 : GAP_SIZE) \ | 356 | - (ptr - (current_buffer)->text->beg <= GPT_BYTE - BEG_BYTE ? 0 : GAP_SIZE) \ |
| 357 | + BEG_BYTE) | 357 | + BEG_BYTE) |
| 358 | 358 | ||
| 359 | /* Return character at byte position POS. See the caveat WARNING for | 359 | /* Return character at byte position POS. See the caveat WARNING for |
| 360 | FETCH_MULTIBYTE_CHAR below. */ | 360 | FETCH_MULTIBYTE_CHAR below. */ |
| @@ -386,24 +386,24 @@ extern void enlarge_buffer_text (struct buffer *, ptrdiff_t); | |||
| 386 | Note that both arguments can be computed more than once. */ | 386 | Note that both arguments can be computed more than once. */ |
| 387 | 387 | ||
| 388 | #define BUF_BYTE_ADDRESS(buf, pos) \ | 388 | #define BUF_BYTE_ADDRESS(buf, pos) \ |
| 389 | ((buf)->text->beg + (pos) - BEG_BYTE \ | 389 | ((buf)->text->beg + (pos) - BEG_BYTE \ |
| 390 | + ((pos) >= (buf)->text->gpt_byte ? (buf)->text->gap_size : 0)) | 390 | + ((pos) >= (buf)->text->gpt_byte ? (buf)->text->gap_size : 0)) |
| 391 | 391 | ||
| 392 | /* Return the address of character at char position POS in buffer BUF. | 392 | /* Return the address of character at char position POS in buffer BUF. |
| 393 | Note that both arguments can be computed more than once. */ | 393 | Note that both arguments can be computed more than once. */ |
| 394 | 394 | ||
| 395 | #define BUF_CHAR_ADDRESS(buf, pos) \ | 395 | #define BUF_CHAR_ADDRESS(buf, pos) \ |
| 396 | ((buf)->text->beg + buf_charpos_to_bytepos ((buf), (pos)) - BEG_BYTE \ | 396 | ((buf)->text->beg + buf_charpos_to_bytepos ((buf), (pos)) - BEG_BYTE \ |
| 397 | + ((pos) >= (buf)->text->gpt ? (buf)->text->gap_size : 0)) | 397 | + ((pos) >= (buf)->text->gpt ? (buf)->text->gap_size : 0)) |
| 398 | 398 | ||
| 399 | /* Convert PTR, the address of a char in buffer BUF, | 399 | /* Convert PTR, the address of a char in buffer BUF, |
| 400 | into a character position. */ | 400 | into a character position. */ |
| 401 | 401 | ||
| 402 | #define BUF_PTR_BYTE_POS(buf, ptr) \ | 402 | #define BUF_PTR_BYTE_POS(buf, ptr) \ |
| 403 | ((ptr) - (buf)->text->beg \ | 403 | ((ptr) - (buf)->text->beg \ |
| 404 | - (ptr - (buf)->text->beg <= BUF_GPT_BYTE (buf) - BEG_BYTE \ | 404 | - (ptr - (buf)->text->beg <= BUF_GPT_BYTE (buf) - BEG_BYTE \ |
| 405 | ? 0 : BUF_GAP_SIZE ((buf))) \ | 405 | ? 0 : BUF_GAP_SIZE ((buf))) \ |
| 406 | + BEG_BYTE) | 406 | + BEG_BYTE) |
| 407 | 407 | ||
| 408 | /* Return the character at byte position POS in buffer BUF. */ | 408 | /* Return the character at byte position POS in buffer BUF. */ |
| 409 | 409 | ||