From 922903d21761d33f07630ab6de2b34fb738c3fda Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 16 May 1998 22:24:20 +0000 Subject: Update. * posix/Makefile (tests): Add runptests. (distribute): Add PTESTS, PTESTS2C.sed, and ptestcases.h. (before-compile): Add ptestcases.h. (ptestscases.h): Add rule to generate from PTESTS. * posix/runptests.c: New file. * posix/PTESTS: New file. * posix/PTESTS2C.sed: New file. 1998-05-15 Ulrich Drepper --- iconvdata/iso-2022-jp.c | 24 +++++++++++++----------- iconvdata/iso-2022-kr.c | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'iconvdata') diff --git a/iconvdata/iso-2022-jp.c b/iconvdata/iso-2022-jp.c index 900c733..3872988 100644 --- a/iconvdata/iso-2022-jp.c +++ b/iconvdata/iso-2022-jp.c @@ -55,10 +55,8 @@ struct gap enum direction dir = ((struct iso2022jp_data *) step->data)->dir; \ enum variant var = ((struct iso2022jp_data *) step->data)->var; \ int save_set; \ - int set = data->statep->count; -#define END_LOOP \ - data->statep->count = set; -#define EXTRA_LOOP_ARGS , var, set + int *setp = &data->statep->count; +#define EXTRA_LOOP_ARGS , var, setp /* Direction of the transformation. */ @@ -177,14 +175,14 @@ gconv_end (struct gconv_step *data) the output state to the initial state. This has to be done during the flushing. */ #define EMIT_SHIFT_TO_INIT \ - if (data->statep->count != 0) \ + if (data->statep->count != ASCII_set) \ { \ enum direction dir = ((struct iso2022jp_data *) step->data)->dir; \ \ if (dir == from_iso2022jp) \ /* It's easy, we don't have to emit anything, we just reset the \ state for the input. */ \ - data->statep->count = 0; \ + data->statep->count = ASCII_set; \ else \ { \ char *outbuf = data->outbuf; \ @@ -201,7 +199,7 @@ gconv_end (struct gconv_step *data) *outbuf++ = '('; \ *outbuf++ = 'B'; \ data->outbuf = outbuf; \ - data->statep->count = 0; \ + data->statep->count = ASCII_set; \ } \ } \ } @@ -211,9 +209,9 @@ gconv_end (struct gconv_step *data) and retore the state. */ #define SAVE_RESET_STATE(Save) \ if (Save) \ - save_set = set; \ + save_set = *setp; \ else \ - set = save_set + *setp = save_set /* First define the conversion function from ISO-2022-JP to UCS4. */ @@ -403,7 +401,9 @@ gconv_end (struct gconv_step *data) \ *((uint32_t *) outptr)++ = ch; \ } -#define EXTRA_LOOP_DECLS , enum variant var, int set +#define EXTRA_LOOP_DECLS , enum variant var, int *setp +#define INIT_PARAMS int set = *setp +#define UPDATE_PARAMS *setp = set #include @@ -691,7 +691,9 @@ gconv_end (struct gconv_step *data) /* Now that we wrote the output increment the input pointer. */ \ inptr += 4; \ } -#define EXTRA_LOOP_DECLS , enum variant var, int set +#define EXTRA_LOOP_DECLS , enum variant var, int *setp +#define INIT_PARAMS int set = *setp +#define UPDATE_PARAMS *setp = set #include diff --git a/iconvdata/iso-2022-kr.c b/iconvdata/iso-2022-kr.c index 6746f9c..b6aee4d 100644 --- a/iconvdata/iso-2022-kr.c +++ b/iconvdata/iso-2022-kr.c @@ -107,7 +107,7 @@ enum *setp = save_set -/* First define the conversion function from ISO-2022-JP to UCS4. */ +/* First define the conversion function from ISO-2022-KR to UCS4. */ #define MIN_NEEDED_INPUT MIN_NEEDED_FROM #define MAX_NEEDED_INPUT MAX_NEEDED_FROM #define MIN_NEEDED_OUTPUT MIN_NEEDED_TO -- cgit v1.1