[libsigc++2] Remove unused parameter names for correctness



commit 574deef695a24b0ad494c4a60a24acdb92edcf6e
Author: Daniel Elstner <daniel kitta gmail com>
Date:   Sun Aug 16 14:41:58 2009 +0200

    Remove unused parameter names for correctness
    
    * tests/test_copy_invalid_slot.cc, tests/test_custom.cc,
    tests/test_deduce_result_type.cc, tests/test_functor_trait.cc,
    tests/test_limit_reference.cc: Remove the names of unused function
    parameters from the prototype, in order to get libsigc++ to build
    with fatal compiler warnings.

 ChangeLog                        |   10 ++++++++++
 tests/test_copy_invalid_slot.cc  |    4 ++--
 tests/test_custom.cc             |    6 +-----
 tests/test_deduce_result_type.cc |   14 +++++++++-----
 tests/test_functor_trait.cc      |   23 ++++++++++++++---------
 tests/test_limit_reference.cc    |    7 ++++++-
 6 files changed, 42 insertions(+), 22 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a41fb88..345892c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2009-08-16  Daniel Elstner  <daniel kitta gmail com>
 
+	Remove unused parameter names for correctness
+
+	* tests/test_copy_invalid_slot.cc, tests/test_custom.cc,
+	tests/test_deduce_result_type.cc, tests/test_functor_trait.cc,
+	tests/test_limit_reference.cc: Remove the names of unused function
+	parameters from the prototype, in order to get libsigc++ to build
+	with fatal compiler warnings.
+
+2009-08-16  Daniel Elstner  <daniel kitta gmail com>
+
 	Rename scripts/ to build/ for consistency
 
 	* build/: Rename directory from scripts/ for consistency with most
diff --git a/tests/test_copy_invalid_slot.cc b/tests/test_copy_invalid_slot.cc
index e63b73a..96547f0 100644
--- a/tests/test_copy_invalid_slot.cc
+++ b/tests/test_copy_invalid_slot.cc
@@ -6,9 +6,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-void Foo(sigc::trackable &t) {}
+static void Foo(sigc::trackable&) {}
 
-int main(int argc, char **argv)
+int main(int, char**)
 {
    sigc::trackable *t = new sigc::trackable();
    std::cout << "sigc::trackable instance at " << t << std::endl;
diff --git a/tests/test_custom.cc b/tests/test_custom.cc
index 72bb5ed..93164f9 100644
--- a/tests/test_custom.cc
+++ b/tests/test_custom.cc
@@ -4,11 +4,7 @@
 
 #include <sigc++/sigc++.h>
 
-
-
-int main(int argc, char **argv)
+int main(int, char**)
 {
-  
-
   return 0;
 }
diff --git a/tests/test_deduce_result_type.cc b/tests/test_deduce_result_type.cc
index c963dd4..c6d52c0 100644
--- a/tests/test_deduce_result_type.cc
+++ b/tests/test_deduce_result_type.cc
@@ -4,22 +4,24 @@
  */
 
 #include <iostream>
-//#include <sigc++/adaptors/deduce_result_type.h>
 #include <sigc++/sigc++.h>
 
 SIGC_USING_STD(cout)
 SIGC_USING_STD(endl)
 
+namespace
+{
+
 template <class T>
-void bar(T t)
+void bar(T)
 { std::cout << "unknown" << std::endl; }
 
 template <>
-void bar<int>(int i)
+void bar<int>(int)
 { std::cout << "int" << std::endl; }
 
 template <>
-void bar<double>(double d)
+void bar<double>(double)
 { std::cout << "double" << std::endl; }
 
 struct foo : public sigc::functor_base
@@ -32,7 +34,9 @@ struct foo : public sigc::functor_base
 struct foo2 :public foo
 {};
 
-int main()
+} // anonymous namespace
+
+int main(int, char**)
 {
   bar(sigc::deduce_result_type<foo2,long>::type());
   bar(sigc::deduce_result_type<foo2,int,int>::type());
diff --git a/tests/test_functor_trait.cc b/tests/test_functor_trait.cc
index 8db538f..3a0fb0b 100644
--- a/tests/test_functor_trait.cc
+++ b/tests/test_functor_trait.cc
@@ -12,6 +12,9 @@
 SIGC_USING_STD(cout)
 SIGC_USING_STD(endl)
 
+namespace
+{
+
 class trackable {};
 struct A: public trackable { A() {} };
 
@@ -21,18 +24,18 @@ struct with_trackable;
 template <class T_type>
 struct with_trackable<T_type,false>
 {
-  static void perform(const T_type& t) 
+  static void perform(const T_type&)
   { std::cout << "other" <<std::endl; }
 };
 
 template <class T_type>
 struct with_trackable<T_type,true>
 {
-  static void perform(const T_type& t) 
+  static void perform(const T_type&)
   { std::cout << "trackable" << std::endl; }
-  static void perform(T_type* t) 
+  static void perform(T_type*)
   { std::cout << "trackable*" << std::endl; }
-  static void perform(const T_type* t) 
+  static void perform(const T_type*)
   { std::cout << "const trackable*" << std::endl; }
 };
 
@@ -45,20 +48,22 @@ struct print
     { with_trackable<T>::perform(t); }
 };
 
-void foo(int i,int j,int k)
+void foo(int, int, int)
 {}
 
-void bar(int i)
+void bar(int)
 {}
 
-int main()
+} // anonymous namespace
+
+int main(int, char**)
 {
   int i = 1, j = 2, k = 3;
   A a;
   std::cout << "hit all targets" << std::endl;
-  sigc::visit_each(print(), sigc::compose(sigc::bind(sigc::ptr_fun3(&foo), sigc::ref(a), j), sigc::ptr_fun1(&bar)));
+  sigc::visit_each(print(), sigc::compose(sigc::bind(sigc::ptr_fun3(&foo), sigc::ref(a), i), sigc::ptr_fun1(&bar)));
   std::cout << "hit all ints" << std::endl;
   sigc::visit_each_type<int>(print(), sigc::compose(sigc::bind(sigc::ptr_fun3(&foo), sigc::ref(a), j),sigc::ptr_fun1(&bar)));
   std::cout << "hit all trackable" << std::endl;
-  sigc::visit_each_type<trackable>(print(), sigc::compose(sigc::bind(sigc::ptr_fun3(&foo), sigc::ref(a), j),sigc::ptr_fun1(&bar)));
+  sigc::visit_each_type<trackable>(print(), sigc::compose(sigc::bind(sigc::ptr_fun3(&foo), sigc::ref(a), k),sigc::ptr_fun1(&bar)));
 }
diff --git a/tests/test_limit_reference.cc b/tests/test_limit_reference.cc
index 4e77404..5df3e71 100644
--- a/tests/test_limit_reference.cc
+++ b/tests/test_limit_reference.cc
@@ -1,5 +1,8 @@
 #include <sigc++/sigc++.h>
 
+namespace
+{
+
 class Base
   : virtual public sigc::trackable
 {
@@ -21,7 +24,9 @@ public:
   {}
 };
 
-int main(int argc, char **argv)
+} // anonymous namespace
+
+int main(int, char**)
 {
   Derived *instance = new Derived();
   sigc::slot<void> handler = sigc::mem_fun(instance, &Derived::method);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]