pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: pike_types.c,v 1.202 2002/11/28 19:11:43 mast Exp $ + || $Id: pike_types.c,v 1.203 2003/01/07 20:11:56 grubba Exp $   */      #include "global.h" - RCSID("$Id: pike_types.c,v 1.202 2002/11/28 19:11:43 mast Exp $"); + RCSID("$Id: pike_types.c,v 1.203 2003/01/07 20:11:56 grubba Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"   #include "constants.h"   #include "object.h"   #include "multiset.h"
pike.git/src/pike_types.c:308:   #define PT_COPY_BOTH 3   #define PT_SET_MARKER 4      static inline struct pike_type *debug_mk_type(unsigned INT32 type,    struct pike_type *car,    struct pike_type *cdr,    int flag_method)   {    unsigned INT32 hash = DO_NOT_WARN((unsigned INT32)    ((ptrdiff_t)type*0x10204081)^ -  (0x8003*(ptrdiff_t)car)^ -  ~(0x10001*(ptrdiff_t)cdr)); +  (0x8003*(((char *)car)-(char *)0))^ +  ~(0x10001*(((char *)cdr)-(char *)0)));    unsigned INT32 index = hash % pike_type_hash_size;    struct pike_type *t;       for(t = pike_type_hash[index]; t; t = t->next) {    if ((t->hash == hash) && (t->type == type) &&    (t->car == car) && (t->cdr == cdr)) {    /* Free car & cdr as appropriate. */    switch(type) {    case T_FUNCTION:    case T_MANY:
pike.git/src/pike_types.c:781:    goto recurse;    } else {    push_type(T_ZERO);    }    TYPE_STACK_DEBUG("push_finished_type_with_markers");    return;    }    if (type->type == T_ASSIGN) {    /* Strip assign */   #if 0 -  fprintf(stderr, "Assign to marker %d.\n", ((ptrdiff_t)type->car)); +  fprintf(stderr, "Assign to marker %d.\n", +  ((char *)type->car)-(char *)0);   #endif /* 0 */    type = type->cdr;    goto recurse;    }    if (type->type == PIKE_T_NAME) {    /* Strip the name, since it won't be correct anymore. */    type = type->cdr;    goto recurse;    }    /* FIXME: T_SCOPE */
pike.git/src/pike_types.c:1293: Inside #if defined(PIKE_DEBUG)
   fprintf(stderr, "%d", s->type-'0');    break;       case PIKE_T_NAME:    fprintf(stderr, "{ %s = ", ((struct pike_string *)s->car)->str);    simple_describe_type(s->cdr);    fprintf(stderr, " }");    break;       case T_SCOPE: -  fprintf(stderr, "scope(%ld, ", (long)(ptrdiff_t)s->car); +  fprintf(stderr, "scope(%ld, ", +  (long)(((char *)s->car)-(char *)0));    simple_describe_type(s->cdr);    fprintf(stderr, ")");    break;    case T_TUPLE:    fprintf(stderr, "tuple(");    simple_describe_type(s->car);    fprintf(stderr, ", ");    simple_describe_type(s->cdr);    fprintf(stderr, ")");    break;    case T_ASSIGN: -  fprintf(stderr, "%ld = ", (long)(ptrdiff_t)s->car); +  fprintf(stderr, "%ld = ", +  (long)(((char *)s->car)-(char *)0));    simple_describe_type(s->cdr);    break;    case T_INT:    { -  INT32 min = (ptrdiff_t)s->car; -  INT32 max = (ptrdiff_t)s->cdr; +  INT32 min = ((char *)s->car)-(char *)0; +  INT32 max = ((char *)s->cdr)-(char *)0;    fprintf(stderr, "int");    if(min!=MIN_INT32 || max!=MAX_INT32)    fprintf(stderr, "(%ld..%ld)",(long)min,(long)max);    break;    }    case T_FLOAT: fprintf(stderr, "float"); break;    case T_STRING: fprintf(stderr, "string"); break;    case T_TYPE:    fprintf(stderr, "type(");    simple_describe_type(s->car);    fprintf(stderr, ")");    break;    case T_PROGRAM:    fprintf(stderr, "program(");    simple_describe_type(s->car);    fprintf(stderr, ")");    break;    case T_OBJECT:    fprintf(stderr, "object(%s %ld)",    s->car?"is":"implements", -  (long)(ptrdiff_t)s->cdr); +  (long)(((char *)s->cdr)-(char *)0));    break;    case T_FUNCTION:    case T_MANY:    fprintf(stderr, "function(");    while(s->type == T_FUNCTION) {    simple_describe_type(s->car);    s = s->cdr;    if ((s->type == T_FUNCTION) ||    (s->car->type != T_VOID)) {    fprintf(stderr, ", ");
pike.git/src/pike_types.c:1443:    /**** FIXME: ****/    switch(t->type)    {    case '0': case '1': case '2': case '3': case '4':    case '5': case '6': case '7': case '8': case '9':    my_putchar(t->type);    break;       case T_ASSIGN:    my_putchar('('); -  my_putchar('0' + (ptrdiff_t)t->car); +  my_putchar('0' + (((char *)t->car)-(char *)0));    my_putchar('=');    my_describe_type(t->cdr);    my_putchar(')');    break;       case T_SCOPE:    my_putchar('{'); -  my_putchar((ptrdiff_t)t->car); +  my_putchar(((char *)t->car)-(char *)0);    my_putchar(',');    my_describe_type(t->cdr);    my_putchar('}');    break;       case T_TUPLE:    my_putchar('[');    my_describe_type(t->car);    my_putchar(',');    my_describe_type(t->cdr);    my_putchar(']');    break;       case T_VOID: my_strcat("void"); break;    case T_ZERO: my_strcat("zero"); break;    case T_MIXED: my_strcat("mixed"); break;    case PIKE_T_UNKNOWN: my_strcat("unknown"); break;    case T_INT:    { -  INT32 min=(ptrdiff_t)t->car; -  INT32 max=(ptrdiff_t)t->cdr; +  INT32 min=((char *)t->car)-(char *)0; +  INT32 max=((char *)t->cdr)-(char *)0;    my_strcat("int");       if(min!=MIN_INT32 || max!=MAX_INT32)    {    char buffer[100];    sprintf(buffer,"(%ld..%ld)",(long)min,(long)max);    my_strcat(buffer);    }    break;    }
pike.git/src/pike_types.c:1500:    my_describe_type(t->car);    my_strcat(")");    }    break;    case T_OBJECT:    if (t->cdr)    {    char buffer[100];    sprintf(buffer,"object(%s %ld)",    t->car?"is":"implements", -  (long)(ptrdiff_t)t->cdr); +  (long)(((char *)t->cdr)-(char *)0));    my_strcat(buffer);    }else{    my_strcat("object");    }    break;       case T_STRING: my_strcat("string"); break;    case T_TYPE:    my_strcat("type(");    my_describe_type(t->car);
pike.git/src/pike_types.c:1793:    else if (t1->type == T_ZERO && zero_implied)    {    push_finished_type(t2);    }    else if(t1->type == T_MIXED || t2->type == T_MIXED)    {    push_type(T_MIXED);    }    else if(t1->type == T_INT && t2->type == T_INT)    { -  INT32 min, max; +  INT32 min1 = ((char *)t1->car)-(char *)0; +  INT32 max1 = ((char *)t1->cdr)-(char *)0; +  INT32 min2 = ((char *)t2->car)-(char *)0; +  INT32 max2 = ((char *)t2->cdr)-(char *)0;    -  if ((((ptrdiff_t)t1->cdr) + 1 < (ptrdiff_t)t2->car) || -  (((ptrdiff_t)t2->cdr) + 1 < (ptrdiff_t)t1->car)) { +  if ((max1 + 1 < min2) || (max2 + 1 < min1)) {    /* No overlap. */    push_finished_type(t1);    push_finished_type(t2);    push_type(T_OR);    } else {    /* Overlap */ -  min = MINIMUM((ptrdiff_t)t1->car, (ptrdiff_t)t2->car); -  max = MAXIMUM((ptrdiff_t)t1->cdr, (ptrdiff_t)t2->cdr); +  min1 = MINIMUM(min1, min2); +  max1 = MAXIMUM(max1, max2);    -  push_int_type(min, max); +  push_int_type(min1, max1);    }    }    else if (t1->type == T_SCOPE)    {    if (t2->type == T_SCOPE) {    low_or_pike_types(t1->cdr, t2->cdr, zero_implied);    if (t1->car > t2->car) -  push_scope_type((ptrdiff_t)t1->car); +  push_scope_type(((char *)t1->car)-(char *)0);    else -  push_scope_type((ptrdiff_t)t2->car); +  push_scope_type(((char *)t2->car)-(char *)0);    } else {    low_or_pike_types(t1->cdr, t2, zero_implied); -  push_scope_type((ptrdiff_t)t1->car); +  push_scope_type(((char *)t1->car)-(char *)0);    }    }    else if (t2->type == T_SCOPE)    {    low_or_pike_types(t1, t2->cdr, zero_implied); -  push_scope_type((ptrdiff_t)t2->car); +  push_scope_type(((char *)t2->car)-(char *)0);    push_type(T_SCOPE);    }    else    {    push_finished_type(t1);    very_low_or_pike_types(t2,t1);    }   }      struct pike_type *or_pike_types(struct pike_type *a,
pike.git/src/pike_types.c:1871:   {    while(t2->type == T_OR)    {    even_lower_and_pike_types(t1, t2->car);    t2 = t2->cdr;    }    if (t1->type == t2->type) {    if (t1->type == T_INT) {    INT32 i1, i2;    INT32 upper_bound, lower_bound; -  i1 = (ptrdiff_t)t1->cdr; -  i2 = (ptrdiff_t)t2->cdr; +  i1 = ((char *)t1->cdr)-(char *)0; +  i2 = ((char *)t2->cdr)-(char *)0;    upper_bound = MINIMUM(i1,i2);    -  i1 = (ptrdiff_t)t1->car; -  i2 = (ptrdiff_t)t2->car; +  i1 = ((char *)t1->car)-(char *)0; +  i2 = ((char *)t2->car)-(char *)0;    lower_bound = MAXIMUM(i1,i2);       if (upper_bound >= lower_bound) {    push_int_type(lower_bound, upper_bound);    push_type(T_OR);    }    } else {    push_finished_type(t1);    push_type(T_OR);    }
pike.git/src/pike_types.c:1972:    push_finished_type(t2);    }    else if(t2->type == T_MIXED)    {    push_finished_type(t1);    }    else if(t1->type == T_INT && t2->type == T_INT)    {    INT32 i1,i2;    INT32 upper_bound, lower_bound; -  i1 = (ptrdiff_t)t1->cdr; -  i2 = (ptrdiff_t)t2->cdr; +  i1 = ((char *)t1->cdr)-(char *)0; +  i2 = ((char *)t2->cdr)-(char *)0;    upper_bound = MINIMUM(i1,i2);    -  i1 = (ptrdiff_t)t1->car; -  i2 = (ptrdiff_t)t2->car; +  i1 = ((char *)t1->car)-(char *)0; +  i2 = ((char *)t2->car)-(char *)0;    lower_bound = MAXIMUM(i1,i2);       if (upper_bound >= lower_bound) {    push_int_type(lower_bound, upper_bound);    } else {    /* No overlap! */    /* FIXME: Warn? */    push_type(T_VOID);    }    }    else if (t1->type == T_SCOPE)    {    if (t2->type == T_SCOPE) {    low_and_pike_types(t1->cdr, t2->cdr);    if (t1->car > t2->car) -  push_scope_type((ptrdiff_t)t1->car); +  push_scope_type(((char *)t1->car)-(char *)0);    else -  push_scope_type((ptrdiff_t)t2->car); +  push_scope_type(((char *)t2->car)-(char *)0);    } else {    low_and_pike_types(t1->cdr, t2); -  push_scope_type((ptrdiff_t)t1->car); +  push_scope_type(((char *)t1->car)-(char *)0);    }    }    else if (t2->type == T_SCOPE)    {    low_and_pike_types(t1, t2->cdr); -  push_scope_type((ptrdiff_t)t2->car); +  push_scope_type(((char *)t2->car)-(char *)0);    }    else if((t1->type == t2->type) &&    ((t1->type == T_STRING) ||    (t1->type == T_FLOAT)))    {    push_finished_type(t1);    }    else if(low_pike_types_le(t1, t2, 0, 0))    {    push_finished_type(t1);
pike.git/src/pike_types.c:2050:   {    type_stack_mark();    low_and_pike_types(a, b);    return pop_unfinished_type();   }      static struct pike_type *low_object_lfun_type(struct pike_type *t, short lfun)   {    struct program *p;    int i; -  p = id_to_program((ptrdiff_t)t->cdr); +  p = id_to_program(((char *)t->cdr)-(char *)0);    if(!p) return 0;    i=FIND_LFUN(p, lfun);    if(i==-1) return 0;    return ID_FROM_INT(p, i)->type;   }            /******/   
pike.git/src/pike_types.c:2186:       case T_NOT:    if(low_match_types(a->car, b, (flags ^ B_EXACT ) | NO_MAX_ARGS))    return 0;    return a;       case T_ASSIGN:    ret = low_match_types(a->cdr, b, flags);    if(ret && (b->type != T_VOID))    { -  int m = (ptrdiff_t)a->car; +  int m = ((char *)a->car)-(char *)0;    struct pike_type *tmp;      #ifdef PIKE_DEBUG    if ((m < 0) || (m > 9)) {    Pike_fatal("marker out of range: %d\n", m);    }   #endif /* PIKE_DEBUG */       type_stack_mark();    push_finished_type_with_markers(b, b_markers);
pike.git/src/pike_types.c:2221: Inside #if defined(PIKE_TYPE_DEBUG)
   my_strcat("a_markers[");    my_putchar((char)(m+'0'));    my_strcat("]=");    my_describe_type(a_markers[m]);    my_strcat("\n");    fprintf(stderr,"%s",(s=simple_free_buf()));    free(s);    }   #endif   #ifdef PIKE_DEBUG -  if((ptrdiff_t)a_markers[m]->type == m+'0') +  if((((char *)a_markers[m]->type)-(char *)0) == m+'0')    Pike_fatal("Cyclic type!\n");   #endif    }    return ret;       case '0': case '1': case '2': case '3': case '4':    case '5': case '6': case '7': case '8': case '9':    {    int m = a->type - '0';    if(a_markers[m])
pike.git/src/pike_types.c:2280:       case T_NOT:    if(low_match_types(a, b->car, (flags ^ A_EXACT ) | NO_MAX_ARGS))    return 0;    return a;       case T_ASSIGN:    ret = low_match_types(a, b->cdr, flags);    if(ret && (a->type != T_VOID))    { -  int m = (ptrdiff_t)b->car; +  int m = ((char *)b->car)-(char *)0;    struct pike_type *tmp;    type_stack_mark();    push_finished_type_with_markers(a, a_markers);    tmp=pop_unfinished_type();       type_stack_mark();    low_or_pike_types(b_markers[m], tmp, 0);    if(b_markers[m]) free_type(b_markers[m]);    free_type(tmp);    b_markers[m] = pop_unfinished_type();
pike.git/src/pike_types.c:2307: Inside #if defined(PIKE_TYPE_DEBUG)
   my_strcat("b_markers[");    my_putchar((char)(m+'0'));    my_strcat("]=");    my_describe_type(b_markers[m]);    my_strcat("\n");    fprintf(stderr,"%s",(s=simple_free_buf()));    free(s);    }   #endif   #ifdef PIKE_DEBUG -  if((ptrdiff_t)b_markers[m]->type == m+'0') +  if((((char *)b_markers[m]->type)-(char *)0) == m+'0')    Pike_fatal("Cyclic type!\n");   #endif    }    return ret;       case '0': case '1': case '2': case '3': case '4':    case '5': case '6': case '7': case '8': case '9':    {    int m = b->type - '0';    if(b_markers[m])
pike.git/src/pike_types.c:2423:    if((s=low_object_lfun_type(b, LFUN_CALL)))    return low_match_types(a, s, flags);    if (flags & A_EXACT) {    /* A function isn't an object */    return 0;    }    return a;    }    case TWOT(T_INT, T_ZERO):    { -  if ((((ptrdiff_t)a->car) > 0) || -  (((ptrdiff_t)a->cdr) < 0)) { +  if (((((char *)a->car)-(char *)0) > 0) || +  ((((char *)a->cdr)-(char *)0) < 0)) {    return 0;    }    return a;    }    case TWOT(T_ZERO, T_INT):    { -  if ((((ptrdiff_t)b->car) > 0) || -  (((ptrdiff_t)b->cdr) < 0)) { +  if (((((char *)b->car)-(char *)0) > 0) || +  ((((char *)b->cdr)-(char *)0) < 0)) {    return 0;    }    return a;    }    case TWOT(T_FUNCTION, T_FUNCTION):    case TWOT(T_FUNCTION, T_MANY):    case TWOT(T_MANY, T_FUNCTION):    case TWOT(T_MANY, T_MANY):    ret = a;    correct_args=0;
pike.git/src/pike_types.c:2533:    /* object(1 x) =? object(1 x) */    if(a->cdr != b->cdr) return 0;    }else{    /* object(0 *) =? object(0 *) */   #if 0    /* This is known to cause trouble in some cases when comparing    * the same function prototype in the first and second passes    * (got "Prototype doesn't match for function foo" even though    * there was no other prototype for that function). /mast */    struct program *ap,*bp; -  ap = id_to_program((ptrdiff_t)a->cdr); -  bp = id_to_program((ptrdiff_t)b->cdr); +  ap = id_to_program(((char *)a->cdr)-(char *)0); +  bp = id_to_program(((char *)b->cdr)-(char *)0);    if (!is_compatible(ap, bp)) return 0;   #endif    break;    }    }       {    struct program *ap,*bp; -  ap = id_to_program((ptrdiff_t)a->cdr); -  bp = id_to_program((ptrdiff_t)b->cdr); +  ap = id_to_program(((char *)a->cdr)-(char *)0); +  bp = id_to_program(((char *)b->cdr)-(char *)0);       if(!ap || !bp) break;      #if 0    /* FIXME: Temporary kludge.    * match_types() currently seems to need to be symetric.    */    if (!implements(ap,bp) && !implements(bp,ap))    return 0;   #else /* !1 */
pike.git/src/pike_types.c:2570:    if(!is_compatible(implements_a=bp,implements_b=ap))    return 0;    }   #endif /* 1 */    }       break;       case T_INT:    { -  INT32 amin = (ptrdiff_t)a->car; -  INT32 amax = (ptrdiff_t)a->cdr; +  INT32 amin = ((char *)a->car)-(char *)0; +  INT32 amax = ((char *)a->cdr)-(char *)0;    -  INT32 bmin = (ptrdiff_t)b->car; -  INT32 bmax = (ptrdiff_t)b->cdr; +  INT32 bmin = ((char *)b->car)-(char *)0; +  INT32 bmax = ((char *)b->cdr)-(char *)0;       if(amin > bmax || bmin > amax) return 0;    break;    }          case T_PROGRAM:    case T_TYPE:    case T_MULTISET:    case T_ARRAY:
pike.git/src/pike_types.c:2737:    if (low_pike_types_le(a->car, b, array_cnt, flags)) {    return 0;    }    /* FIXME: This is wrong... */    return !low_pike_types_le(b, a->car, -array_cnt, flags);       case T_ASSIGN:    ret = low_pike_types_le(a->cdr, b, array_cnt, flags);    if(ret && (b->type != T_VOID))    { -  int m = (ptrdiff_t)a->car; +  int m = ((char *)a->car)-(char *)0;    struct pike_type *tmp;    int i;    type_stack_mark();    push_finished_type_with_markers(b, b_markers);    for(i=array_cnt; i > 0; i--)    push_type(T_ARRAY);    tmp=pop_unfinished_type();       type_stack_mark();    low_or_pike_types(a_markers[m], tmp, 0);
pike.git/src/pike_types.c:2821:    if (low_pike_types_le(a, b->car, array_cnt, flags)) {    return 0;    }    /* FIXME: This is wrong... */    return !low_pike_types_le(b->car, a, -array_cnt, flags);       case T_ASSIGN:    ret = low_pike_types_le(a, b->cdr, array_cnt, flags);    if(ret && (a->type != T_VOID))    { -  int m = (ptrdiff_t)b->car; +  int m = ((char *)b->car)-(char *)0;    struct pike_type *tmp;    int i;    type_stack_mark();    push_finished_type_with_markers(a, a_markers);    for(i = array_cnt; i < 0; i++)    push_type(T_ARRAY);    tmp=pop_unfinished_type();       type_stack_mark();    low_or_pike_types(b_markers[m], tmp, 0);
pike.git/src/pike_types.c:3090:       if ((a->car || !b->car) &&    (a->cdr == b->cdr))    return 1;       if (b->car) {    return 0;    }       { -  struct program *ap = id_to_program((ptrdiff_t)a->cdr); -  struct program *bp = id_to_program((ptrdiff_t)b->cdr); +  struct program *ap = id_to_program(((char *)a->cdr)-(char *)0); +  struct program *bp = id_to_program(((char *)b->cdr)-(char *)0);       if (!ap || !bp) {    /* Shouldn't happen... */    return 0;    }    if ((flags & LE_WEAK_OBJECTS) && (!a->car)) {    return is_compatible(implements_a=ap, implements_b=bp);    }    return implements(implements_a=ap, implements_b=bp);    }    break;       case T_INT:    { -  INT32 amin = (ptrdiff_t)a->car; -  INT32 amax = (ptrdiff_t)a->cdr; +  INT32 amin = ((char *)a->car)-(char *)0; +  INT32 amax = ((char *)a->cdr)-(char *)0;    -  INT32 bmin = (ptrdiff_t)b->car; -  INT32 bmax = (ptrdiff_t)b->cdr; +  INT32 bmin = ((char *)b->car)-(char *)0; +  INT32 bmax = ((char *)b->cdr)-(char *)0;       if(amin < bmin || amax > bmax) return 0;    break;    }          case T_TYPE:    case T_PROGRAM:    case T_MULTISET:    case T_ARRAY:
pike.git/src/pike_types.c:3310:    t = t->cdr;    }    while(index_type->type == PIKE_T_NAME) {    index_type = index_type->cdr;    }       switch(t->type)    {    case T_OBJECT:    { -  p = id_to_program((ptrdiff_t)t->cdr); +  p = id_to_program(((char *)t->cdr)-(char *)0);       comefrom_int_index:    if(p && n)    {    INT32 i;    if(n->token == F_ARROW)    {    /* FIXME: make this stricter */    if((i=FIND_LFUN(p,LFUN_ARROW))!=-1)    {
pike.git/src/pike_types.c:3501:    index1_type = index1_type->cdr;    }    while(index2_type->type == PIKE_T_NAME) {    index2_type = index2_type->cdr;    }       switch(t->type)    {    case T_OBJECT:    { -  p = id_to_program((ptrdiff_t)t->cdr); +  p = id_to_program(((char *)t->cdr)-(char *)0);       if(p)    {    INT32 i;    if((i = FIND_LFUN(p, LFUN_INDEX)) != -1)    {    struct pike_type *call_type = NULL;    /* FIXME: function_type_string should be replaced with something    * derived from type_string    */
pike.git/src/pike_types.c:3683:   #define low_key_type debug_low_key_type   #endif      /* FIXME, add the index */   static struct pike_type *debug_low_key_type(struct pike_type *t, node *n)   {    switch(t->type)    {    case T_OBJECT:    { -  struct program *p = id_to_program((ptrdiff_t)t->cdr); +  struct program *p = id_to_program(((char *)t->cdr)-(char *)0);    if(p && n)    {    if(n->token == F_ARROW)    {    if(FIND_LFUN(p,LFUN_ARROW)!=-1 || FIND_LFUN(p,LFUN_ASSIGN_ARROW)!=-1)    {    add_ref(mixed_type_string);    return mixed_type_string;    }    }else{
pike.git/src/pike_types.c:3792:    case T_ARRAY:    if(low_match_types(string_type_string, index_type, 0) &&    low_check_indexing(type->car, index_type, n))    return 1;       case T_STRING:    return !!low_match_types(int_type_string, index_type, 0);       case T_OBJECT:    { -  struct program *p = id_to_program((ptrdiff_t)type->cdr); +  struct program *p = id_to_program(((char *)type->cdr)-(char *)0);    if(p)    {    if(n->token == F_ARROW)    {    if(FIND_LFUN(p,LFUN_ARROW)!=-1 || FIND_LFUN(p,LFUN_ASSIGN_ARROW)!=-1)    return 1;    }else{    if(FIND_LFUN(p,LFUN_INDEX)!=-1 || FIND_LFUN(p,LFUN_ASSIGN_INDEX)!=-1)    return 1;    }
pike.git/src/pike_types.c:4281:    free_type(res);    free_type(sub);    res = tmp;    } else {    res = sub;    }    obj_t = obj_t->cdr;    }    sval.type = T_PROGRAM;    if ((obj_t->type != T_OBJECT) || -  (!(id = (ptrdiff_t)obj_t->cdr)) || +  (!(id = ((char *)obj_t->cdr)-(char *)0)) ||    (!(sval.u.program = id_to_program(id))) ||    (!(sub = get_type_of_svalue(&sval)))) {    if (res) {    free_type(res);    }    return NULL;    }    /* FIXME: obj_t->car should propagate to the return-type in sub. */    if (res) {    struct pike_type *tmp = or_pike_types(res, sub, 1);
pike.git/src/pike_types.c:4344:    type_may_overload(type->cdr, lfun);       case T_NOT:    return !type_may_overload(type->car, lfun);       case T_MIXED:    return 1;       case T_OBJECT:    { -  struct program *p = id_to_program((ptrdiff_t)type->cdr); +  struct program *p = id_to_program(((char *)type->cdr)-(char *)0);    if(!p) return 1;    return FIND_LFUN(p, lfun)!=-1;    }    }   }         void yyexplain_nonmatching_types(struct pike_type *type_a,    struct pike_type *type_b,    int flags)
pike.git/src/pike_types.c:4683:    case T_ZERO:    case T_VOID:    case T_MIXED:    my_putchar(t->type);    break;       case T_OBJECT:    {    INT32 i;    my_putchar(T_OBJECT); -  i = (INT32)(ptrdiff_t)t->car; +  i = (INT32)(((char *)t->car)-(char *)0);    my_putchar( i ); -  i = (INT32)(ptrdiff_t)t->cdr; +  i = (INT32)(((char *)t->cdr)-(char *)0);       if( i > 65535 ) i = 0; /* Not constant between recompilations */       my_putchar((i >> 24) & 0xff);    my_putchar((i >> 16) & 0xff);    my_putchar((i >> 8) & 0xff);    my_putchar(i & 0xff);    }    break;       case T_INT:    {    INT32 i;    my_putchar(T_INT); -  i = (INT32)(ptrdiff_t)t->car; +  i = (INT32)(((char *)t->car)-(char *)0);    my_putchar((i >> 24) & 0xff);    my_putchar((i >> 16) & 0xff);    my_putchar((i >> 8) & 0xff);    my_putchar(i & 0xff); -  i = (INT32)(ptrdiff_t)t->cdr; +  i = (INT32)(((char *)t->cdr)-(char *)0);    my_putchar((i >> 24) & 0xff);    my_putchar((i >> 16) & 0xff);    my_putchar((i >> 8) & 0xff);    my_putchar(i & 0xff);    }    break;       case T_FUNCTION:    case T_MANY:    my_putchar(T_FUNCTION);
pike.git/src/pike_types.c:4728:    t = t->cdr;    }    my_putchar(T_MANY);    low_type_to_string(t->car);    t = t->cdr;    goto recurse;       case T_SCOPE:    case T_ASSIGN:    my_putchar(t->type); -  my_putchar('0' + (ptrdiff_t)t->car); +  my_putchar('0' + (((char *)t->car)-(char *)0));    t = t->cdr;    goto recurse;       default:    Pike_error("low_type_to_string(): Unsupported node: %d\n", t->type);    break;    }   }      struct pike_string *type_to_string(struct pike_type *t)