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.340 2008/06/18 20:48:08 grubba Exp $ + || $Id: pike_types.c,v 1.341 2008/06/18 21:49:51 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:1920:    {    INT32 min;    INT32 max;    s = s->car;    fprintf(stderr, "string");    if (s->type == T_ZERO) {    fprintf(stderr, "(zero)");    } else if (s != int_type_string) {    fprintf(stderr, "(");    while (s->type == T_OR) { +  struct pike_type *char_type = s->car; +  while(char_type->type == T_ASSIGN) { +  char_type = char_type->cdr; +  } +    #ifdef PIKE_DEBUG -  if (s->car->type != T_INT) { +  if (char_type->type != T_INT) {    Pike_fatal("Invalid node type (%d:%s) in string type.\n", -  s->car->type, get_name_of_type(s->car->type)); +  char_type->type, get_name_of_type(char_type->type));    }   #endif /* PIKE_DEBUG */ -  min = CAR_TO_INT(s->car); -  max = CDR_TO_INT(s->car); +  min = CAR_TO_INT(char_type); +  max = CDR_TO_INT(char_type);    if (min != MIN_INT32) {    fprintf(stderr, "%d", min);    }    fprintf(stderr, "..");    if (max != MAX_INT32) {    fprintf(stderr, "%d", max);    }    fprintf(stderr, " | ");    s = s->cdr;    } -  +  while(s->type == T_ASSIGN) { +  s = s->cdr; +  }   #ifdef PIKE_DEBUG    if (s->type != T_INT) {    Pike_fatal("Invalid node type (%d:%s) in string type.\n",    s->type, get_name_of_type(s->type));    }   #endif /* PIKE_DEBUG */    min = CAR_TO_INT(s);    max = CDR_TO_INT(s);    if (min != MIN_INT32) {    fprintf(stderr, "%d", min);
pike.git/src/pike_types.c:2157:    {    INT32 min;    INT32 max;    t = t->car;    my_strcat("string");    if (t->type == T_ZERO) {    my_strcat("(zero)");    } else if (t != int_type_string) {    my_strcat("(");    while (t->type == T_OR) { +  struct pike_type *char_type = t->car; +  while(char_type->type == T_ASSIGN) { +  char_type = char_type->cdr; +  }   #ifdef PIKE_DEBUG -  if (t->car->type != T_INT) { +  if (char_type->type != T_INT) {    Pike_fatal("Invalid node type (%d:%s) in string type.\n", -  t->car->type, get_name_of_type(t->car->type)); +  char_type->type, get_name_of_type(char_type->type));    }   #endif /* PIKE_DEBUG */ -  min = CAR_TO_INT(t->car); -  max = CDR_TO_INT(t->car); +  min = CAR_TO_INT(char_type); +  max = CDR_TO_INT(char_type);    if (min != MIN_INT32) {    sprintf(buffer, "%d", min);    my_strcat(buffer);    }    my_strcat("..");    if (max != MAX_INT32) {    sprintf(buffer, "%d", max);    my_strcat(buffer);    }    my_strcat(" | ");    t = t->cdr;    } -  +  while(t->type == T_ASSIGN) { +  t = t->cdr; +  }   #ifdef PIKE_DEBUG    if (t->type != T_INT) {    Pike_fatal("Invalid node type (%d:%s) in string type.\n",    t->type, get_name_of_type(t->type));    }   #endif /* PIKE_DEBUG */    min = CAR_TO_INT(t);    max = CDR_TO_INT(t);    if (min != MIN_INT32) {    sprintf(buffer, "%d", min);