diff options
Diffstat (limited to 'idlc/source/preproc/macro.c')
-rw-r--r-- | idlc/source/preproc/macro.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/idlc/source/preproc/macro.c b/idlc/source/preproc/macro.c index f54bb490b..c32e0a960 100644 --- a/idlc/source/preproc/macro.c +++ b/idlc/source/preproc/macro.c @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,13 +31,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> - -#ifdef __hpux -# define _HPUX_SOURCE -#endif -#ifdef SCO -# define _IBCS2 -#endif #include <limits.h> #include "cpp.h" @@ -53,11 +47,7 @@ void Nlist *np; Source *s; Tokenrow *def, *args; -#ifdef OS2 - static uchar location[(_MAX_PATH + 8) * NINC], *cp; -#else static uchar location[(PATH_MAX + 8) * NINC], *cp; -#endif tp = trp->tp + 1; if (tp >= trp->lp || tp->type != NAME) { @@ -75,14 +65,14 @@ void args = NULL; if (tp < trp->lp && tp->type == LP && tp->wslen == 0) { - /* macro with args */ - int narg = 0; - tp += 1; args = new(Tokenrow); maketokenrow(2, args); if (tp->type != RP) { + /* macro with args */ + int narg = 0; + int err = 0; for (;;) @@ -232,7 +222,7 @@ void expandrow(Tokenrow * trp, char *flag) { Token *tp; - Nlist *np; + Nlist *np=NULL; if (flag) setsource(flag, -1, -1, "", 0); @@ -300,7 +290,7 @@ void expand(Tokenrow * trp, Nlist * np) { Tokenrow ntr; - int ntokc, narg, i; + int ntokc, narg; Tokenrow *atr[NARG + 1]; if (Mflag == 2) @@ -316,6 +306,8 @@ void ntokc = 1; else { + int i; + ntokc = gatherargs(trp, atr, &narg); if (narg < 0) { /* not actually a call (no '(') */ @@ -329,7 +321,7 @@ void return; } substargs(np, &ntr, atr); /* put args into replacement */ - for (i = 0; i < narg; i++) + for (i = 0; i < narg; ++i) { dofree(atr[i]->bp); dofree(atr[i]); @@ -698,3 +690,5 @@ void tp->len = op - outptr; outptr = op; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |