aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorFrancesco Potortì2006-07-11 11:01:27 +0000
committerFrancesco Potortì2006-07-11 11:01:27 +0000
commit327891ebb92b3af2a1377c93f851e2e4a8a70f06 (patch)
tree1e02529798c56e36886bef162fe6d49c957ae38e /lib-src
parented48e7e816fe869ad4c156e6cb6b4517e6144251 (diff)
downloademacs-327891ebb92b3af2a1377c93f851e2e4a8a70f06.tar.gz
emacs-327891ebb92b3af2a1377c93f851e2e4a8a70f06.zip
(absolute_filename): Free unused space (cosmetic change).
(in_word_set): In C, also tag #undef symbols.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/etags.c127
2 files changed, 77 insertions, 55 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 040f155221f..e792753b748 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
12006-07-10 Francesco Potort,Al(B <pot@gnu.org>
2
3 * etags.c (absolute_filename): Free unused space (cosmetic change).
4 (in_word_set): In C, also tag #undef symbols.
5
12006-06-09 Eli Zaretskii <eliz@gnu.org> 62006-06-09 Eli Zaretskii <eliz@gnu.org>
2 7
3 * yow.c: Remove file. 8 * yow.c: Remove file.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index e206443f39b..b5ff33c8b4c 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -41,7 +41,7 @@
41 * configuration file containing regexp definitions for etags. 41 * configuration file containing regexp definitions for etags.
42 */ 42 */
43 43
44char pot_etags_version[] = "@(#) pot revision number is 17.17"; 44char pot_etags_version[] = "@(#) pot revision number is 17.18";
45 45
46#define TRUE 1 46#define TRUE 1
47#define FALSE 0 47#define FALSE 0
@@ -2457,6 +2457,7 @@ extern, 0, st_C_extern
2457enum, 0, st_C_enum 2457enum, 0, st_C_enum
2458typedef, 0, st_C_typedef 2458typedef, 0, st_C_typedef
2459define, 0, st_C_define 2459define, 0, st_C_define
2460undef, 0, st_C_define
2460operator, C_PLPL, st_C_operator 2461operator, C_PLPL, st_C_operator
2461template, 0, st_C_template 2462template, 0, st_C_template
2462# DEFUN used in emacs, the next three used in glibc (SYSCALL only for mach). 2463# DEFUN used in emacs, the next three used in glibc (SYSCALL only for mach).
@@ -2475,10 +2476,10 @@ and replace lines between %< and %> with its output, then:
2475/*%<*/ 2476/*%<*/
2476/* C code produced by gperf version 3.0.1 */ 2477/* C code produced by gperf version 3.0.1 */
2477/* Command-line: gperf -m 5 */ 2478/* Command-line: gperf -m 5 */
2478/* Computed positions: -k'1-2' */ 2479/* Computed positions: -k'2-3' */
2479 2480
2480struct C_stab_entry { char *name; int c_ext; enum sym_type type; }; 2481struct C_stab_entry { char *name; int c_ext; enum sym_type type; };
2481/* maximum key range = 31, duplicates = 0 */ 2482/* maximum key range = 33, duplicates = 0 */
2482 2483
2483#ifdef __GNUC__ 2484#ifdef __GNUC__
2484__inline 2485__inline
@@ -2494,34 +2495,45 @@ hash (str, len)
2494{ 2495{
2495 static unsigned char asso_values[] = 2496 static unsigned char asso_values[] =
2496 { 2497 {
2497 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2498 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2498 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2499 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2499 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2500 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2500 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2501 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2501 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2502 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2502 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2503 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2503 34, 34, 34, 34, 1, 34, 34, 34, 14, 14, 2504 35, 35, 35, 35, 35, 35, 35, 35, 35, 15,
2504 34, 34, 34, 34, 34, 34, 34, 34, 13, 34, 2505 14, 35, 35, 35, 35, 35, 35, 35, 14, 35,
2505 13, 34, 34, 12, 34, 34, 34, 34, 34, 11, 2506 35, 35, 35, 12, 13, 35, 35, 35, 35, 12,
2506 34, 34, 34, 34, 34, 8, 34, 11, 34, 12, 2507 35, 35, 35, 35, 35, 1, 35, 16, 35, 6,
2507 11, 0, 1, 34, 7, 0, 34, 34, 11, 9, 2508 23, 0, 0, 35, 22, 0, 35, 35, 5, 0,
2508 0, 4, 0, 34, 7, 4, 14, 21, 34, 15, 2509 0, 15, 1, 35, 6, 35, 8, 19, 35, 16,
2509 0, 2, 34, 34, 34, 34, 34, 34, 34, 34, 2510 4, 5, 35, 35, 35, 35, 35, 35, 35, 35,
2510 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2511 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2511 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2512 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2512 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2513 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2513 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2514 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2514 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2515 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2515 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2516 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2516 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2517 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2517 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2518 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2518 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2519 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2519 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2520 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2520 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2521 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2521 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 2522 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2522 34, 34, 34, 34, 34, 34 2523 35, 35, 35, 35, 35, 35
2523 }; 2524 };
2524 return len + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]]; 2525 register int hval = len;
2526
2527 switch (hval)
2528 {
2529 default:
2530 hval += asso_values[(unsigned char)str[2]];
2531 /*FALLTHROUGH*/
2532 case 2:
2533 hval += asso_values[(unsigned char)str[1]];
2534 break;
2535 }
2536 return hval;
2525} 2537}
2526 2538
2527static struct C_stab_entry * 2539static struct C_stab_entry *
@@ -2531,46 +2543,48 @@ in_word_set (str, len)
2531{ 2543{
2532 enum 2544 enum
2533 { 2545 {
2534 TOTAL_KEYWORDS = 31, 2546 TOTAL_KEYWORDS = 32,
2535 MIN_WORD_LENGTH = 2, 2547 MIN_WORD_LENGTH = 2,
2536 MAX_WORD_LENGTH = 15, 2548 MAX_WORD_LENGTH = 15,
2537 MIN_HASH_VALUE = 3, 2549 MIN_HASH_VALUE = 2,
2538 MAX_HASH_VALUE = 33 2550 MAX_HASH_VALUE = 34
2539 }; 2551 };
2540 2552
2541 static struct C_stab_entry wordlist[] = 2553 static struct C_stab_entry wordlist[] =
2542 { 2554 {
2543 {""}, {""}, {""}, 2555 {""}, {""},
2544 {"if", 0, st_C_ignore}, 2556 {"if", 0, st_C_ignore},
2545 {"enum", 0, st_C_enum}, 2557 {""},
2546 {"@end", 0, st_C_objend}, 2558 {"@end", 0, st_C_objend},
2547 {"extern", 0, st_C_extern}, 2559 {"union", 0, st_C_struct},
2548 {"extends", (C_JAVA & !C_PLPL), st_C_javastruct},
2549 {"for", 0, st_C_ignore},
2550 {"interface", (C_JAVA & !C_PLPL), st_C_struct},
2551 {"@protocol", 0, st_C_objprot},
2552 {"@interface", 0, st_C_objprot},
2553 {"operator", C_PLPL, st_C_operator},
2554 {"return", 0, st_C_ignore},
2555 {"friend", C_PLPL, st_C_ignore},
2556 {"import", (C_JAVA & !C_PLPL), st_C_ignore},
2557 {"@implementation",0, st_C_objimpl},
2558 {"define", 0, st_C_define}, 2560 {"define", 0, st_C_define},
2559 {"package", (C_JAVA & !C_PLPL), st_C_ignore}, 2561 {"import", (C_JAVA & !C_PLPL), st_C_ignore},
2560 {"implements", (C_JAVA & !C_PLPL), st_C_javastruct},
2561 {"namespace", C_PLPL, st_C_struct},
2562 {"domain", C_STAR, st_C_struct},
2563 {"template", 0, st_C_template}, 2562 {"template", 0, st_C_template},
2563 {"operator", C_PLPL, st_C_operator},
2564 {"@interface", 0, st_C_objprot},
2565 {"implements", (C_JAVA & !C_PLPL), st_C_javastruct},
2566 {"friend", C_PLPL, st_C_ignore},
2564 {"typedef", 0, st_C_typedef}, 2567 {"typedef", 0, st_C_typedef},
2568 {"return", 0, st_C_ignore},
2569 {"@implementation",0, st_C_objimpl},
2570 {"@protocol", 0, st_C_objprot},
2571 {"interface", (C_JAVA & !C_PLPL), st_C_struct},
2572 {"extern", 0, st_C_extern},
2573 {"extends", (C_JAVA & !C_PLPL), st_C_javastruct},
2565 {"struct", 0, st_C_struct}, 2574 {"struct", 0, st_C_struct},
2575 {"domain", C_STAR, st_C_struct},
2566 {"switch", 0, st_C_ignore}, 2576 {"switch", 0, st_C_ignore},
2567 {"union", 0, st_C_struct}, 2577 {"enum", 0, st_C_enum},
2568 {"while", 0, st_C_ignore}, 2578 {"for", 0, st_C_ignore},
2579 {"namespace", C_PLPL, st_C_struct},
2569 {"class", 0, st_C_class}, 2580 {"class", 0, st_C_class},
2581 {"while", 0, st_C_ignore},
2582 {"undef", 0, st_C_define},
2583 {"package", (C_JAVA & !C_PLPL), st_C_ignore},
2570 {"__attribute__", 0, st_C_attribute}, 2584 {"__attribute__", 0, st_C_attribute},
2571 {"SYSCALL", 0, st_C_gnumacro}, 2585 {"SYSCALL", 0, st_C_gnumacro},
2572 {"PSEUDO", 0, st_C_gnumacro},
2573 {"ENTRY", 0, st_C_gnumacro}, 2586 {"ENTRY", 0, st_C_gnumacro},
2587 {"PSEUDO", 0, st_C_gnumacro},
2574 {"DEFUN", 0, st_C_gnumacro} 2588 {"DEFUN", 0, st_C_gnumacro}
2575 }; 2589 };
2576 2590
@@ -6786,8 +6800,11 @@ absolute_filename (file, dir)
6786 slashp = etags_strchr (slashp + 1, '/'); 6800 slashp = etags_strchr (slashp + 1, '/');
6787 } 6801 }
6788 6802
6789 if (res[0] == '\0') 6803 if (res[0] == '\0') /* just a safety net: should never happen */
6790 return savestr ("/"); 6804 {
6805 free (res);
6806 return savestr ("/");
6807 }
6791 else 6808 else
6792 return res; 6809 return res;
6793} 6810}