Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.108
 
1.109
 
MAIN:ragge:20101218113847
 
cpp.c
_>11 /*      $Id$    */
 22 
 33 /*
<>4 - * Copyright (c) 2004 Anders Magnusson (ragge@ludd.luth.se).
  4+ * Copyright (c) 2004,2010 Anders Magnusson (ragge@ludd.luth.se).
55  * All rights reserved.
 66  *
 77  * Redistribution and use in source and binary forms, with or without
     
 !
1212  * 2. Redistributions in binary form must reproduce the above copyright
 1313  *    notice, this list of conditions and the following disclaimer in the
 1414  *    documentation and/or other materials provided with the distribution.
<>15 - * 3. The name of the author may not be used to endorse or promote products
 16 - *    derived from this software without specific prior written permission
1715  *
 1816  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 1917  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     
 !
2826  */
 2927 
 3028 /*
<>31 - * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.
 32 - *
 33 - * Redistribution and use in source and binary forms, with or without
 34 - * modification, are permitted provided that the following conditions
 35 - * are met:
 36 - *
 37 - * Redistributions of source code and documentation must retain the above
 38 - * copyright notice, this list of conditions and the following disclaimer.
 39 - * Redistributions in binary form must reproduce the above copyright
 40 - * notice, this list of conditions and the following disclaimer in the
 41 - * documentation and/or other materials provided with the distribution.
 42 - * All advertising materials mentioning features or use of this software
 43 - * must display the following acknowledgement:
 44 - *      This product includes software developed or owned by Caldera
 45 - *      International, Inc.
 46 - * Neither the name of Caldera International, Inc. nor the names of other
 47 - * contributors may be used to endorse or promote products derived from
 48 - * this software without specific prior written permission.
 49 - *
 50 - * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
 51 - * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
 52 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 53 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 54 - * DISCLAIMED.  IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE
 55 - * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 56 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 57 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 58 - * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT,
 59 - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 60 - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 61 - * POSSIBILITY OF SUCH DAMAGE.
 62 - */
 63 -/*
6429  * The C preprocessor.
 6530  * This code originates from the V6 preprocessor with some additions
 6631  * from V7 cpp, and at last ansi/c99 support.
     
 !
153118  *   OBJCT - object-type macro
 154119  *   0     - empty parenthesis, foo()
 155120  *   1->   - number of args.
<> 121+ *
  122+ * WARN is used:
  123+ *      - in stored replacement lists to tell that an argument comes
  124+ *      - When expanding replacement lists to tell that the list ended.
156125  */
 157126 
 158127 #define GCCARG  0xfd    /* has gcc varargs that may be replaced with 0 */
     
 !
361330         *ww = w;
 362331 }
 363332 
<>364 -/*
 365 - * Expand the symbol nl read from input.
 366 - * Return a pointer to the fully expanded result.
 367 - * It is the responsibility of the caller to reset the heap usage.
 368 - */
369333 usch *
 370334 gotident(struct symtab *nl)
 371335 {
     
 !
10951059  * substitute namep for sp->value.
 10961060  */
 10971061 int
<>1098 -subst(sp, rp)
 1099 -struct symtab *sp;
 1100 -struct recur *rp;
  1062+subst(struct symtab *sp, struct recur *rp)
11011063 {
 11021064         struct recur rp2;
 11031065         register const usch *vp, *cp;
     
 !
13001262                                         goto def;
 13011263                                 break;
 13021264                         }
<>1303 -//printf("noexp1 %d nl->namep %s\n", noexp, nl->namep);
 1304 -//if (noexp > 1) goto def;
13051265                         if (noexp != 1)
 13061266                                 error("bad noexp %d", noexp);
 13071267                         stksv = NULL;
     
 !
13711331         const usch **args, *ap, *bp, *sp;
 13721332         usch *sptr;
 13731333         int narg, c, i, plev, snuff, instr;
<>1374 -        int ellips = 0;
  1334+        int ellips = 0, shot = gotwarn;
13751335 
 13761336         DPRINT(("expdef rp %s\n", (rp ? (const char *)rp->sp->namep : "")));
 13771337         if ((c = sloscan()) != '(')
     
 !
15061466                         } else
 15071467                                 bp = ap = args[(int)*--sp];
 15081468                         if (sp[2] != CONC && !snuff && sp[-1] != CONC) {
<> 1469+                                struct recur *r2 = rp->next;
15091470                                 cunput(WARN);
 15101471                                 while (*bp)
 15111472                                         bp++;
     
 !
15141475                                 DPRINT(("expand arg %d string %s\n", *sp, ap));
 15151476                                 bp = ap = stringbuf;
 15161477                                 savch(NOEXP);
<>1517 -                                expmac(rp->next);
  1478+                                while (shot && r2)
  1479+                                        r2 = r2->next, shot--;
  1480+                                expmac(r2);
<_15181481                                 savch(EXPAND);
 15191482                                 savch('\0');
 15201483                         }
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-08-22 01:57 +0200