pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.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: pike_types.c,v 1.249 2005/09/09 14:50:18 grubba Exp $ + || $Id: pike_types.c,v 1.250 2005/11/08 11:46:05 grubba Exp $   */      #include "global.h"   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"
pike.git/src/pike_types.c:2299:   }            /******/      /*    * match two type strings, return zero if they don't match, and return    * the part of 'a' that _did_ match if it did.    */ + #ifdef PIKE_TYPE_DEBUG + static struct pike_type *low_match_types2(struct pike_type *a, +  struct pike_type *b, +  int flags); + #endif   static struct pike_type *low_match_types(struct pike_type *a,    struct pike_type *b,    int flags)   #ifdef PIKE_TYPE_DEBUG   {    int e;    char *s; -  static struct pike_type *low_match_types2(struct pike_type *a, -  struct pike_type *b, -  int flags); +        if (l_flag>2) {    dynamic_buffer save_buf;    init_buf(&save_buf);    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat("low_match_types(");    my_describe_type(a);    my_strcat(",\n");    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat(" ");
pike.git/src/pike_types.c:2383: Inside #if defined(PIKE_TYPE_DEBUG)
   fprintf(stderr,"%s",(s=simple_free_buf(&save_buf)));    free(s);    }    return a;   }      static struct pike_type *low_match_types2(struct pike_type *a,    struct pike_type *b,    int flags)   #endif -  +    {    int correct_args;    struct pike_type *ret;    if(a == b) return a;       switch(a->type)    {    case T_AND:    ret = low_match_types(a->car, b, flags);    if(!ret) return 0;
pike.git/src/pike_types.c:2836:    *    * zero    *    * void    *    * Note that non-destructive operations are assumed.    * ie it's assumed that calling a function(mapping(string|int:string|int):void)    * with a mapping(int:int) won't change the type of the mapping after the    * operation.    */ + #ifdef PIKE_TYPE_DEBUG + static int low_pike_types_le2(struct pike_type *a, struct pike_type *b, +  int array_cnt, unsigned int flags); + #endif /* PIKE_TYPE_DEBUG */   static int low_pike_types_le(struct pike_type *a, struct pike_type *b,    int array_cnt, unsigned int flags)   #ifdef PIKE_TYPE_DEBUG   {    int e;    char *s; -  static int low_pike_types_le2(struct pike_type *a, struct pike_type *b, -  int array_cnt, unsigned int flags); +     int res;    char buf[50];       if (l_flag>2) {    dynamic_buffer save_buf;    init_buf(&save_buf);    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat("low_pike_types_le(");    my_describe_type(a);    my_strcat(",\n");
pike.git/src/pike_types.c:2885: Inside #if defined(PIKE_TYPE_DEBUG)
      for(e=0;e<indent;e++) fprintf(stderr, " ");    fprintf(stderr, "= %d\n", res);    }    return res;   }      static int low_pike_types_le2(struct pike_type *a, struct pike_type *b,    int array_cnt, unsigned int flags)   #endif /* PIKE_TYPE_DEBUG */ -  +    {    int ret;       recurse:   #if 0    fprintf(stderr, "low_pike_types_le(%d, %d, %d, 0x%08x)\n",    a->type, b->type, array_cnt, flags);   #endif /* 0 */       if(a == b) return 1;