Branch: Tag:

2008-05-03

2008-05-03 20:06:07 by Henrik Grubbström (Grubba) <grubba@grubba.org>

First go at warning for deprecated symbols.
Added CompilerEnvironment()->PikeCompiler()->{push,pop}_type_attribute().
pike_types_le() now calls the above when encountering asymmetric attribute types.
Added some tests for the above.

Rev: src/pike_compiler.h:1.11
Rev: src/pike_types.c:1.324
Rev: src/program.c:1.686
Rev: src/testsuite.in:1.804

2:   || 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.323 2008/05/02 04:15:14 mast Exp $ + || $Id: pike_types.c,v 1.324 2008/05/03 20:06:07 grubba Exp $   */      #include "global.h"
3683:    int array_cnt, unsigned int flags)   #endif /* PIKE_TYPE_DEBUG */   { +  struct compilation *c = MAYBE_THIS_COMPILATION;    int ret;       recurse:
3751:    b = b->cdr;    goto recurse;    } - #if 0 -  if (!flags & LE_USE_HANDLERS) { +  if (!c) {    a = a->cdr;    goto recurse;    } - #endif /* 0 */ +     if (!low_pike_types_le(a->cdr, b, array_cnt, flags)) return 0; - #if 0 +     ref_push_string((struct pike_string *)a->car);    ref_push_type_value(a->cdr);    ref_push_type_value(b); -  push_int(1); -  if (safe_apply_handler("handle_attribute", error_handler, compat_handler, -  4, 0)) { +  safe_apply_current2(PC_POP_TYPE_ATTRIBUTE_FUN_NUM, 3, +  "pop_type_attribute");    if ((Pike_sp[-1].type == T_INT) &&    (Pike_sp[-1].subtype == NUMBER_NUMBER) &&    (!Pike_sp[-1].u.integer)) {
3772: Inside #if 0
   return 0;    }    pop_stack(); -  } - #endif /* 0 */ +     return 1;       case T_NOT:
3909:    goto recurse;       case PIKE_T_ATTRIBUTE: - #if 0 -  if (!flags & LE_USE_HANDLERS) { +  if (!c) {    b = b->cdr;    goto recurse;    } - #endif /* 0 */ +     if (!low_pike_types_le(a, b->cdr, array_cnt, flags)) return 0; - #if 0 +     ref_push_string((struct pike_string *)b->car);    ref_push_type_value(a);    ref_push_type_value(b->cdr); -  push_int(2); -  if (safe_apply_handler("handle_attribute", error_handler, compat_handler, -  4, 0)) { +  safe_apply_current2(PC_PUSH_TYPE_ATTRIBUTE_FUN_NUM, 3, +  "push_type_attribute");    if ((Pike_sp[-1].type == T_INT) &&    (Pike_sp[-1].subtype == NUMBER_NUMBER) &&    (!Pike_sp[-1].u.integer)) {
3930: Inside #if 0
   return 0;    }    pop_stack(); -  } - #endif /* 0 */ +     return 1;    case PIKE_T_SCOPE:   #ifdef TYPE_GROUPING