changeset 26:5641245dd9d2 task

Fix compiler warnings
author David Grundberg <individ@acc.umu.se>
date Sun, 03 May 2009 20:24:48 +0200
parents 113428ba033c
children c3cba408a7e6
files exceptions.h octave_to_python.h pytave.cc python_to_octave.h
diffstat 4 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/exceptions.h	Wed Apr 29 10:06:07 2009 +0200
+++ b/exceptions.h	Sun May 03 20:24:48 2009 +0200
@@ -38,8 +38,9 @@
    class octave_error_exception {
       public:
          static bool init() {
-            excclass = PyErr_NewException("pytave.OctaveError",
-                                          PyExc_RuntimeError, NULL);
+            excclass = PyErr_NewException(
+               const_cast<char*>("pytave.OctaveError"),
+               PyExc_RuntimeError, NULL);
             return excclass != NULL;
          };
          static void translate_exception(octave_error_exception const &py_ex) {
@@ -57,8 +58,9 @@
    class value_convert_exception {
       public:
          static bool init() {
-            excclass = PyErr_NewException("pytave.ValueConvertError",
-                                          PyExc_TypeError, NULL);
+            excclass = PyErr_NewException(
+               const_cast<char*>("pytave.ValueConvertError"),
+               PyExc_TypeError, NULL);
             return excclass != NULL;
          };
          static void translate_exception(value_convert_exception const &py_ex) {
@@ -75,8 +77,9 @@
    class object_convert_exception {
       public:
          static bool init() {
-            excclass = PyErr_NewException("pytave.ObjectConvertError",
-                                          PyExc_TypeError, NULL);
+            excclass = PyErr_NewException(
+               const_cast<char*>("pytave.ObjectConvertError"),
+               PyExc_TypeError, NULL);
             return excclass != NULL;
          };
          static void translate_exception(
--- a/octave_to_python.h	Wed Apr 29 10:06:07 2009 +0200
+++ b/octave_to_python.h	Sun May 03 20:24:48 2009 +0200
@@ -20,9 +20,6 @@
 #ifndef OCTAVE_TO_PYTHON_H
 #define OCTAVE_TO_PYTHON_H
 
-class octave_value_list;
-class boost::python::tuple;
-
 namespace pytave {
    void octlist_to_pytuple(boost::python::tuple &python_tuple,
                            const octave_value_list &octave_list);
--- a/pytave.cc	Wed Apr 29 10:06:07 2009 +0200
+++ b/pytave.cc	Sun May 03 20:24:48 2009 +0200
@@ -55,8 +55,11 @@
 
       // Initialize Octave.
       // Also print Octave startup message.
-      char* argv[] = {"octave", "--no-line-editing", "--no-history", NULL};
-      octave_main(3, argv, 1);
+      const char* argv[] = {"octave",
+                            "--no-line-editing",
+                            "--no-history",
+                            NULL};
+      octave_main(3, const_cast<char**>(argv), 1);
 
       // Initialize Python Numeric Array
 
@@ -112,8 +115,8 @@
                // The struct element is called "stack" but only contain
                // info about the top frame.
                Octave_map stack = stackCell(0).map_value();
-               string file = stack.stringfield("file", "d");
-               string name = stack.stringfield("name", "a");
+               string file = stack.stringfield("file", "");
+               string name = stack.stringfield("name", "");
                int line = stack.intfield("line", 1);
                int column = stack.intfield("column", 2);
 
--- a/python_to_octave.h	Wed Apr 29 10:06:07 2009 +0200
+++ b/python_to_octave.h	Sun May 03 20:24:48 2009 +0200
@@ -20,9 +20,6 @@
 #ifndef PYTHON_TO_OCTAVE_H
 #define PYTHON_TO_OCTAVE_H
 
-class octave_value_list;
-class boost::python::tuple;
-
 namespace pytave {
    void pytuple_to_octlist(octave_value_list &octave_list,
                            const boost::python::tuple &python_tuple);