From e04b3a80b37ab06aa926b872cb19cd58c6f63336 Mon Sep 17 00:00:00 2001
From: Thomas Moulard <thomas.moulard@gmail.com>
Date: Thu, 20 Jan 2011 11:23:32 +0100
Subject: [PATCH] Fix warnings.

---
 src/dynamic-graph-py.cc | 22 ++++++++++++++------
 src/entity-py.cc        | 46 ++++++++++++++++++++---------------------
 src/factory-py.cc       | 20 +++++++++++++-----
 src/signal-base-py.cc   | 30 ++++++++++++++++++---------
 src/signal-caster-py.cc | 23 ++++++++++++++-------
 5 files changed, 88 insertions(+), 53 deletions(-)

diff --git a/src/dynamic-graph-py.cc b/src/dynamic-graph-py.cc
index e524b28..414601f 100644
--- a/src/dynamic-graph-py.cc
+++ b/src/dynamic-graph-py.cc
@@ -1,7 +1,17 @@
-/*
- *  Copyright 2010 (C) CNRS
- *  Author: Florent Lamiraux
- */
+// Copyright 2010, Florent Lamiraux, Thomas Moulard, LAAS-CNRS.
+//
+// This file is part of dynamic-graph-python.
+// dynamic-graph-python is free software: you can redistribute it
+// and/or modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation, either
+// version 3 of the License, or (at your option) any later version.
+//
+// dynamic-graph-python is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Lesser Public License for more details.  You should
+// have received a copy of the GNU Lesser General Public License along
+// with dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
 
 #include <Python.h>
 #include <iostream>
