pike.git / src / modules / Regexp / pike_regexp.c

version» Context lines:

pike.git/src/modules/Regexp/pike_regexp.c:254:    register regexp *r;    register char *scan;    register char *longest;    register ptrdiff_t len;    int flags;    short *exp2,*dest,c;       if (exp == (char *)NULL)    FAIL("NULL argument");    -  exp2=(short*)xalloc( (strlen(exp)+1) * sizeof(short) ); +  exp2=xalloc( (strlen(exp)+1) * sizeof(short) );    for ( scan=exp,dest=exp2;( c= UCHARAT(scan++)); ) {    switch (c) {    case '(':    case ')':    *dest++ = excompat ? c : c | SPECIAL;    break;    case '.':    case '*':    case '+':    case '|':
pike.git/src/modules/Regexp/pike_regexp.c:309:    regsize = 0L;    regcode = &regdummy;    if (reg(0, &flags) == (char *)NULL)    return ((regexp *)NULL);       /* Small enough for pointer-storage convention? */    if (regsize >= 32767L) /* Probably could be 65535L. */    FAIL("regexp too big");       /* Allocate space. */ -  r = (regexp *) xalloc(sizeof(regexp) + (unsigned) regsize); +  r = xalloc(sizeof(regexp) + (unsigned) regsize);       /* Second pass: emit code. */    regparse = exp2;    regnpar = 1;    regcode = r->program;    if (reg(0, &flags) == NULL)    return ((regexp *) NULL);       /* Dig out information for optimizations. */    r->regstart = '\0'; /* Worst-case defaults. */