diff options
| author | Paul Eggert | 2015-11-20 12:15:22 -0800 |
|---|---|---|
| committer | Paul Eggert | 2015-11-20 12:15:53 -0800 |
| commit | 95f69f2c5999be4b9444861b6d4ae1bd3ab87f83 (patch) | |
| tree | bebff01bf38d43fd370132369b9e538524bf460e /src | |
| parent | 75a1d009f747a220c7b9b1cfdbe7077082fe02d6 (diff) | |
| download | emacs-95f69f2c5999be4b9444861b6d4ae1bd3ab87f83.tar.gz emacs-95f69f2c5999be4b9444861b6d4ae1bd3ab87f83.zip | |
Fix reindent-introduced typo in module code
* src/emacs-module.c (MODULE_SETJMP_1): Fix typo that I
introduced while reindenting the code earlier, and add a
comment explaining the unusual use of do-while here.
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs-module.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c index 09b09d03366..84072b9917e 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -192,24 +192,29 @@ static void module_wrong_type (emacs_env *, Lisp_Object, Lisp_Object); | |||
| 192 | /* It is very important that pushing the handler doesn't itself raise | 192 | /* It is very important that pushing the handler doesn't itself raise |
| 193 | a signal. Install the cleanup only after the handler has been | 193 | a signal. Install the cleanup only after the handler has been |
| 194 | pushed. Use __attribute__ ((cleanup)) to avoid | 194 | pushed. Use __attribute__ ((cleanup)) to avoid |
| 195 | non-local-exit-prone manual cleanup. */ | 195 | non-local-exit-prone manual cleanup. |
| 196 | |||
| 197 | The do-while forces uses of the macro to be followed by a semicolon. | ||
| 198 | This macro cannot enclose its entire body inside a do-while, as the | ||
| 199 | code after the macro may longjmp back into the macro, which means | ||
| 200 | its local variable C must stay live in later code. */ | ||
| 201 | |||
| 196 | #define MODULE_SETJMP_1(handlertype, handlerfunc, retval, c, dummy) \ | 202 | #define MODULE_SETJMP_1(handlertype, handlerfunc, retval, c, dummy) \ |
| 197 | do { \ | 203 | eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return); \ |
| 198 | eassert (module_non_local_exit_check (env) == emacs_funcall_exit_return); \ | 204 | struct handler *c = push_handler_nosignal (Qt, handlertype); \ |
| 199 | struct handler *c = push_handler_nosignal (Qt, handlertype); \ | 205 | if (!c) \ |
| 200 | if (!c) \ | 206 | { \ |
| 201 | { \ | 207 | module_out_of_memory (env); \ |
| 202 | module_out_of_memory (env); \ | 208 | return retval; \ |
| 203 | return retval; \ | 209 | } \ |
| 204 | } \ | 210 | verify (module_has_cleanup); \ |
| 205 | verify (module_has_cleanup); \ | 211 | int dummy __attribute__ ((cleanup (module_reset_handlerlist))); \ |
| 206 | int dummy __attribute__ ((cleanup (module_reset_handlerlist))); \ | 212 | if (sys_setjmp (c->jmp)) \ |
| 207 | if (sys_setjmp (c->jmp)) \ | 213 | { \ |
| 208 | { \ | 214 | (handlerfunc) (env, c->val); \ |
| 209 | (handlerfunc) (env, c->val); \ | 215 | return retval; \ |
| 210 | return retval; \ | 216 | } \ |
| 211 | } \ | 217 | do { } while (false) |
| 212 | } while (false) | ||
| 213 | 218 | ||
| 214 | 219 | ||
| 215 | /* Function environments. */ | 220 | /* Function environments. */ |