@@ -47,7 +57,7 @@ namespace dynamicgraph {
        \brief plug a signal into another one.
     */
     PyObject*
-    plug(PyObject* self, PyObject* args)
+    plug(PyObject* /*self*/, PyObject* args)
     {
       PyObject* objOut = NULL;
       PyObject* objIn = NULL;
@@ -86,7 +96,7 @@ namespace dynamicgraph {
     }
 
     PyObject*
-    enableTrace(PyObject* self, PyObject* args)
+    enableTrace(PyObject* /*self*/, PyObject* args)
     {
       PyObject* boolean;
       char* filename = NULL;
diff --git a/src/entity-py.cc b/src/entity-py.cc
index 2af926f..c28bdea 100644
--- a/src/entity-py.cc
+++ b/src/entity-py.cc
@@ -1,12 +1,20 @@
-/*
- *  Copyright 2010 (C) CNRS
- *  Author: Florent Lamiraux
- */
+// Copyright 2010, Florent Lamiraux, Thomas Moulard, LAAS-CNRS.
+//
+// This file is part of dynamic-graph-python.
+// dynamic-graph-python is free software: you can redistribute it
+// and/or modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation, either
+// version 3 of the License, or (at your option) any later version.
+//
+// dynamic-graph-python is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Lesser Public License for more details.  You should
+// have received a copy of the GNU Lesser General Public License along
+// with dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
 
 #include <Python.h>
 #include <iostream>
-//#include <sstream>
-//#include <string>
 
 #include <dynamic-graph/entity.h>
 #include <dynamic-graph/factory.h>
@@ -30,7 +38,6 @@ namespace dynamicgraph {
 
     namespace entity {
 
-      static void destroy (void* self);
       static void fillMatrixRow(Matrix& m, unsigned index,
 				PyObject* tuple);
 
@@ -42,7 +49,7 @@ namespace dynamicgraph {
       /**
 	 \brief Create an instance of Entity
       */
-      PyObject* create(PyObject* self, PyObject* args)
+      PyObject* create(PyObject* /*self*/, PyObject* args)
       {
 	char *className = NULL;
 	char *instanceName = NULL;
@@ -63,19 +70,10 @@ namespace dynamicgraph {
 	return PyCObject_FromVoidPtr((void*)obj, NULL);
       }
 
-      /**
-	 \brief Destroy an instance of Entity
-      */
-      static void destroy (void* self)
-      {
-	Entity* obj = (Entity*)self;
-	delete obj;
-      }
-
       /**
 	 \brief Get name of entity
       */
-      PyObject* getName(PyObject* self, PyObject* args)
+      PyObject* getName(PyObject* /*self*/, PyObject* args)
       {
 	PyObject* object = NULL;
 	void* pointer = NULL;
@@ -101,7 +99,7 @@ namespace dynamicgraph {
       /**
 	 \brief Get a signal by name
       */
-      PyObject* getSignal(PyObject* self, PyObject* args)
+      PyObject* getSignal(PyObject* /*self*/, PyObject* args)
       {
 	char *name = NULL;
 	PyObject* object = NULL;
@@ -128,7 +126,7 @@ namespace dynamicgraph {
 	return PyCObject_FromVoidPtr((void*)signal, NULL);
       }
 
-      PyObject* displaySignals(PyObject* self, PyObject* args)
+      PyObject* displaySignals(PyObject* /*self*/, PyObject* args)
       {
 	void* pointer = NULL;
 	PyObject* object = NULL;
@@ -152,7 +150,7 @@ namespace dynamicgraph {
 
       void fillMatrixRow(Matrix& m, unsigned iRow, PyObject* tuple)
       {
-	if (PyTuple_Size(tuple) != m.nbCols()) {
+	if (PyTuple_Size(tuple) != (int)m.nbCols()) {
 	  throw ExceptionFactory(ExceptionFactory::GENERIC,
 				 "lines of matrix have different sizes.");
 	}
@@ -357,7 +355,7 @@ namespace dynamicgraph {
 	return Py_BuildValue("");
       }
 
-      PyObject* executeCommand(PyObject* self, PyObject* args)
+      PyObject* executeCommand(PyObject* /*self*/, PyObject* args)
       {
 	PyObject* object = NULL;
 	PyObject* argTuple = NULL;
@@ -429,7 +427,7 @@ namespace dynamicgraph {
 	return NULL;
       }
 
-      PyObject* listCommands(PyObject* self, PyObject* args)
+      PyObject* listCommands(PyObject* /*self*/, PyObject* args)
       {
 	PyObject* object = NULL;
 	if (!PyArg_ParseTuple(args, "O", &object)) {
@@ -458,7 +456,7 @@ namespace dynamicgraph {
 	}
 	return result;
       }
-      PyObject* getCommandDocstring(PyObject* self, PyObject* args)
+      PyObject* getCommandDocstring(PyObject* /*self*/, PyObject* args)
       {
 	PyObject* object = NULL;
 	char* commandName;
diff --git a/src/factory-py.cc b/src/factory-py.cc
index a9bd7d9..12fbc9b 100644
--- a/src/factory-py.cc
+++ b/src/factory-py.cc
@@ -1,7 +1,17 @@
-/*
- *  Copyright 2010 (C) CNRS
- *  Author: Florent Lamiraux
- */
+// Copyright 2010, Florent Lamiraux, Thomas Moulard, LAAS-CNRS.
+//
+// This file is part of dynamic-graph-python.
+// dynamic-graph-python is free software: you can redistribute it
+// and/or modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation, either
+// version 3 of the License, or (at your option) any later version.
+//
+// dynamic-graph-python is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Lesser Public License for more details.  You should
+// have received a copy of the GNU Lesser General Public License along
+// with dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
 
 #include <Python.h>
 #include <iostream>
@@ -20,7 +30,7 @@ namespace dynamicgraph {
       /**
 	 \brief Get name of entity
       */
-      PyObject* getEntityClassList(PyObject* self, PyObject* args)
+      PyObject* getEntityClassList(PyObject* /*self*/, PyObject* args)
       {
 	if (!PyArg_ParseTuple(args, ""))
 	  return NULL;
diff --git a/src/signal-base-py.cc b/src/signal-base-py.cc
index 133c5cd..52475bf 100644
--- a/src/signal-base-py.cc
+++ b/src/signal-base-py.cc
@@ -1,7 +1,17 @@
-/*
- *  Copyright 2010 (C) CNRS
- *  Author: Florent Lamiraux
- */
+// Copyright 2010, Florent Lamiraux, Thomas Moulard, LAAS-CNRS.
+//
+// This file is part of dynamic-graph-python.
+// dynamic-graph-python is free software: you can redistribute it
+// and/or modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation, either
+// version 3 of the License, or (at your option) any later version.
+//
+// dynamic-graph-python is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Lesser Public License for more details.  You should
+// have received a copy of the GNU Lesser General Public License along
+// with dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
 
 #include <Python.h>
 #include <iostream>
@@ -24,7 +34,7 @@ namespace dynamicgraph {
       /**
 	 \brief Create an instance of SignalBase
       */
-      PyObject* create(PyObject* self, PyObject* args)
+      PyObject* create(PyObject* /*self*/, PyObject* args)
       {
 	char *name = NULL;
 
@@ -47,7 +57,7 @@ namespace dynamicgraph {
 	delete obj;
       }
 
-      PyObject* getTime(PyObject* self, PyObject* args)
+      PyObject* getTime(PyObject* /*self*/, PyObject* args)
       {
 	void* pointer = NULL;
 	PyObject* object = NULL;
@@ -63,7 +73,7 @@ namespace dynamicgraph {
 	return Py_BuildValue("i", time);
       }
 
-      PyObject* getValue(PyObject* self, PyObject* args)
+      PyObject* getValue(PyObject* /*self*/, PyObject* args)
       {
 	void* pointer = NULL;
 	PyObject* object = NULL;
@@ -91,7 +101,7 @@ namespace dynamicgraph {
 	return Py_BuildValue("s", valueString.c_str());
       }
 
-      PyObject* getName(PyObject* self, PyObject* args)
+      PyObject* getName(PyObject* /*self*/, PyObject* args)
       {
 	void* pointer = NULL;
 	PyObject* object = NULL;
@@ -118,7 +128,7 @@ namespace dynamicgraph {
 	return Py_BuildValue("s", name.c_str());
       }
 
-      PyObject* setValue(PyObject* self, PyObject* args)
+      PyObject* setValue(PyObject* /*self*/, PyObject* args)
       {
 	void * pointer = NULL;
 	PyObject* object = NULL;
@@ -151,7 +161,7 @@ namespace dynamicgraph {
 	return Py_BuildValue("");
       }
 
-      PyObject* recompute(PyObject* self, PyObject* args)
+      PyObject* recompute(PyObject* /*self*/, PyObject* args)
       {
 	void * pointer = NULL;
 	PyObject* object = NULL;
diff --git a/src/signal-caster-py.cc b/src/signal-caster-py.cc
index dfb4ed2..892094e 100644
--- a/src/signal-caster-py.cc
+++ b/src/signal-caster-py.cc
@@ -1,7 +1,17 @@
-/*
- *  Copyright 2010 (C) CNRS
- *  Author: Florent Lamiraux
- */
+// Copyright 2010, Florent Lamiraux, Thomas Moulard, LAAS-CNRS.
+//
+// This file is part of dynamic-graph-python.
+// dynamic-graph-python is free software: you can redistribute it
+// and/or modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation, either
+// version 3 of the License, or (at your option) any later version.
+//
+// dynamic-graph-python is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Lesser Public License for more details.  You should
+// have received a copy of the GNU Lesser General Public License along
+// with dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
 
 #include <Python.h>
 #include <iostream>
@@ -15,11 +25,8 @@ namespace dynamicgraph {
     extern PyObject* error;
 
     namespace signalCaster {
-      PyObject* getSignalTypeList(PyObject* self, PyObject* args)
+      PyObject* getSignalTypeList(PyObject* /*self*/, PyObject* args)
       {
-	void * pointer = NULL;
-	PyObject* object = NULL;
-
 	if (!PyArg_ParseTuple(args, ""))
 	  return NULL;
 	std::vector<std::string> typeList =
-- 
GitLab