diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-04-10 17:05:14 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-04-10 17:05:14 +0000 |
commit | 4d464cc2be15c32931f0394ac8fc439497743b23 (patch) | |
tree | 8e432463706c07c25ba701579301533ce1ac27f9 /soltools | |
parent | INTEGRATION: CWS changefileheader (1.3.142); FILE MERGED (diff) | |
download | core-4d464cc2be15c32931f0394ac8fc439497743b23.tar.gz core-4d464cc2be15c32931f0394ac8fc439497743b23.zip |
INTEGRATION: CWS changefileheader (1.5.36); FILE MERGED
2008/04/01 09:43:43 thb 1.5.36.1: #i73081# Improve mkdepends runtime complexity by using better data structures (fix from kendy, merged from incguards01)
Diffstat (limited to 'soltools')
-rw-r--r-- | soltools/mkdepend/def.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/soltools/mkdepend/def.h b/soltools/mkdepend/def.h index 1dc96933f6b4..f7d931cdde91 100644 --- a/soltools/mkdepend/def.h +++ b/soltools/mkdepend/def.h @@ -63,7 +63,8 @@ in this Software without prior written authorization from the X Consortium. #define MAXFILES 2048 /* Increased from 512. -mcafee */ /* Increased from 1024. -mh */ #define MAXDIRS 64 -#define SYMTABINC 10 /* must be > 1 for define() to work right */ +#define SYMHASHSEED 131 /* 131 1313 13131 ... */ +#define SYMHASHMEMBERS 64 /* must be 2^x to work right */ #define TRUE 1 #define FALSE 0 @@ -110,9 +111,14 @@ extern int _debugmask; typedef unsigned char boolean; -struct symtab { - char *s_name; - char *s_value; +struct pair { + char *p_name; + char *p_value; + struct pair *p_next; +}; + +struct symhash { + struct pair *s_pairs[SYMHASHMEMBERS]; }; struct inclist { @@ -120,9 +126,6 @@ struct inclist { char *i_file; /* path name of the include file */ struct inclist **i_list; /* list of files it itself includes */ int i_listlen; /* length of i_list */ - struct symtab *i_defs; /* symbol table for this file */ - int i_ndefs; /* current # defines */ - int i_deflen; /* amount of space in table */ boolean i_defchecked; /* whether defines have been checked */ boolean i_notified; /* whether we have revealed includes */ boolean i_marked; /* whether it's in the makefile */ @@ -152,13 +155,16 @@ char *realloc(); char *copy(); char *base_name(); char *getline(); -struct symtab *slookup(); -struct symtab *isdefined(); -struct symtab *fdefined(); +char *isdefined(); struct filepointer *getfile(); struct inclist *newinclude(); struct inclist *inc_path(); +void define( char *def, struct symhash **symbols ); +void hash_define(char *name, char * val, struct symhash **symbols); +struct symhash *hash_copy( struct symhash *symbols ); +void hash_free( struct symhash *symbols ); + #if NeedVarargsPrototypes extern fatalerr(char *, ...); extern warning(char *, ...); |