projects
/
chise
/
xemacs-chise.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(expand-char-feature-name): New function.
[chise/xemacs-chise.git]
/
src
/
mule-ccl.c
diff --git
a/src/mule-ccl.c
b/src/mule-ccl.c
index
0029611
..
a1a4083
100644
(file)
--- a/
src/mule-ccl.c
+++ b/
src/mule-ccl.c
@@
-31,7
+31,7
@@
Boston, MA 02111-1307, USA. */
#include "lisp.h"
#include "buffer.h"
#include "lisp.h"
#include "buffer.h"
-#include "mule-charset.h"
+#include "character.h"
#include "mule-ccl.h"
#include "file-coding.h"
#include "mule-ccl.h"
#include "file-coding.h"
@@
-423,7
+423,7
@@
Lisp_Object Vccl_program_table;
IC += 2;
*/
IC += 2;
*/
-#define CCL_Extention 0x1F /* Extended CCL code
+#define CCL_Extension 0x1F /* Extended CCL code
1:ExtendedCOMMNDRrrRRRrrrXXXXX
2:ARGUMENT
3:...
1:ExtendedCOMMNDRrrRRRrrrXXXXX
2:ARGUMENT
3:...
@@
-634,7
+634,9
@@
static int stack_idx_of_map_multiple;
stack_idx++; \
ccl_prog = called_ccl.prog; \
ic = CCL_HEADER_MAIN; \
stack_idx++; \
ccl_prog = called_ccl.prog; \
ic = CCL_HEADER_MAIN; \
- goto ccl_repeat; \
+ /* The "if (1)" prevents warning \
+ "end-of loop code not reached" */ \
+ if (1) goto ccl_repeat; \
} while (0)
#define CCL_MapSingle 0x12 /* Map by single code conversion map
} while (0)
#define CCL_MapSingle 0x12 /* Map by single code conversion map
@@
-678,7
+680,9
@@
static int stack_idx_of_map_multiple;
#define CCL_SUCCESS \
do { \
ccl->status = CCL_STAT_SUCCESS; \
#define CCL_SUCCESS \
do { \
ccl->status = CCL_STAT_SUCCESS; \
- goto ccl_finish; \
+ /* The "if (1)" inhibits the warning \
+ "end-of loop code not reached" */ \
+ if (1) goto ccl_finish; \
} while (0)
/* Suspend CCL program because of reading from empty input buffer or
} while (0)
/* Suspend CCL program because of reading from empty input buffer or
@@
-687,8
+691,10
@@
static int stack_idx_of_map_multiple;
#define CCL_SUSPEND(stat) \
do { \
ic--; \
#define CCL_SUSPEND(stat) \
do { \
ic--; \
- ccl->status = stat; \
- goto ccl_finish; \
+ ccl->status = (stat); \
+ /* The "if (1)" inhibits the warning \
+ "end-of loop code not reached" */ \
+ if (1) goto ccl_finish; \
} while (0)
/* Terminate CCL program because of invalid command. Should not occur
} while (0)
/* Terminate CCL program because of invalid command. Should not occur
@@
-696,7
+702,9
@@
static int stack_idx_of_map_multiple;
#define CCL_INVALID_CMD \
do { \
ccl->status = CCL_STAT_INVALID_CMD; \
#define CCL_INVALID_CMD \
do { \
ccl->status = CCL_STAT_INVALID_CMD; \
- goto ccl_error_handler; \
+ /* The "if (1)" inhibits the warning \
+ "end-of loop code not reached" */ \
+ if (1) goto ccl_error_handler; \
} while (0)
/* Encode one character CH to multibyte form and write to the current
} while (0)
/* Encode one character CH to multibyte form and write to the current
@@
-709,7
+717,7
@@
static int stack_idx_of_map_multiple;
CCL_INVALID_CMD; \
if (conversion_mode == CCL_MODE_ENCODING) \
{ \
CCL_INVALID_CMD; \
if (conversion_mode == CCL_MODE_ENCODING) \
{ \
- if (ch == '\n') \
+ if ((ch) == '\n') \
{ \
if (ccl->eol_type == CCL_CODING_EOL_CRLF) \
{ \
{ \
if (ccl->eol_type == CCL_CODING_EOL_CRLF) \
{ \
@@
-721,7
+729,7
@@
static int stack_idx_of_map_multiple;
else \
Dynarr_add (destination, '\n'); \
} \
else \
Dynarr_add (destination, '\n'); \
} \
- else if (ch < 0x100) \
+ else if ((ch) < 0x100) \
{ \
Dynarr_add (destination, ch); \
} \
{ \
Dynarr_add (destination, ch); \
} \
@@
-760,7
+768,7
@@
static int stack_idx_of_map_multiple;
CCL_INVALID_CMD; \
else if (conversion_mode == CCL_MODE_ENCODING) \
{ \
CCL_INVALID_CMD; \
else if (conversion_mode == CCL_MODE_ENCODING) \
{ \
- for (i = 0; i < len; i++) \
+ for (i = 0; i < (len); i++) \
{ \
ch = ((XINT (ccl_prog[ic + (i / 3)])) \
>> ((2 - (i % 3)) * 8)) & 0xFF; \
{ \
ch = ((XINT (ccl_prog[ic + (i / 3)])) \
>> ((2 - (i % 3)) * 8)) & 0xFF; \
@@
-789,7
+797,7
@@
static int stack_idx_of_map_multiple;
} \
else \
{ \
} \
else \
{ \
- for (i = 0; i < len; i++) \
+ for (i = 0; i < (len); i++) \
{ \
ch = ((XINT (ccl_prog[ic + (i / 3)])) \
>> ((2 - (i % 3)) * 8)) & 0xFF; \
{ \
ch = ((XINT (ccl_prog[ic + (i / 3)])) \
>> ((2 - (i % 3)) * 8)) & 0xFF; \
@@
-812,7
+820,7
@@
static int stack_idx_of_map_multiple;
if (!src) \
CCL_INVALID_CMD; \
if (src < src_end) \
if (!src) \
CCL_INVALID_CMD; \
if (src < src_end) \
- r = *src++; \
+ (r) = *src++; \
else \
{ \
if (ccl->last_block) \
else \
{ \
if (ccl->last_block) \
@@
-837,20
+845,20
@@
static int stack_idx_of_map_multiple;
#if 0
#define CCL_MAKE_CHAR(charset, code, c) \
do { \
#if 0
#define CCL_MAKE_CHAR(charset, code, c) \
do { \
- if (charset == CHARSET_ASCII) \
- c = code & 0xFF; \
+ if ((charset) == CHARSET_ASCII) \
+ (c) = (code) & 0xFF; \
else if (CHARSET_DEFINED_P (charset) \
else if (CHARSET_DEFINED_P (charset) \
- && (code & 0x7F) >= 32 \
- && (code < 256 || ((code >> 7) & 0x7F) >= 32)) \
+ && ((code) & 0x7F) >= 32 \
+ && ((code) < 256 || ((code >> 7) & 0x7F) >= 32)) \
{ \
{ \
- int c1 = code & 0x7F, c2 = 0; \
+ int c1 = (code) & 0x7F, c2 = 0; \
\
\
- if (code >= 256) \
- c2 = c1, c1 = (code >> 7) & 0x7F; \
- c = MAKE_CHAR (charset, c1, c2); \
+ if ((code) >= 256) \
+ c2 = c1, c1 = ((code) >> 7) & 0x7F; \
+ (c) = MAKE_CHAR (charset, c1, c2); \
} \
else \
} \
else \
- c = code & 0xFF; \
+ (c) = (code) & 0xFF; \
} while (0)
#endif
} while (0)
#endif
@@
-1268,14
+1276,14
@@
ccl_driver (struct ccl_program *ccl,
ic = jump_address;
break;
ic = jump_address;
break;
- case CCL_Extention:
+ case CCL_Extension:
switch (EXCMD)
{
switch (EXCMD)
{
+#ifndef UTF2000
case CCL_ReadMultibyteChar2:
if (!src)
CCL_INVALID_CMD;
case CCL_ReadMultibyteChar2:
if (!src)
CCL_INVALID_CMD;
- do {
if (src >= src_end)
{
src++;
if (src >= src_end)
{
src++;
@@
-1327,8
+1335,6
@@
ccl_driver (struct ccl_program *ccl,
reg[RRR] = LEADING_BYTE_ASCII;
reg[rrr] = i;
}
reg[RRR] = LEADING_BYTE_ASCII;
reg[rrr] = i;
}
- break;
- } while (1);
break;
ccl_read_multibyte_character_suspend:
break;
ccl_read_multibyte_character_suspend:
@@
-1342,7
+1348,9
@@
ccl_driver (struct ccl_program *ccl,
CCL_SUSPEND (CCL_STAT_SUSPEND_BY_SRC);
break;
CCL_SUSPEND (CCL_STAT_SUSPEND_BY_SRC);
break;
+#endif
+#ifndef UTF2000
case CCL_WriteMultibyteChar2:
i = reg[RRR]; /* charset */
if (i == LEADING_BYTE_ASCII)
case CCL_WriteMultibyteChar2:
i = reg[RRR]; /* charset */
if (i == LEADING_BYTE_ASCII)
@@
-1358,6
+1366,7
@@
ccl_driver (struct ccl_program *ccl,
CCL_WRITE_CHAR (i);
break;
CCL_WRITE_CHAR (i);
break;
+#endif
case CCL_TranslateCharacter:
#if 0
case CCL_TranslateCharacter:
#if 0
@@
-1580,7
+1589,7
@@
ccl_driver (struct ccl_program *ccl,
/* +1 is for including separator. */
point = -point + 1;
if (mapping_stack_pointer
/* +1 is for including separator. */
point = -point + 1;
if (mapping_stack_pointer
- >= &mapping_stack[MAX_MAP_SET_LEVEL])
+ >= mapping_stack + countof (mapping_stack))
CCL_INVALID_CMD;
PUSH_MAPPING_STACK (map_set_rest_length - point,
reg[rrr]);
CCL_INVALID_CMD;
PUSH_MAPPING_STACK (map_set_rest_length - point,
reg[rrr]);
@@
-1661,7
+1670,7
@@
ccl_driver (struct ccl_program *ccl,
else if (SYMBOLP (content))
{
if (mapping_stack_pointer
else if (SYMBOLP (content))
{
if (mapping_stack_pointer
- >= &mapping_stack[MAX_MAP_SET_LEVEL])
+ >= mapping_stack + countof (mapping_stack))
CCL_INVALID_CMD;
PUSH_MAPPING_STACK (map_set_rest_length, reg[rrr]);
PUSH_MAPPING_STACK (map_set_rest_length, op);
CCL_INVALID_CMD;
PUSH_MAPPING_STACK (map_set_rest_length, reg[rrr]);
PUSH_MAPPING_STACK (map_set_rest_length, op);