pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4535:    *    * zero    *    * void    *    * Note that non-destructive operations are assumed.    * ie it's assumed that calling a function(mapping(string|int:string|int):void)    * with a mapping(int:int) won't change the type of the mapping after the    * operation.    */ - #ifdef PIKE_TYPE_DEBUG +    static int low_pike_types_le2(struct pike_type *a, struct pike_type *b,    int array_cnt, unsigned int flags); - #endif /* PIKE_TYPE_DEBUG */ +    static int low_pike_types_le(struct pike_type *a, struct pike_type *b,    int array_cnt, unsigned int flags) - #ifdef PIKE_TYPE_DEBUG +    {    int res; -  +  DECLARE_CYCLIC();    -  + #ifdef PIKE_TYPE_DEBUG    if (l_flag>2) {   #if 0    struct compilation *c = MAYBE_THIS_COMPILATION;    if (c && c->lex.current_file)    fprintf (stderr, "%*s%s:%d:\n", indent * 2, "",    c->lex.current_file->str, c->lex.current_line);   #endif    fprintf(stderr, "%*slow_pike_types_le(", indent*2, "");    simple_describe_type(a);    fprintf(stderr, ",\n%*s", indent*2 + 18, "");    simple_describe_type(b);    fprintf(stderr, ",\n%*s%d, 0x%08x);\n",    indent*2 + 18, "", array_cnt, flags);    indent++;    } -  + #endif /* PIKE_TYPE_DEBUG */    -  +  if (!(res = (int)(ptrdiff_t)BEGIN_CYCLIC(a, b))) { +  SET_CYCLIC_RET(1); +     res = low_pike_types_le2(a, b, array_cnt, flags); -  +  } +  END_CYCLIC();    -  + #ifdef PIKE_TYPE_DEBUG    if (l_flag>2) {    indent--;       fprintf(stderr, "%*s= %d\n", indent*2, "", res);    } -  + #endif /* PIKE_TYPE_DEBUG */    return res;   }      static int low_pike_types_le2(struct pike_type *a, struct pike_type *b,    int array_cnt, unsigned int flags) - #endif /* PIKE_TYPE_DEBUG */ +    {    struct compilation *c = MAYBE_THIS_COMPILATION;    int ret;       recurse:   #if 0    fprintf(stderr, "low_pike_types_le(%d, %d, %d, 0x%08x)\n",    a->type, b->type, array_cnt, flags);   #endif /* 0 */   
pike.git/src/pike_types.cmod:4763:    if (!t) t = zero_type_string;    }    t = apply_type_operator(b->type, t, b->cdr);    ret = low_pike_types_le(a, t, array_cnt, flags);    free_type(t);    return ret;    }       case PIKE_T_TRANSITIVE:    { -  /* FIXME */ -  return 1; +  struct pike_type *t = +  expand_transitive(b, ((flags & LE_A_B_SWAPPED)?a_markers:b_markers), 0); +  ret = low_pike_types_le(a, t, array_cnt, flags); +  free_type(t); +  return ret;    }    }      #ifdef TYPE_GROUPING    if (a->type != T_OR) {    flags &= ~LE_A_GROUPED;    }   #endif       switch(a->type & 0xff)
pike.git/src/pike_types.cmod:4995:    if (!t) t = zero_type_string;    }    t = apply_type_operator(a->type, t, a->cdr);    ret = low_pike_types_le(t, b, array_cnt, flags);    free_type(t);    return ret;    }       case PIKE_T_TRANSITIVE:    { -  /* FIXME */ -  return 1; +  struct pike_type *t = +  expand_transitive(a, ((flags & LE_A_B_SWAPPED)?b_markers:a_markers), 0); +  ret = low_pike_types_le(t, b, array_cnt, flags); +  free_type(t); +  return ret;    }    }       if ((array_cnt < 0) && (b->type == T_ARRAY)) {    while (b->type == T_ARRAY) {    b = b->cdr;    if (!++array_cnt) break;    }    goto recurse;    } else if ((array_cnt > 0) && (a->type == T_ARRAY)) {