[Mesa-dev] [PATCH 2/5] util/hash: Silence unused parameter warnings in tests
Ian Romanick
idr at freedesktop.org
Fri Feb 13 12:52:35 PST 2015
From: Ian Romanick <ian.d.romanick at intel.com>
delete_and_lookup.c:37:21: warning: unused parameter ‘key’ [-Wunused-parameter]
badhash(const void *key)
^
delete_and_lookup.c:43:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
main(int argc, char **argv)
^
delete_and_lookup.c:43:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
main(int argc, char **argv)
^
collision.c:34:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
main(int argc, char **argv)
^
collision.c:34:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
main(int argc, char **argv)
^
destroy_callback.c:50:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
main(int argc, char **argv)
^
destroy_callback.c:50:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
main(int argc, char **argv)
^
insert_many.c:46:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
main(int argc, char **argv)
^
insert_many.c:46:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
main(int argc, char **argv)
^
insert_and_lookup.c:34:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
main(int argc, char **argv)
^
insert_and_lookup.c:34:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
main(int argc, char **argv)
^
null_destroy.c:32:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
main(int argc, char **argv)
^
null_destroy.c:32:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
main(int argc, char **argv)
^
random_entry.c:52:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
main(int argc, char **argv)
^
random_entry.c:52:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
main(int argc, char **argv)
^
remove_null.c:34:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
main(int argc, char **argv)
^
remove_null.c:34:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
main(int argc, char **argv)
^
replacement.c:34:10: warning: unused parameter ‘argc’ [-Wunused-parameter]
main(int argc, char **argv)
^
replacement.c:34:23: warning: unused parameter ‘argv’ [-Wunused-parameter]
main(int argc, char **argv)
^
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/util/tests/hash_table/collision.c | 3 +++
src/util/tests/hash_table/delete_and_lookup.c | 4 ++++
src/util/tests/hash_table/delete_management.c | 3 +++
src/util/tests/hash_table/destroy_callback.c | 3 +++
src/util/tests/hash_table/insert_and_lookup.c | 3 +++
src/util/tests/hash_table/insert_many.c | 3 +++
src/util/tests/hash_table/null_destroy.c | 3 +++
src/util/tests/hash_table/random_entry.c | 3 +++
src/util/tests/hash_table/replacement.c | 3 +++
9 files changed, 28 insertions(+)
diff --git a/src/util/tests/hash_table/collision.c b/src/util/tests/hash_table/collision.c
index a2210c3..69a4c29 100644
--- a/src/util/tests/hash_table/collision.c
+++ b/src/util/tests/hash_table/collision.c
@@ -41,6 +41,9 @@ main(int argc, char **argv)
uint32_t bad_hash = 5;
int i;
+ (void) argc;
+ (void) argv;
+
ht = _mesa_hash_table_create(NULL, NULL, _mesa_key_string_equal);
/* Insert some items. Inserting 3 items forces a rehash and the new
diff --git a/src/util/tests/hash_table/delete_and_lookup.c b/src/util/tests/hash_table/delete_and_lookup.c
index be54631..4f70509 100644
--- a/src/util/tests/hash_table/delete_and_lookup.c
+++ b/src/util/tests/hash_table/delete_and_lookup.c
@@ -36,6 +36,7 @@
static uint32_t
badhash(const void *key)
{
+ (void) key;
return 1;
}
@@ -47,6 +48,9 @@ main(int argc, char **argv)
const char *str2 = "test2";
struct hash_entry *entry;
+ (void) argc;
+ (void) argv;
+
ht = _mesa_hash_table_create(NULL, badhash, _mesa_key_string_equal);
_mesa_hash_table_insert(ht, str1, NULL);
diff --git a/src/util/tests/hash_table/delete_management.c b/src/util/tests/hash_table/delete_management.c
index 0a6bec3..1adddc9 100644
--- a/src/util/tests/hash_table/delete_management.c
+++ b/src/util/tests/hash_table/delete_management.c
@@ -51,6 +51,9 @@ main(int argc, char **argv)
uint32_t keys[size];
uint32_t i;
+ (void) argc;
+ (void) argv;
+
ht = _mesa_hash_table_create(NULL, key_value, uint32_t_key_equals);
for (i = 0; i < size; i++) {
diff --git a/src/util/tests/hash_table/destroy_callback.c b/src/util/tests/hash_table/destroy_callback.c
index 79b4fda..1c18ca3 100644
--- a/src/util/tests/hash_table/destroy_callback.c
+++ b/src/util/tests/hash_table/destroy_callback.c
@@ -51,6 +51,9 @@ main(int argc, char **argv)
{
struct hash_table *ht;
+ (void) argc;
+ (void) argv;
+
ht = _mesa_hash_table_create(NULL, _mesa_key_hash_string,
_mesa_key_string_equal);
diff --git a/src/util/tests/hash_table/insert_and_lookup.c b/src/util/tests/hash_table/insert_and_lookup.c
index 0705b07..98e719f 100644
--- a/src/util/tests/hash_table/insert_and_lookup.c
+++ b/src/util/tests/hash_table/insert_and_lookup.c
@@ -38,6 +38,9 @@ main(int argc, char **argv)
const char *str2 = "test2";
struct hash_entry *entry;
+ (void) argc;
+ (void) argv;
+
ht = _mesa_hash_table_create(NULL, _mesa_key_hash_string,
_mesa_key_string_equal);
diff --git a/src/util/tests/hash_table/insert_many.c b/src/util/tests/hash_table/insert_many.c
index c6c0591..f2497e0 100644
--- a/src/util/tests/hash_table/insert_many.c
+++ b/src/util/tests/hash_table/insert_many.c
@@ -51,6 +51,9 @@ main(int argc, char **argv)
uint32_t keys[size];
uint32_t i;
+ (void) argc;
+ (void) argv;
+
ht = _mesa_hash_table_create(NULL, key_value, uint32_t_key_equals);
for (i = 0; i < size; i++) {
diff --git a/src/util/tests/hash_table/null_destroy.c b/src/util/tests/hash_table/null_destroy.c
index 3833464..2b4caf5 100644
--- a/src/util/tests/hash_table/null_destroy.c
+++ b/src/util/tests/hash_table/null_destroy.c
@@ -31,6 +31,9 @@
int
main(int argc, char **argv)
{
+ (void) argc;
+ (void) argv;
+
_mesa_hash_table_destroy(NULL, NULL);
return 0;
diff --git a/src/util/tests/hash_table/random_entry.c b/src/util/tests/hash_table/random_entry.c
index 4a79181..d3034df 100644
--- a/src/util/tests/hash_table/random_entry.c
+++ b/src/util/tests/hash_table/random_entry.c
@@ -57,6 +57,9 @@ main(int argc, char **argv)
uint32_t keys[size];
uint32_t i, random_value;
+ (void) argc;
+ (void) argv;
+
ht = _mesa_hash_table_create(NULL, key_value, uint32_t_key_equals);
for (i = 0; i < size; i++) {
diff --git a/src/util/tests/hash_table/replacement.c b/src/util/tests/hash_table/replacement.c
index 01ede68..58c22ae 100644
--- a/src/util/tests/hash_table/replacement.c
+++ b/src/util/tests/hash_table/replacement.c
@@ -38,6 +38,9 @@ main(int argc, char **argv)
char *str2 = strdup("test1");
struct hash_entry *entry;
+ (void) argc;
+ (void) argv;
+
assert(str1 != str2);
ht = _mesa_hash_table_create(NULL, _mesa_key_hash_string,
--
2.1.0
More information about the mesa-dev
mailing list