From d4be446cfae3556500c19c92bf6f5052467421ca Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Thu, 8 Feb 2018 17:57:03 +0900 Subject: [PATCH] remove enum CalloutOf --- src/regcomp.c | 12 ++++++------ src/regparse.c | 6 +++--- src/regparse.h | 4 ---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/regcomp.c b/src/regcomp.c index df286a4..ade0f8d 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -1536,8 +1536,8 @@ compile_gimmick_node(GimmickNode* node, regex_t* reg) case GIMMICK_CALLOUT: switch (node->detail_type) { - case CALLOUT_OF_CODE: - case CALLOUT_OF_NAME: + case ONIG_CALLOUT_OF_CODE: + case ONIG_CALLOUT_OF_NAME: { RegexExt* ext; UChar* pattern; @@ -1548,10 +1548,10 @@ compile_gimmick_node(GimmickNode* node, regex_t* reg) if (IS_NULL(pattern)) return ONIGERR_PARSER_BUG; - r = add_opcode(reg, (node->detail_type == CALLOUT_OF_CODE) ? + r = add_opcode(reg, (node->detail_type == ONIG_CALLOUT_OF_CODE) ? OP_CALLOUT_CODE : OP_CALLOUT_NAME); if (r != 0) return r; - if (node->detail_type == CALLOUT_OF_NAME) { + if (node->detail_type == ONIG_CALLOUT_OF_NAME) { r = add_mem_num(reg, node->id); if (r != 0) return r; } @@ -1596,10 +1596,10 @@ compile_length_gimmick_node(GimmickNode* node, regex_t* reg) case GIMMICK_CALLOUT: switch (node->detail_type) { - case CALLOUT_OF_CODE: + case ONIG_CALLOUT_OF_CODE: len = SIZE_OP_CALLOUT_CODE; break; - case CALLOUT_OF_NAME: + case ONIG_CALLOUT_OF_NAME: len = SIZE_OP_CALLOUT_NAME; break; diff --git a/src/regparse.c b/src/regparse.c index 267bf18..1763d81 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -2125,7 +2125,7 @@ node_new_keep(Node** node, ScanEnv* env) } static int -node_new_callout(Node** node, enum CalloutOf callout_of, int id, int dirs, +node_new_callout(Node** node, enum OnigCalloutOf callout_of, int id, int dirs, ScanEnv* env) { int r; @@ -6097,7 +6097,7 @@ parse_callout_of_code(Node** np, int cterm, UChar** src, UChar* end, ScanEnv* en if (c != cterm) return ONIGERR_INVALID_CALLOUT_PATTERN; - r = node_new_callout(np, CALLOUT_OF_CODE, -1, dirs, env); + r = node_new_callout(np, ONIG_CALLOUT_OF_CODE, -1, dirs, env); if (r != 0) return r; GIMMICK_(*np)->start = code_start - env->pattern; @@ -6169,7 +6169,7 @@ parse_callout_of_name(Node** np, int cterm, UChar** src, UChar* end, ScanEnv* en r = onig_get_callout_id_from_name(enc, name_start, name_end, &id); if (r != ONIG_NORMAL) return r; - r = node_new_callout(np, CALLOUT_OF_NAME, id, dirs, env); + r = node_new_callout(np, ONIG_CALLOUT_OF_NAME, id, dirs, env); if (r != ONIG_NORMAL) return r; GIMMICK_(*np)->start = code_start - env->pattern; diff --git a/src/regparse.h b/src/regparse.h index ce0c2d5..d09a7b0 100644 --- a/src/regparse.h +++ b/src/regparse.h @@ -54,10 +54,6 @@ enum GimmickType { GIMMICK_CALLOUT = 4, }; -enum CalloutOf { - CALLOUT_OF_CODE = 0, - CALLOUT_OF_NAME = 1, -}; /* node type bit */ #define NODE_TYPE2BIT(type) (1<<(type)) -- 2.40.0