pike.git / src / lex.c

version» Context lines:

pike.git/src/lex.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: lex.c,v 1.8 1996/11/28 03:07:14 hubbe Exp $"); + RCSID("$Id: lex.c,v 1.9 1996/12/06 04:26:57 hubbe Exp $");   #include "language.h"   #include "array.h"   #include "lex.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "constants.h"   #include "hashtable.h"   #include "stuff.h"   #include "memory.h"   #include "interpret.h"
pike.git/src/lex.c:550:    return istate->look();    }   }      /* allocate an empty memory state */   static struct inputstate *memory_inputstate(INT32 size)   {    struct inputstate *i;    if(!size) size=10000;    i=new_inputstate(); -  i->data=xalloc(size); +  i->data=(unsigned char *)xalloc(size);    i->buflen=size;    i->pos=size;    i->ungetstr=memory_ungetstr;    i->my_getc=memory_getc;    i->look=memory_look;    i->my_ungetc=memory_ungetc;    return i;   }      static void prot_memory_ungetstr(char *s,INT32 len)
pike.git/src/lex.c:590:    }else{    default_ungetc(s);    }   }      /* allocate a memory, read-only, inputstate */   static struct inputstate *prot_memory_inputstate(char *data,INT32 len)   {    struct inputstate *i;    i=new_inputstate(); -  i->data=data; +  i->data=(unsigned char *)data;    i->buflen=len;    i->dont_free_data=1;    i->pos=0;    i->my_getc=memory_getc;    i->look=memory_look;    i->ungetstr=prot_memory_ungetstr;    i->my_ungetc=prot_memory_ungetc;    return i;   }   
pike.git/src/lex.c:612:      #define READAHEAD 8192   static int file_getc()   {    unsigned char buf[READAHEAD];    int got;    do {    got=read(istate->fd, buf, READAHEAD);    if(got > 0)    { -  default_ungetstr(buf, got); +  default_ungetstr((char *)buf, got);    return istate->my_getc();    }    else if(got==0 || errno != EINTR)    {    struct inputstate *i;    if(got<0 && errno != EINTR)    my_yyerror("Lex: Read failed with error %d\n",errno);       i=istate->next;    close(istate->fd);