*rs = 0;
s = xmalloc(sizeof(*s));
- if (s == 0) return ONIGERR_MEMORY;
+ if (IS_NULL(s)) return ONIGERR_MEMORY;
v = (int* )xmalloc(sizeof(int) * init_size);
- if (v == 0) {
+ if (IS_NULL(v)) {
xfree(s);
return ONIGERR_MEMORY;
}
static void
free_int_stack(int_stack* s)
{
- if (s != 0) {
- if (s->v != 0)
+ if (IS_NOT_NULL(s)) {
+ if (IS_NOT_NULL(s->v))
xfree(s->v);
xfree(s);
}
if (s->n >= s->alloc) {
int new_size = s->alloc * 2;
int* nv = (int* )xrealloc(s->v, new_size);
- if (nv == 0) return ONIGERR_MEMORY;
+ if (IS_NULL(nv)) return ONIGERR_MEMORY;
s->alloc = new_size;
s->v = nv;
int len;
int tlen = 0;
- if (NODE_ANCHOR_BODY(node) != 0) {
+ if (IS_NOT_NULL(NODE_ANCHOR_BODY(node))) {
tlen = compile_length_tree(NODE_ANCHOR_BODY(node), reg);
if (tlen < 0) return tlen;
}
len = 0;
do {
len += compile_length_tree(NCAR(x), reg);
- if (NCDR(x) != NULL) {
+ if (IS_NOT_NULL(NCDR(x))) {
len += SIZE_OP_PUSH + SIZE_OP_JUMP;
}
} while (IS_NOT_NULL(x = NCDR(x)));
break;
case NT_ANCHOR:
- if (NODE_BODY(node) != 0)
+ if (IS_NOT_NULL(NODE_BODY(node)))
r = noname_disable_map(&(NODE_BODY(node)), map, counter);
break;
break;
case NT_ANCHOR:
- if (NODE_BODY(node) != 0)
+ if (IS_NOT_NULL(NODE_BODY(node)))
r = renumber_by_map(NODE_BODY(node), map);
break;
break;
case NT_ANCHOR:
- if (NODE_BODY(node) != 0)
+ if (IS_NOT_NULL(NODE_BODY(node)))
r = numbered_ref_check(NODE_BODY(node));
break;
if ((type & anchor_mask) == 0)
return 1;
- if (NODE_BODY(node) != 0)
+ if (IS_NOT_NULL(NODE_BODY(node)))
r = check_type_tree(NODE_BODY(node), type_mask, enclose_mask, anchor_mask);
break;
NODE_BODY(head) = np;
np = node;
- while ((np = NCDR(np)) != NULL_NODE) {
+ while (IS_NOT_NULL(np = NCDR(np))) {
insert_node = onig_node_new_anchor(anc_type);
CHECK_NULL_RETURN_MEMERR(insert_node);
NODE_BODY(insert_node) = NCAR(np);
np = node;
do {
SET_NODE_TYPE(np, NT_LIST); /* alt -> list */
- } while ((np = NCDR(np)) != NULL_NODE);
+ } while (IS_NOT_NULL(np = NCDR(np)));
}
return 0;
}
#define STATE_CHECK_POS(s,snum) \
(((s) - str) * num_comb_exp_check + ((snum) - 1))
#define STATE_CHECK_VAL(v,snum) do {\
- if (state_check_buff != NULL) {\
+ if (IS_NOT_NULL(state_check_buff)) {\
int x = STATE_CHECK_POS(s,snum);\
(v) = state_check_buff[x/8] & (1<<(x%8));\
}\
stk->u.state.pcode = (pat);\
stk->u.state.pstr = (s);\
stk->u.state.pstr_prev = (sprev);\
- stk->u.state.state_check = ((state_check_buff != NULL) ? (snum) : 0);\
+ stk->u.state.state_check = (IS_NOT_NULL(state_check_buff) ? (snum) : 0);\
STACK_INC;\
} while(0)
#define STACK_PUSH_STATE_CHECK(s,snum) do {\
- if (state_check_buff != NULL) {\
+ if (IS_NOT_NULL(state_check_buff)) { \
STACK_ENSURE(1);\
stk->type = STK_STATE_CHECK_MARK;\
stk->u.state.pstr = (s);\
if (k->type == STK_MEM_START) {
if (mem_is_in_memp(k->u.mem.num, mem_num, memp)) {
pstart = k->u.mem.pstr;
- if (pend != NULL_UCHARP) {
+ if (IS_NOT_NULL(pend)) {
if (pend - pstart > send - *s) return 0; /* or goto next_mem; */
p = pstart;
ss = *s;