summaryrefslogtreecommitdiff
path: root/src/character.h
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2008-02-07 12:55:00 +0000
committerJan Djärv <jan.h.d@swipnet.se>2008-02-07 12:55:00 +0000
commita1c2ac9a200a3c40a373a6cef97c0c96fdfb2c09 (patch)
treec8f3386ba344ac1b47be150f77dd8ce5e0739b9a /src/character.h
parent92413ef3a119c29af24901e66b393d3c69cc83b5 (diff)
downloademacs-a1c2ac9a200a3c40a373a6cef97c0c96fdfb2c09.tar.gz
Use "do...while (0)", not "if (1)..else" in macro definitions.
Diffstat (limited to 'src/character.h')
-rw-r--r--src/character.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/character.h b/src/character.h
index 5afa9a796dc..60bd1f43f77 100644
--- a/src/character.h
+++ b/src/character.h
@@ -380,7 +380,7 @@ extern char unibyte_has_multibyte_table[256];
we increment them past the character fetched. */
#define FETCH_STRING_CHAR_ADVANCE(OUTPUT, STRING, CHARIDX, BYTEIDX) \
- if (1) \
+ do \
{ \
CHARIDX++; \
if (STRING_MULTIBYTE (STRING)) \
@@ -394,13 +394,13 @@ extern char unibyte_has_multibyte_table[256];
else \
OUTPUT = XSTRING (STRING)->data[BYTEIDX++]; \
} \
- else
+ while (0)
/* Like FETCH_STRING_CHAR_ADVANCE but return a multibyte character eve
if STRING is unibyte. */
#define FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE(OUTPUT, STRING, CHARIDX, BYTEIDX) \
- if (1) \
+ do \
{ \
CHARIDX++; \
if (STRING_MULTIBYTE (STRING)) \
@@ -417,13 +417,13 @@ extern char unibyte_has_multibyte_table[256];
MAKE_CHAR_MULTIBYTE (OUTPUT); \
} \
} \
- else
+ while (0)
/* Like FETCH_STRING_CHAR_ADVANCE but assumes STRING is multibyte. */
#define FETCH_STRING_CHAR_ADVANCE_NO_CHECK(OUTPUT, STRING, CHARIDX, BYTEIDX) \
- if (1) \
+ do \
{ \
unsigned char *ptr = &XSTRING (STRING)->data[BYTEIDX]; \
int len; \
@@ -432,14 +432,14 @@ extern char unibyte_has_multibyte_table[256];
BYTEIDX += len; \
CHARIDX++; \
} \
- else
+ while (0)
/* Like FETCH_STRING_CHAR_ADVANCE but fetch character from the current
buffer. */
#define FETCH_CHAR_ADVANCE(OUTPUT, CHARIDX, BYTEIDX) \
- if (1) \
+ do \
{ \
CHARIDX++; \
if (!NILP (current_buffer->enable_multibyte_characters)) \
@@ -456,13 +456,13 @@ extern char unibyte_has_multibyte_table[256];
BYTEIDX++; \
} \
} \
- else
+ while (0)
/* Like FETCH_CHAR_ADVANCE but assumes the current buffer is multibyte. */
#define FETCH_CHAR_ADVANCE_NO_CHECK(OUTPUT, CHARIDX, BYTEIDX) \
- if (1) \
+ do \
{ \
unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
int len; \
@@ -471,7 +471,7 @@ extern char unibyte_has_multibyte_table[256];
BYTEIDX += len; \
CHARIDX++; \
} \
- else
+ while (0)
/* Increase the buffer byte position POS_BYTE of the current buffer to