Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Patched to compile.
  • Loading branch information
icculus committed Apr 8, 2009
1 parent a6d2ae0 commit e8e9210
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mojoshader_common.c
Expand Up @@ -66,16 +66,16 @@ HashTable *hash_create(const uint32 initial_table_size,
MOJOSHADER_malloc m, MOJOSHADER_free f, void *d)
{
const uint32 alloc_len = sizeof (HashItem *) * initial_table_size;
HashTable *table = (HashTable *) m(sizeof (HashTable));
HashTable *table = (HashTable *) m(sizeof (HashTable), d);
if (table == NULL)
return 0;
return NULL;
memset(table, '\0', sizeof (HashTable));

table->table = (HashItem **) m(alloc_len, d);
if (table->table == NULL)
{
f(table, d);
return 0;
return NULL;
} // if

memset(table->table, '\0', alloc_len);
Expand All @@ -87,7 +87,7 @@ HashTable *hash_create(const uint32 initial_table_size,
table->malloc = m;
table->free = f;
table->malloc_data = d;
return 1;
return table;
} // hash_create

void hash_destroy(HashTable *table)
Expand Down

0 comments on commit e8e9210

Please sign in to comment.