pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: docode.c,v 1.81 2000/09/08 16:32:59 grubba Exp $"); + RCSID("$Id: docode.c,v 1.82 2000/09/11 18:42:25 grubba Exp $");   #include "las.h"   #include "program.h"   #include "pike_types.h"   #include "stralloc.h"   #include "interpret.h"   #include "constants.h"   #include "array.h"   #include "pike_macros.h"   #include "error.h"   #include "pike_memory.h"
pike.git/src/docode.c:88:      static int is_efun(node *n, c_fun fun)   {    return n && n->token == F_CONSTANT &&    n->u.sval.subtype == FUNCTION_BUILTIN &&    n->u.sval.u.efun->function == fun;   }      static void code_expression(node *n, INT16 flags, char *err)   { -  switch(do_docode(check_node_hash(n), flags & ~ DO_POP)) +  switch(do_docode(check_node_hash(n), (INT16)(flags & ~DO_POP)))    {    case 0: my_yyerror("Void expression for %s",err);    case 1: return;    case 2:    fatal("Internal compiler error (%s), line %ld, file %s\n",    err,    (long)lex.current_line,    lex.current_file?lex.current_file->str:"Unknown");    }   }
pike.git/src/docode.c:140:       case F_APPLY:    if(!is_efun(CAR(n), f_not)) break;       case F_NOT:    if(!(flags & DO_POP)) break;    do_cond_jump(CDR(n), label , !iftrue, flags | DO_NOT_COPY);    return;    }    -  code_expression(n, flags | DO_NOT_COPY, "condition"); +  code_expression(n, (INT16)(flags | DO_NOT_COPY), "condition");       if(flags & DO_POP)    {    if(iftrue)    do_jump(F_BRANCH_WHEN_NON_ZERO, label);    else    do_jump(F_BRANCH_WHEN_ZERO, label);    }else{    if(iftrue)    do_jump(F_LOR, label);
pike.git/src/docode.c:883:    tmp1=store_constant(& foo->u.sval, 1, foo->name);    emit1(F_APPLY, DO_NOT_WARN((INT32)tmp1));    }    }    free_node(foo);    return 1;    }       case F_ARG_LIST:    case F_COMMA_EXPR: -  tmp1=do_docode(CAR(n),flags & ~WANT_LVALUE); +  tmp1 = do_docode(CAR(n), (INT16)(flags & ~WANT_LVALUE));    tmp1+=do_docode(CDR(n),flags);    return DO_NOT_WARN((INT32)tmp1);          /* Switch:    * So far all switches are implemented with a binsearch lookup.    * It stores the case values in the programs area for constants.    * It also has a jump-table in the program itself, for every index in    * the array of cases, there is 2 indexes in the jumptable, and one extra.    * The first entry in the jumptable is used if you call switch with
pike.git/src/docode.c:1193:    if(n->token==F_CONSTANT && !(n->node_info & OPT_EXTERNAL_DEPEND))    emit0(F_COPY_VALUE);    }    }    return DO_NOT_WARN((INT32)tmp1);       case F_INDEX:    if(flags & WANT_LVALUE)    {    int mklval=CAR(n) && match_types(CAR(n)->type, string_type_string); -  tmp1=do_docode(CAR(n), -  mklval ? DO_LVALUE_IF_POSSIBLE : 0); +  tmp1 = do_docode(CAR(n), +  (INT16)(mklval ? DO_LVALUE_IF_POSSIBLE : 0));    if(tmp1==2)    {   #ifdef PIKE_DEBUG    if(!mklval)    fatal("Unwanted lvalue!\n");   #endif    emit0(F_INDIRECT);    }       if(do_docode(CDR(n),0) != 1)
pike.git/src/docode.c:1347:    {    emit1(F_GLOBAL_LVALUE,n->u.id.number);    return 2;    }else{    emit1(F_GLOBAL,n->u.id.number);    }    }    return 1;       case F_VAL_LVAL: -  return do_docode(CAR(n),flags)+do_docode(CDR(n),flags | DO_LVALUE); +  return do_docode(CAR(n),flags) + +  do_docode(CDR(n), (INT16)(flags | DO_LVALUE));       default:    fatal("Infernal compiler error (unknown parse-tree-token).\n");    return 0; /* make gcc happy */    }   }      void do_code_block(node *n)   {    init_bytecode();