pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:3779:    add_ref(function_type_string);    return function_type_string;   #endif   }            /******/      struct remap_state { -  unsigned char map[0x20]; +  unsigned char map[0x40];    unsigned INT32 allocated;    struct mapping *markers[2];   };      #ifdef PIKE_NULL_IS_SPECIAL   #define INIT_REMAP_STATE(REMAP) do { \    memset(&REMAP, 0, sizeof(struct remap_state)); \    REMAP.markers[0] = NULL; \    REMAP.markers[1] = NULL; \    } while(0)
pike.git/src/pike_types.cmod:3833:    }    if (remap->markers[0]) {    fprintf(stderr, "markers[0]:\n");    simple_describe_mapping(remap->markers[0]);    }    if (remap->markers[1]) {    fprintf(stderr, "markers[1]:\n");    simple_describe_mapping(remap->markers[1]);    }   } + #else + #define simple_describe_remap_state(X) do { (X); } while(0)   #endif      static int alloc_remap_marker(struct remap_state *remap, int marker,    enum pt_remap_flags flags)   {    int ret;       marker = marker & 0x0f;       if (!remap || (flags & PT_FLAG_REMAP_INHIBIT)) return '0' | marker;       if (flags & PT_FLAG_REMAP_SWAP_MARKERS) marker |= 0x10; -  +  if (flags & PT_FLAG_REMAP_ALTERNATE) marker |= 0x20;       if ((ret = remap->map[marker])) return ret;       for (ret = 0; ret < 10; ret++) {    if (!(remap->allocated & (1 << ret))) {    remap->allocated |= (1 << ret);    ret |= '0';    remap->map[marker] = ret;    return ret;    }
pike.git/src/pike_types.cmod:3870:   static int remap_marker(struct remap_state *remap, int marker,    enum pt_remap_flags flags)   {    int ret;       marker = marker & 0x0f;       if (!remap || (flags & PT_FLAG_REMAP_INHIBIT)) return '0' | marker;       if (flags & PT_FLAG_REMAP_SWAP_MARKERS) marker |= 0x10; +  if (flags & PT_FLAG_REMAP_ALTERNATE) marker |= 0x20;       if ((ret = remap->map[marker])) return ret;       for (ret = 0; ret < 10; ret++) {    if (!(remap->allocated & (1 << ret))) {    remap->allocated |= (1 << ret);    ret |= '0';    remap->map[marker] = ret;    return ret;    }
pike.git/src/pike_types.cmod:3895:   static void free_marker(struct remap_state *remap, int marker,    enum pt_remap_flags flags)   {    int m;       if (!remap || (flags & PT_FLAG_REMAP_INHIBIT)) return;       marker &= 0x0f;       if (flags & PT_FLAG_REMAP_SWAP_MARKERS) marker |= 0x10; +  if (flags & PT_FLAG_REMAP_ALTERNATE) marker |= 0x20;       if (!(m = remap->map[marker])) return;       remap->map[marker] = 0;    remap->allocated &= ~(1 << (m & 0x0f));   }      static int lookup_marker(struct remap_state *remap, int marker,    enum pt_remap_flags flags,    struct pike_type **result_type)
pike.git/src/pike_types.cmod:4338:   {    struct pike_type *tmp;    TYPE_STACK_DEBUG("expand_transitive_remap");    switch(cont?(cont->type & PIKE_T_MASK):PIKE_T_UNKNOWN) {    case PIKE_T_UNKNOWN:    if (!trans) {    push_type(PIKE_T_UNKNOWN);    } else {    /* A car of __unknown__ is short-hand for having it identical    * to the cdr. +  * +  * NB: Use ALTERNATE set of markers to de-couple the markers +  * of trans from those of the rest of the function.    */ -  push_expand_transitive_remap(trans, trans, remap, flags, num_args); +  push_expand_transitive_remap(trans, trans, remap, +  flags|PT_FLAG_REMAP_ALTERNATE, num_args);    }    break;    case T_OR: case T_AND:    push_expand_transitive_remap(cont->cdr, trans, remap, flags, num_args);    push_expand_transitive_remap(cont->car, trans, remap, flags, num_args);    push_type(cont->type);    break;    case PIKE_T_FUNCTION:    /*    * transitive(function(a, b, ...:c), X)