summaryrefslogtreecommitdiff
path: root/src/glsl/ir_validate.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-07-06 14:49:14 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-07-06 15:00:46 -0700
commitd1a1ee583e7e8338243b3e9768d2fc5312a1145d (patch)
treed1bada4bebfbdf7bb7dbdc6435927a7e4c0cb5ac /src/glsl/ir_validate.cpp
parente45a982313e02dbc186b51cf0935e0bec18dc61a (diff)
Add hash table helper functions for using pointers as hash keys
Diffstat (limited to 'src/glsl/ir_validate.cpp')
-rw-r--r--src/glsl/ir_validate.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 1953852487..7582d57e7c 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -36,26 +36,15 @@
#include <inttypes.h>
#include "ir.h"
#include "ir_hierarchical_visitor.h"
-extern "C" {
#include "hash_table.h"
-}
-
-static unsigned int hash_func(const void *key)
-{
- return (unsigned int)(uintptr_t)key;
-}
-
-static int hash_compare_func(const void *key1, const void *key2)
-{
- return key1 == key2 ? 0 : 1;
-}
class ir_validate : public ir_hierarchical_visitor {
public:
ir_validate()
{
- this->ht = hash_table_ctor(0, hash_func, hash_compare_func);
+ this->ht = hash_table_ctor(0, hash_table_pointer_hash,
+ hash_table_pointer_compare);
this->callback = ir_validate::validate_ir;
this->data = ht;