summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_function_inlining.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-07-06 14:49:14 -0700
committerIan Romanick <[email protected]>2010-07-06 15:00:46 -0700
commitd1a1ee583e7e8338243b3e9768d2fc5312a1145d (patch)
treed1bada4bebfbdf7bb7dbdc6435927a7e4c0cb5ac /src/glsl/ir_function_inlining.cpp
parente45a982313e02dbc186b51cf0935e0bec18dc61a (diff)
Add hash table helper functions for using pointers as hash keys
Diffstat (limited to 'src/glsl/ir_function_inlining.cpp')
-rw-r--r--src/glsl/ir_function_inlining.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/glsl/ir_function_inlining.cpp b/src/glsl/ir_function_inlining.cpp
index 1adf67868ee..b3d1f1d1674 100644
--- a/src/glsl/ir_function_inlining.cpp
+++ b/src/glsl/ir_function_inlining.cpp
@@ -33,9 +33,7 @@
#include "ir_function_inlining.h"
#include "ir_expression_flattening.h"
#include "glsl_types.h"
-extern "C" {
#include "hash_table.h"
-}
class ir_function_inlining_visitor : public ir_hierarchical_visitor {
public:
@@ -60,16 +58,6 @@ public:
};
-unsigned int hash_func(const void *key)
-{
- return (unsigned int)(uintptr_t)key;
-}
-
-int hash_compare_func(const void *key1, const void *key2)
-{
- return key1 == key2 ? 0 : 1;
-}
-
bool
automatic_inlining_predicate(ir_instruction *ir)
{
@@ -124,7 +112,7 @@ ir_call::generate_inline(ir_instruction *next_ir)
ir_variable *retval = NULL;
struct hash_table *ht;
- ht = hash_table_ctor(0, hash_func, hash_compare_func);
+ ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
num_parameters = 0;
foreach_iter(exec_list_iterator, iter_sig, this->callee->parameters)