Commit 760fbc2c authored by Paul Eggert's avatar Paul Eggert
Browse files

character.h: Rename locals to avoid shadowing.

* character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
(FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
(BUF_DEC_POS): Be more systematic about renaming local temporaries
to avoid shadowing.
parent ff08eb85
2011-03-18 Paul Eggert <eggert@cs.ucla.edu>
 
character.h: Rename locals to avoid shadowing.
* character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
(FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
(BUF_DEC_POS): Be more systematic about renaming local temporaries
to avoid shadowing.
* textprop.c (property_change_between_p): Remove; unused.
 
* intervals.c (interval_start_pos): Now static.
......@@ -278,11 +278,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
do { \
if ((p) > (limit)) \
{ \
const unsigned char *pcb = (p); \
const unsigned char *chp = (p); \
do { \
pcb--; \
} while (pcb >= limit && ! CHAR_HEAD_P (*pcb)); \
(p) = (BYTES_BY_CHAR_HEAD (*pcb) == (p) - pcb) ? pcb : (p) - 1; \
chp--; \
} while (chp >= limit && ! CHAR_HEAD_P (*chp)); \
(p) = (BYTES_BY_CHAR_HEAD (*chp) == (p) - chp) ? chp : (p) - 1; \
} \
} while (0)
......@@ -353,11 +353,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
CHARIDX++; \
if (STRING_MULTIBYTE (STRING)) \
{ \
unsigned char *string_ptr = &SDATA (STRING)[BYTEIDX]; \
int string_len; \
unsigned char *chp = &SDATA (STRING)[BYTEIDX]; \
int chlen; \
\
OUTPUT = STRING_CHAR_AND_LENGTH (string_ptr, string_len); \
BYTEIDX += string_len; \
OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \
BYTEIDX += chlen; \
} \
else \
{ \
......@@ -376,11 +376,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
CHARIDX++; \
if (STRING_MULTIBYTE (STRING)) \
{ \
unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \
int ptrlen; \
unsigned char *chp = &SDATA (STRING)[BYTEIDX]; \
int chlen; \
\
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, ptrlen); \
BYTEIDX += ptrlen; \
OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \
BYTEIDX += chlen; \
} \
else \
{ \
......@@ -416,11 +416,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
CHARIDX++; \
if (!NILP (BVAR (current_buffer, enable_multibyte_characters))) \
{ \
unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
int string_len; \
unsigned char *chp = BYTE_POS_ADDR (BYTEIDX); \
int chlen; \
\
OUTPUT= STRING_CHAR_AND_LENGTH (ptr, string_len); \
BYTEIDX += string_len; \
OUTPUT= STRING_CHAR_AND_LENGTH (chp, chlen); \
BYTEIDX += chlen; \
} \
else \
{ \
......@@ -436,11 +436,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define FETCH_CHAR_ADVANCE_NO_CHECK(OUTPUT, CHARIDX, BYTEIDX) \
do \
{ \
unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
int len; \
unsigned char *chp = BYTE_POS_ADDR (BYTEIDX); \
int chlen; \
\
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \
BYTEIDX += len; \
OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \
BYTEIDX += chlen; \
CHARIDX++; \
} \
while (0)
......@@ -451,8 +451,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define INC_POS(pos_byte) \
do { \
unsigned char *ptr = BYTE_POS_ADDR (pos_byte); \
pos_byte += BYTES_BY_CHAR_HEAD (*ptr); \
unsigned char *chp = BYTE_POS_ADDR (pos_byte); \
pos_byte += BYTES_BY_CHAR_HEAD (*chp); \
} while (0)
......@@ -461,16 +461,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define DEC_POS(pos_byte) \
do { \
unsigned char *ptr; \
unsigned char *chp; \
\
pos_byte--; \
if (pos_byte < GPT_BYTE) \
ptr = BEG_ADDR + pos_byte - BEG_BYTE; \
chp = BEG_ADDR + pos_byte - BEG_BYTE; \
else \
ptr = BEG_ADDR + GAP_SIZE + pos_byte - BEG_BYTE; \
while (!CHAR_HEAD_P (*ptr)) \
chp = BEG_ADDR + GAP_SIZE + pos_byte - BEG_BYTE; \
while (!CHAR_HEAD_P (*chp)) \
{ \
ptr--; \
chp--; \
pos_byte--; \
} \
} while (0)
......@@ -510,8 +510,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BUF_INC_POS(buf, pos_byte) \
do { \
unsigned char *bbp = BUF_BYTE_ADDRESS (buf, pos_byte); \
pos_byte += BYTES_BY_CHAR_HEAD (*bbp); \
unsigned char *chp = BUF_BYTE_ADDRESS (buf, pos_byte); \
pos_byte += BYTES_BY_CHAR_HEAD (*chp); \
} while (0)
......@@ -520,15 +520,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BUF_DEC_POS(buf, pos_byte) \
do { \
unsigned char *p; \
unsigned char *chp; \
pos_byte--; \
if (pos_byte < BUF_GPT_BYTE (buf)) \
p = BUF_BEG_ADDR (buf) + pos_byte - BEG_BYTE; \
chp = BUF_BEG_ADDR (buf) + pos_byte - BEG_BYTE; \
else \
p = BUF_BEG_ADDR (buf) + BUF_GAP_SIZE (buf) + pos_byte - BEG_BYTE;\
while (!CHAR_HEAD_P (*p)) \
chp = BUF_BEG_ADDR (buf) + BUF_GAP_SIZE (buf) + pos_byte - BEG_BYTE;\
while (!CHAR_HEAD_P (*chp)) \
{ \
p--; \
chp--; \
pos_byte--; \
} \
} while (0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment