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.118 2001/06/17 18:18:05 grubba Exp $"); + RCSID("$Id: docode.c,v 1.119 2001/06/17 19:15:15 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 "pike_error.h"   #include "pike_memory.h"
pike.git/src/docode.c:1066:    return 0;    }       case F_CAST:    if(n->type==void_type_string)    {    DO_CODE_BLOCK(CAR(n));    return 0;    } else if (n->type == int_type_string) {    tmp1 = do_docode(CAR(n), 0); -  if(!tmp1) { emit0(F_CONST0); tmp1=1; } +  if(!tmp1) +  emit0(F_CONST0);    else { -  if(tmp1>1) do_pop(DO_NOT_WARN((INT32)(tmp1-1))); +  if(tmp1>1) +  do_pop(DO_NOT_WARN((INT32)(tmp1-1)));    emit0(F_CAST_TO_INT);    }    return 1; -  +  } else if (n->type == string_type_string) { +  tmp1 = do_docode(CAR(n), 0); +  if(!tmp1) +  emit0(F_CONST0); +  else if(tmp1>1) +  do_pop(DO_NOT_WARN((INT32)(tmp1-1))); +  emit0(F_CAST_TO_STRING); +  return 1;    } else if (compile_type_to_runtime_type(n->type) == PIKE_T_MIXED) {    tmp1 = do_docode(CAR(n), 0);    if(!tmp1)    emit0(F_CONST0);    else if(tmp1>1)    do_pop(DO_NOT_WARN((INT32)(tmp1-1)));    return 1;    }    {    struct svalue sv;