aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2008-02-07 12:47:00 +0000
committerJan Djärv2008-02-07 12:47:00 +0000
commit92413ef3a119c29af24901e66b393d3c69cc83b5 (patch)
tree597e3de17cbc3588975e040fdc239331b439d066 /src
parent03fa5713cc5eb2226a5ca3fb1ce59a9e9f46ffae (diff)
downloademacs-92413ef3a119c29af24901e66b393d3c69cc83b5.tar.gz
emacs-92413ef3a119c29af24901e66b393d3c69cc83b5.zip
Use "do...while (0)", not "if (1)..else" in macro definitions.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/buffer.h4
-rw-r--r--src/syntax.h8
3 files changed, 16 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9fcc90c2391..396ce321f72 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,15 @@
12008-02-07 Jim Meyering <meyering@redhat.com> 12008-02-07 Jim Meyering <meyering@redhat.com>
2 2
3 Use "do...while (0)", not "if (1)..else" in macro definitions.
4 The latter provokes a warning from gcc about the empty else, when
5 followed by ";". Also, without that trailing semicolon, it would
6 silently swallow up any following statement.
7 * syntax.h (SETUP_SYNTAX_TABLE):
8 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Likewise.
9 * buffer.h (DECODE_POSITION): Likewise.
10
112008-02-07 Jim Meyering <meyering@redhat.com>
12
3 * lread.c [lint]: Don't include <sys/inode.h>. 13 * lread.c [lint]: Don't include <sys/inode.h>.
4 14
52008-02-07 Stefan Monnier <monnier@iro.umontreal.ca> 152008-02-07 Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/src/buffer.h b/src/buffer.h
index 87d646f35fe..8345c8fa06f 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -266,7 +266,7 @@ extern void enlarge_buffer_text P_ ((struct buffer *, int));
266 and store the charpos in CHARPOS and the bytepos in BYTEPOS. */ 266 and store the charpos in CHARPOS and the bytepos in BYTEPOS. */
267 267
268#define DECODE_POSITION(charpos, bytepos, pos) \ 268#define DECODE_POSITION(charpos, bytepos, pos) \
269if (1) \ 269do \
270 { \ 270 { \
271 Lisp_Object __pos = (pos); \ 271 Lisp_Object __pos = (pos); \
272 if (NUMBERP (__pos)) \ 272 if (NUMBERP (__pos)) \
@@ -282,7 +282,7 @@ if (1) \
282 else \ 282 else \
283 wrong_type_argument (Qinteger_or_marker_p, __pos); \ 283 wrong_type_argument (Qinteger_or_marker_p, __pos); \
284 } \ 284 } \
285else 285while (0)
286 286
287/* Return the address of byte position N in current buffer. */ 287/* Return the address of byte position N in current buffer. */
288 288
diff --git a/src/syntax.h b/src/syntax.h
index 5a5a8a96da3..1138dca9887 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -256,7 +256,7 @@ extern char syntax_code_spec[16];
256 */ 256 */
257 257
258#define SETUP_SYNTAX_TABLE(FROM, COUNT) \ 258#define SETUP_SYNTAX_TABLE(FROM, COUNT) \
259if (1) \ 259do \
260 { \ 260 { \
261 gl_state.b_property = BEGV; \ 261 gl_state.b_property = BEGV; \
262 gl_state.e_property = ZV + 1; \ 262 gl_state.e_property = ZV + 1; \
@@ -269,7 +269,7 @@ if (1) \
269 update_syntax_table ((COUNT) > 0 ? (FROM) : (FROM) - 1, (COUNT),\ 269 update_syntax_table ((COUNT) > 0 ? (FROM) : (FROM) - 1, (COUNT),\
270 1, Qnil); \ 270 1, Qnil); \
271 } \ 271 } \
272else 272while (0)
273 273
274/* Same as above, but in OBJECT. If OBJECT is nil, use current buffer. 274/* Same as above, but in OBJECT. If OBJECT is nil, use current buffer.
275 If it is t, ignore properties altogether. 275 If it is t, ignore properties altogether.
@@ -279,7 +279,7 @@ else
279 So if it is a buffer, we set the offset field to BEGV. */ 279 So if it is a buffer, we set the offset field to BEGV. */
280 280
281#define SETUP_SYNTAX_TABLE_FOR_OBJECT(OBJECT, FROM, COUNT) \ 281#define SETUP_SYNTAX_TABLE_FOR_OBJECT(OBJECT, FROM, COUNT) \
282if (1) \ 282do \
283 { \ 283 { \
284 gl_state.object = (OBJECT); \ 284 gl_state.object = (OBJECT); \
285 if (BUFFERP (gl_state.object)) \ 285 if (BUFFERP (gl_state.object)) \
@@ -314,7 +314,7 @@ if (1) \
314 + (COUNT > 0 ? 0 : -1)), \ 314 + (COUNT > 0 ? 0 : -1)), \
315 COUNT, 1, gl_state.object); \ 315 COUNT, 1, gl_state.object); \
316 } \ 316 } \
317else 317while (0)
318 318
319struct gl_state_s 319struct gl_state_s
320{ 320{