pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.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: builtin_functions.c,v 1.495 2003/06/11 23:01:48 nilsson Exp $ + || $Id: builtin_functions.c,v 1.496 2003/06/24 20:27:19 nilsson Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.495 2003/06/11 23:01:48 nilsson Exp $"); + RCSID("$Id: builtin_functions.c,v 1.496 2003/06/24 20:27:19 nilsson Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:100:    *! Arrays are dynamically allocated there is no need to declare them    *! like @expr{int a[10]=allocate(10);@} (and it isn't possible either) like    *! in C, just @expr{array(int) a=allocate(10);@} will do.    *!    *! @seealso    *! @[sizeof()], @[arrayp()], @[allocate()]    */   PMOD_EXPORT void debug_f_aggregate(INT32 args)   {    struct array *a; - #ifdef PIKE_DEBUG -  if(args < 0) Pike_fatal("Negative args to f_aggregate() (%d)\n",args); - #endif -  +     a=aggregate_array(args);    push_array(a); /* beware, macro */   }         /*! @decl int hash_7_4(string s)    *! @decl int hash_7_4(string s, int max)    *!    *! This function will return an @expr{int@} derived from the string @[s].    *! The same string will always hash to the same value.
pike.git/src/builtin_functions.c:6408:    *! @[splice()], @[`/()]    */   void f_everynth(INT32 args)   {    INT32 k,n=2;    INT32 start=0;    struct array *a;    struct array *ina;    TYPE_FIELD types;    INT32 size=0; - #ifdef PIKE_DEBUG -  if(args < 0) Pike_fatal("Negative args to f_everynth()\n"); - #endif +        check_all_args("everynth", args,    BIT_ARRAY, BIT_INT | BIT_VOID, BIT_INT | BIT_VOID , 0);       switch(args)    {    default:    case 3:    start=Pike_sp[2-args].u.integer;    if(start<0)
pike.git/src/builtin_functions.c:6455:   /*! @decl array(array) transpose(array(array) matrix)    */   PMOD_EXPORT void f_transpose(INT32 args)   {    struct array *out;    struct array *in;    struct array *outinner;    INT32 sizeininner=0,sizein=0;    INT32 j,i;    TYPE_FIELD type=0; - #ifdef PIKE_DEBUG -  if(args < 0) Pike_fatal("Negative args to f_transpose()\n"); - #endif +        if (args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("transpose", 1);       if (Pike_sp[-args].type!=T_ARRAY)    SIMPLE_BAD_ARG_ERROR("transpose", 1, "array(array)");       in=Pike_sp[-args].u.array;    sizein=in->size;