]> granicus.if.org Git - onig/commitdiff
use ONIG_NO_NAME_ID
authorK.Kosako <kosako@sofnec.co.jp>
Fri, 9 Feb 2018 05:54:53 +0000 (14:54 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Fri, 9 Feb 2018 05:54:53 +0000 (14:54 +0900)
sample/callout.c
src/regexec.c

index 3aabd50f1a88221a9dfcbac7c76162ec9cd45b4b..7defaba2af5ee907116f9541c0ac39dc53ebe891 100644 (file)
@@ -25,7 +25,7 @@ callout_body(OnigCalloutArgs* args, void* user_data)
   else
     content = 0;
 
-  if (args->name_id > 0) {
+  if (args->name_id != ONIG_NO_NAME_ID) {
     UChar* name = onig_get_callout_name_from_id(args->name_id);
     fprintf(stdout, "name: %s\n", name);
   }
index f0502bc89549d8e828affb6e93dd4aa8caab9db1..5b29b0a50579b44d0105c06e1f3d5e5a609a827d 100644 (file)
@@ -1444,7 +1444,7 @@ stack_double(int is_alloca, char** arg_alloc_base,
 #define STACK_PUSH_CALLOUT_CODE(anum, xcontent, xcontent_end) do {\
   STACK_ENSURE(1);\
   stk->type = STK_CALLOUT;\
-  stk->zid  = -1;\
+  stk->zid  = ONIG_NO_NAME_ID;\
   stk->u.callout.num         = (anum);\
   stk->u.callout.content     = (xcontent);\
   stk->u.callout.content_end = (xcontent_end);\
@@ -3607,7 +3607,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
     case OP_CALLOUT_CODE: SOP_IN(OP_CALLOUT_CODE);
       {
         of = ONIG_CALLOUT_OF_CODE;
-        name_id = -1;
+        name_id = ONIG_NO_NAME_ID;
         func = msa->mp->callout_of_code;
         goto callout_common_entry;
       }