Branch: Tag:

2001-04-01

2001-04-01 15:40:23 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Renamed copy_type() to copy_pike_type() to avoid conflict with <mach/mach.p>.

Rev: src/builtin_functions.c:1.357
Rev: src/language.yacc:1.242
Rev: src/las.c:1.249
Rev: src/operators.c:1.134
Rev: src/pike_types.c:1.177
Rev: src/pike_types.h:1.71
Rev: src/program.c:1.308

5:   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.248 2001/03/28 17:59:36 grubba Exp $"); + RCSID("$Id: las.c,v 1.249 2001/04/01 15:40:23 grubba Exp $");      #include "language.h"   #include "interpret.h"
304:    if (n->token == F_RETURN) {    if (CAR(n)) {    if (CAR(n)->type) { -  copy_type(a, CAR(n)->type); +  copy_pike_type(a, CAR(n)->type);    } else {   #ifdef PIKE_DEBUG    if (l_flag > 2) {
312: Inside #if defined(PIKE_DEBUG)
   print_tree(n);    }   #endif /* PIKE_DEBUG */ -  copy_type(a, mixed_type_string); +  copy_pike_type(a, mixed_type_string);    }    } else { -  copy_type(a, zero_type_string); +  copy_pike_type(a, zero_type_string);    }    return a;    }
395: Inside #if defined(SHARED_NODES) and #if defined(PIKE_DEBUG)
   while(probe) {    if (probe == n)    { -  fprintf(stderr, "add_node(%p == %p): Node already added!\n", probe, n); +  fprintf(stderr, "add_node(%p == %p): Node already added!\n", +  (void *)probe, (void *)n);    fprintf( stderr, " %ld <-> %ld\n",    DO_NOT_WARN((long)hval),    DO_NOT_WARN((long)(n->hash % node_hash.size)) );    probe = node_hash.table[hval];    while( probe )    { -  fprintf(stderr, " %p\n", probe); +  fprintf(stderr, " %p\n", (void *)probe);    probe = probe->next;    }    fatal( "Node already added!\n" );
480: Inside #if defined(SHARED_NODES)
   /* Use the new type if it's stricter. */    if (pike_types_le(orig->type, n->type)) {    free_type(n->type); -  copy_type(n->type, orig->type); +  copy_pike_type(n->type, orig->type);    }    } else {    /* This probably doesn't happen, but... */ -  copy_type(n->type, orig->type); +  copy_pike_type(n->type, orig->type);    }    }    if (!found) {
563: Inside #if defined(PIKE_DEBUG)
   if(!cumulative_parse_error)    {    fprintf(stderr,"Free node at %p, (%s:%d) (token=%d).\n", -  tmp, tmp->current_file->str, tmp->line_number, +  (void *)tmp, tmp->current_file->str, tmp->line_number,    tmp->token);       debug_malloc_dump_references(tmp,0,2,0);
802: Inside #if defined(PIKE_DEBUG) && defined(SHARED_NODES)
  #if defined(PIKE_DEBUG) && defined(SHARED_NODES)    if (n && !(n->tree_info & (OPT_DEFROSTED|OPT_NOT_SHARED)) && (n->hash != hash_node(n))) {    fprintf(stderr,"Bad node hash at %p, (%s:%d) (token=%d).\n", -  n, n->current_file->str, n->line_number, +  (void *)n, n->current_file->str, n->line_number,    n->token);    debug_malloc_dump_references(n,0,0,0);    print_tree(n);
927:    break;       case F_POP_VALUE: -  copy_type(res->type, void_type_string); +  copy_pike_type(res->type, void_type_string);       if(a) res->tree_info |= a->tree_info;    if(b) res->tree_info |= b->tree_info;
1061:   {    node *res = mkemptynode();    res->token = F_CONSTANT; -  copy_type(res->type, string_type_string); +  copy_pike_type(res->type, string_type_string);    res->node_info = 0;    res->u.sval.type = T_STRING;   #ifdef __CHECKER__
1107:   {    node *res = mkemptynode();    res->token = F_CONSTANT; -  copy_type(res->type, float_type_string); +  copy_pike_type(res->type, float_type_string);    res->u.sval.type = T_FLOAT;   #ifdef __CHECKER__    res->u.sval.subtype = 0;
1165:       f=Pike_compiler->compiler_frame;    for(e=0;e<depth;e++) f=f->previous; -  copy_type(res->type, f->variable[var].type); +  copy_pike_type(res->type, f->variable[var].type);       res->node_info = OPT_NOT_CONST | OPT_NOT_SHARED;    res->tree_info = res->node_info;
1228:   {    node *res = mkemptynode();    res->token = F_TRAMPOLINE; -  copy_type(res->type, ID_FROM_INT(Pike_compiler->new_program, i)->type); +  copy_pike_type(res->type, ID_FROM_INT(Pike_compiler->new_program, i)->type);       /* FIXME */    if(IDENTIFIER_IS_CONSTANT(ID_FROM_INT(Pike_compiler->new_program, i)->identifier_flags))
1268:    }   #endif    -  copy_type(res->type, id->type); +  copy_pike_type(res->type, id->type);       /* FIXME */    if(IDENTIFIER_IS_CONSTANT(id->identifier_flags))
1328:       res = mkemptynode();    res->token = F_CAST; -  copy_type(res->type, type); +  copy_pike_type(res->type, type);       if(match_types(object_type_string, type) ||    match_types(program_type_string, type))
1387:       res = mkemptynode();    res->token = F_SOFT_CAST; -  copy_type(res->type, type); +  copy_pike_type(res->type, type);       res->tree_info |= n->tree_info;   
1804:   {    node *res = mkemptynode();    res->token = F_CONSTANT; -  copy_type(res->u.sval.u.type, t); +  copy_pike_type(res->u.sval.u.type, t);    res->u.sval.type = T_TYPE; -  copy_type(res->type, type_type_string); +  /* FIXME: Should be type(val) */ +  copy_pike_type(res->type, type_type_string);    return freeze_node(res);   }   
1917:    b=mknewintnode(0);    if(b->type) free_type(b->type);    *b=*n; -  copy_type(b->type, n->type); +  copy_pike_type(b->type, n->type);    return b;       default:
1947:    b=mknode(n->token, CAR(n), CDR(n));    }    if(n->type) -  copy_type(b->type, n->type); +  copy_pike_type(b->type, n->type);    else    b->type=0;   
2012: Inside #if defined(SHARED_NODES)
   b=mknewintnode(0);    if(b->type) free_type(b->type);    *b=*n; -  copy_type(b->type, n->type); +  copy_pike_type(b->type, n->type);    return b;       default:
2023: Inside #if defined(SHARED_NODES)
   if(cdr_is_node(n)) _CDR(b)=copy_node(CDR(n));       if(n->type) -  copy_type(b->type, n->type); +  copy_pike_type(b->type, n->type);    else    b->type=0;   
2035: Inside #if defined(SHARED_NODES)
   _CAR(b)=copy_node(CAR(n));    _CDR(b)=copy_node(CDR(n));    if(n->type) -  copy_type(b->type, n->type); +  copy_pike_type(b->type, n->type);    else    b->type=0;    break;
3156:    /* FALL_THROUGH */    case F_CAST:    /* Type-field is correct by definition. */ -  copy_type(n->type, old_type); +  copy_pike_type(n->type, old_type);    break;       case F_LAND:    case F_LOR:    if (!CAR(n) || CAR(n)->type == void_type_string) {    yyerror("Conditional uses void expression."); -  copy_type(n->type, mixed_type_string); +  copy_pike_type(n->type, mixed_type_string);    break;    }    if(!match_types(CAR(n)->type, mixed_type_string))    yyerror("Bad conditional expression.");       if (!CDR(n) || CDR(n)->type == void_type_string) -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    else if(n->token == F_LAND || CAR(n)->type == CDR(n)->type)    { -  copy_type(n->type, CDR(n)->type); +  copy_pike_type(n->type, CDR(n)->type);    }else{    n->type = or_pike_types(CAR(n)->type, CDR(n)->type, 0);    }
3182:    case F_ASSIGN:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    my_yyerror("Assigning a void expression."); -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    break;    } else if(CAR(n) && CDR(n)) {    /* Ensure that the type-fields are up to date. */
3219:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    my_yyerror("Indexing a void expression.");    /* The optimizer converts this to an expression returning 0. */ -  copy_type(n->type, zero_type_string); +  copy_pike_type(n->type, zero_type_string);    } else {    type_a=CAR(n)->type;    type_b=CDR(n)->type;
3243: Inside #if defined(USE_PIKE_TYPE) && defined(NEW_ARG_CHECK)
      args = 0;    -  copy_type(f, CAR(n)->type); +  copy_pike_type(f, CAR(n)->type);       f = new_check_call(CAR(n), &args, f, CDR(n));   
3374:    if(TEST_COMPAT(0,6))    {    free_type(s); -  copy_type(n->type, mixed_type_string); +  copy_pike_type(n->type, mixed_type_string);    break;    }    my_yyerror("Too many arguments to %s.",name);
3394:    free_type(s);   #endif /* USE_PIKE_TYPE && NEW_ARG_CHECK */    } -  copy_type(n->type, mixed_type_string); +  copy_pike_type(n->type, mixed_type_string);    break;       case '?':
3407:    CADR(n)->type == void_type_string ||    CDDR(n)->type == void_type_string)    { -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    break;    }       if(CADR(n)->type == CDDR(n)->type)    { -  copy_type(n->type, CADR(n)->type); +  copy_pike_type(n->type, CADR(n)->type);    break;    }   
3478:    if (!(op_node = find_module_identifier(op_string, 0))) {    my_yyerror("Internally used efun undefined for token %d: %s()",    n->token, op_string->str); -  copy_type(n->type, mixed_type_string); +  copy_pike_type(n->type, mixed_type_string);    free_string(op_string);    break;    }
3516:    free_type(call_type);    free_string(op_string);    } -  copy_type(n->type, mixed_type_string); +  copy_pike_type(n->type, mixed_type_string);    break;    case F_RANGE:    case F_INC:
3526:    if (CAR(n)) {    /* The expression gets the type from the variable. */    /* FIXME: Ought to strip non-applicable subtypes from the type. */ -  copy_type(n->type, CAR(n)->type); +  copy_pike_type(n->type, CAR(n)->type);    } else { -  copy_type(n->type, mixed_type_string); +  copy_pike_type(n->type, mixed_type_string);    }    break;   
3540:    sub_node(n);   #endif /* SHARED_NODES */    _CAR(n) = mkintnode(0); -  copy_type(n->type, CAR(n)->type); +  copy_pike_type(n->type, CAR(n)->type);   #ifdef SHARED_NODES    if (!(n->tree_info & OPT_NOT_SHARED)) {    n->hash = hash_node(n);
3576:    }    }    } -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    break;       case F_CASE:
3617:    case F_BREAK:    case F_DEFAULT:    case F_POP_VALUE: -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    break;       case F_DO:
3625:    yyerror("do - while(): Conditional expression is void.");    } else if(!match_types(CDR(n)->type, mixed_type_string))    yyerror("Bad conditional expression do - while()."); -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    break;       case F_FOR:
3633:    yyerror("for(): Conditional expression is void.");    } else if(!match_types(CAR(n)->type, mixed_type_string))    yyerror("Bad conditional expression for()."); -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    break;       case F_SWITCH:
3641:    yyerror("switch(): Conditional expression is void.");    } else if(!match_types(CAR(n)->type, mixed_type_string))    yyerror("Bad switch expression."); -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    break;       case F_CONSTANT:
3786:    }    }    foreach_type_check_done: -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    break;       case F_SSCANF:
3818:    break;       case F_UNDEFINED: -  copy_type(n->type, zero_type_string); +  copy_pike_type(n->type, zero_type_string);    break;       case F_ARG_LIST:
3831:    if(!CAR(n) || CAR(n)->type==void_type_string)    {    if(CDR(n)) -  copy_type(n->type, CDR(n)->type); +  copy_pike_type(n->type, CDR(n)->type);    else -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    break;    }       if(!CDR(n) || CDR(n)->type == void_type_string)    {    if(CAR(n)) -  copy_type(n->type, CAR(n)->type); +  copy_pike_type(n->type, CAR(n)->type);    else -  copy_type(n->type, void_type_string); +  copy_pike_type(n->type, void_type_string);    break;    }    if (n->token == F_ARG_LIST) {    n->type = or_pike_types(CAR(n)->type, CDR(n)->type, 0);    } else { -  copy_type(n->type, CDR(n)->type); +  copy_pike_type(n->type, CDR(n)->type);    }    break;   
3866:    case F_CATCH:    /* FALL_THROUGH */    default: -  copy_type(n->type, mixed_type_string); +  copy_pike_type(n->type, mixed_type_string);    }       if (n->type != old_type) {
5031:    pike_types_le(n->type,new->type)))) {    if (new->type)    free_type(new->type); -  copy_type(new->type, n->type); +  copy_pike_type(new->type, n->type);    }    }    free_node(n);