[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] set up reserved word table before using isCpp
From: |
Shigio Yamaguchi |
Subject: |
Re: [PATCH] set up reserved word table before using isCpp |
Date: |
Thu, 27 Mar 2003 00:44:40 +0900 |
> Since isCpp is called before inittable, isCpp does not work correctly.
> I also moved setup of other languages for consistency.
Fixed.
But I have fixed the bug in another way because I would like to
hide language specific part from main().
Anyway, thank you!
Index: Cpp.c
===================================================================
RCS file: /cvsroot/global/global/gctags/Cpp.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -c -r1.31 -r1.32
*** Cpp.c 25 Mar 2003 13:01:47 -0000 1.31
--- Cpp.c 26 Mar 2003 15:37:01 -0000 1.32
***************
*** 759,765 ****
static void
inittable()
{
! qsort(words, sizeof(words)/sizeof(struct words), sizeof(struct words),
cmp);
}
static int
reserved(word)
--- 759,770 ----
static void
inittable()
{
! static int done = 0;
!
! if (done == 0) {
! qsort(words, sizeof(words)/sizeof(struct words), sizeof(struct
words), cmp);
! done = 1;
! }
}
static int
reserved(word)
***************
*** 782,787 ****
--- 787,797 ----
int Cpp = 0;
cmode = 1; /* allow token like '#xxx' */
cppmode = 1; /* treat '::' as a token */
+
+ /*
+ * set up reserved word table.
+ */
+ inittable();
while ((cc = nexttoken(NULL, reserved)) != EOF) {
if (cc == CPP_CLASS || cc == CPP_TEMPLATE ||
--
Shigio Yamaguchi <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3