aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/ccl.c28
2 files changed, 21 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c8faecf8e53..825f2063681 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12001-11-12 Pavel Jan,Bm(Bk <Pavel@Janik.cz>
2
3 * ccl.c: Change macros to use do-while block instead of if-else.
4 Use braces to follow GNU Coding Standards.
5
12001-11-11 Richard M. Stallman <rms@gnu.org> 62001-11-11 Richard M. Stallman <rms@gnu.org>
2 7
3 * sysdep.c (child_setup_tty): Don't clear ICRNL or INLCR. 8 * sysdep.c (child_setup_tty): Don't clear ICRNL or INLCR.
diff --git a/src/ccl.c b/src/ccl.c
index d2cf59e62a8..e8eac521a3a 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -601,21 +601,25 @@ static tr_stack *mapping_stack_pointer;
601static int stack_idx_of_map_multiple; 601static int stack_idx_of_map_multiple;
602 602
603#define PUSH_MAPPING_STACK(restlen, orig) \ 603#define PUSH_MAPPING_STACK(restlen, orig) \
604 do { \ 604do \
605 { \
605 mapping_stack_pointer->rest_length = (restlen); \ 606 mapping_stack_pointer->rest_length = (restlen); \
606 mapping_stack_pointer->orig_val = (orig); \ 607 mapping_stack_pointer->orig_val = (orig); \
607 mapping_stack_pointer++; \ 608 mapping_stack_pointer++; \
608 } while (0) 609 } \
610while (0)
609 611
610#define POP_MAPPING_STACK(restlen, orig) \ 612#define POP_MAPPING_STACK(restlen, orig) \
611 do { \ 613do \
614 { \
612 mapping_stack_pointer--; \ 615 mapping_stack_pointer--; \
613 (restlen) = mapping_stack_pointer->rest_length; \ 616 (restlen) = mapping_stack_pointer->rest_length; \
614 (orig) = mapping_stack_pointer->orig_val; \ 617 (orig) = mapping_stack_pointer->orig_val; \
615 } while (0) 618 } \
619while (0)
616 620
617#define CCL_CALL_FOR_MAP_INSTRUCTION(symbol, ret_ic) \ 621#define CCL_CALL_FOR_MAP_INSTRUCTION(symbol, ret_ic) \
618if (1) \ 622do \
619 { \ 623 { \
620 struct ccl_program called_ccl; \ 624 struct ccl_program called_ccl; \
621 if (stack_idx >= 256 \ 625 if (stack_idx >= 256 \
@@ -635,7 +639,7 @@ if (1) \
635 ic = CCL_HEADER_MAIN; \ 639 ic = CCL_HEADER_MAIN; \
636 goto ccl_repeat; \ 640 goto ccl_repeat; \
637 } \ 641 } \
638else 642while (0)
639 643
640#define CCL_MapSingle 0x12 /* Map by single code conversion map 644#define CCL_MapSingle 0x12 /* Map by single code conversion map
641 1:ExtendedCOMMNDXXXRRRrrrXXXXX 645 1:ExtendedCOMMNDXXXRRRrrrXXXXX
@@ -676,34 +680,34 @@ else
676 680
677/* Terminate CCL program successfully. */ 681/* Terminate CCL program successfully. */
678#define CCL_SUCCESS \ 682#define CCL_SUCCESS \
679if (1) \ 683do \
680 { \ 684 { \
681 ccl->status = CCL_STAT_SUCCESS; \ 685 ccl->status = CCL_STAT_SUCCESS; \
682 goto ccl_finish; \ 686 goto ccl_finish; \
683 } \ 687 } \
684else 688while(0)
685 689
686/* Suspend CCL program because of reading from empty input buffer or 690/* Suspend CCL program because of reading from empty input buffer or
687 writing to full output buffer. When this program is resumed, the 691 writing to full output buffer. When this program is resumed, the
688 same I/O command is executed. */ 692 same I/O command is executed. */
689#define CCL_SUSPEND(stat) \ 693#define CCL_SUSPEND(stat) \
690if (1) \ 694do \
691 { \ 695 { \
692 ic--; \ 696 ic--; \
693 ccl->status = stat; \ 697 ccl->status = stat; \
694 goto ccl_finish; \ 698 goto ccl_finish; \
695 } \ 699 } \
696else 700while (0)
697 701
698/* Terminate CCL program because of invalid command. Should not occur 702/* Terminate CCL program because of invalid command. Should not occur
699 in the normal case. */ 703 in the normal case. */
700#define CCL_INVALID_CMD \ 704#define CCL_INVALID_CMD \
701if (1) \ 705do \
702 { \ 706 { \
703 ccl->status = CCL_STAT_INVALID_CMD; \ 707 ccl->status = CCL_STAT_INVALID_CMD; \
704 goto ccl_error_handler; \ 708 goto ccl_error_handler; \
705 } \ 709 } \
706else 710while(0)
707 711
708/* Encode one character CH to multibyte form and write to the current 712/* Encode one character CH to multibyte form and write to the current
709 output buffer. If CH is less than 256, CH is written as is. */ 713 output buffer. If CH is less than 256, CH is written as is. */