# HG changeset patch # User Ryan C. Gordon # Date 1235110544 18000 # Node ID 29447167fc683753853559e3b93e0c3cdb95c697 # Parent e85587e4650d791c3b459680e60e3b3cb01a5e24 Renamed DefineHash to Define. diff -r e85587e4650d -r 29447167fc68 mojoshader_preprocessor.c --- a/mojoshader_preprocessor.c Fri Feb 20 01:15:24 2009 -0500 +++ b/mojoshader_preprocessor.c Fri Feb 20 01:15:44 2009 -0500 @@ -27,12 +27,12 @@ #define preprocessor_lexer(s) debug_preprocessor_lexer(s) #endif -typedef struct DefineHash +typedef struct Define { const char *identifier; const char *definition; - struct DefineHash *next; -} DefineHash; + struct Define *next; +} Define; // Simple linked list to cache source filenames, so we don't have to copy @@ -51,8 +51,8 @@ Conditional *conditional_pool; IncludeState *include_stack; IncludeState *include_pool; - DefineHash *define_hashtable[256]; - DefineHash *define_pool; + Define *define_hashtable[256]; + Define *define_pool; FilenameCache *filename_cache; MOJOSHADER_includeOpen open_callback; MOJOSHADER_includeClose close_callback; @@ -372,7 +372,7 @@ IMPLEMENT_POOL(Conditional, conditional) IMPLEMENT_POOL(IncludeState, include) -IMPLEMENT_POOL(DefineHash, define) +IMPLEMENT_POOL(Define, define) // Preprocessor define hashtable stuff... @@ -391,7 +391,7 @@ char *identifier = NULL; char *definition = NULL; const unsigned char hash = hash_define(sym); - DefineHash *bucket = ctx->define_hashtable[hash]; + Define *bucket = ctx->define_hashtable[hash]; while (bucket) { if (strcmp(bucket->identifier, sym) == 0) @@ -437,8 +437,8 @@ static int remove_define(Context *ctx, const char *sym) { const unsigned char hash = hash_define(sym); - DefineHash *bucket = ctx->define_hashtable[hash]; - DefineHash *prev = NULL; + Define *bucket = ctx->define_hashtable[hash]; + Define *prev = NULL; while (bucket) { if (strcmp(bucket->identifier, sym) == 0) @@ -463,7 +463,7 @@ static const char *find_define(Context *ctx, const char *sym) { const unsigned char hash = hash_define(sym); - DefineHash *bucket = ctx->define_hashtable[hash]; + Define *bucket = ctx->define_hashtable[hash]; while (bucket) { if (strcmp(bucket->identifier, sym) == 0) @@ -479,11 +479,11 @@ int i; for (i = 0; i < STATICARRAYLEN(ctx->define_hashtable); i++) { - DefineHash *bucket = ctx->define_hashtable[i]; + Define *bucket = ctx->define_hashtable[i]; ctx->define_hashtable[i] = NULL; while (bucket) { - DefineHash *next = bucket->next; + Define *next = bucket->next; Free(ctx, (void *) bucket->identifier); Free(ctx, (void *) bucket->definition); put_define(ctx, bucket);