Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

Commit 6aa6e6f8 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'fix-warnings-20171117'

52207e5d vtkPythonInteractiveInterpreter: remove const casting
58d92513 Merge branch 'upstream-utf8' into HEAD
503e86c9

 utf8 2017-11-22 (e8de6037)
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Brad King's avatarBrad King <brad.king@kitware.com>
Merge-request: !3588
parents e98068da 52207e5d
......@@ -8,3 +8,4 @@ another source tree.
* Rename the namespace to not conflict with external copies.
* Add `.gitattributes` to pass VTK's commit checks.
* Fix shadowing warnings.
* Use `noexcept` rather than `throw()` to avoid warnings in VTK.
......@@ -31,6 +31,18 @@ DEALINGS IN THE SOFTWARE.
#include "core.h"
#include <stdexcept>
#if __cplusplus >= 201103L
#define VTKUTF8_NOEXCEPT noexcept
#elif defined(_MSC_VER)
#if _MSC_VER >= 1900
#define VTKUTF8_NOEXCEPT noexcept
#else
#define VTKUTF8_NOEXCEPT throw()
#endif
#else
#define VTKUTF8_NOEXCEPT throw()
#endif
namespace vtk_utf8
{
// Base for the exceptions that may be thrown from the library
......@@ -42,7 +54,7 @@ namespace vtk_utf8
uint32_t cp;
public:
invalid_code_point(uint32_t _cp) : cp(_cp) {}
virtual const char* what() const throw() { return "Invalid code point"; }
virtual const char* what() const VTKUTF8_NOEXCEPT { return "Invalid code point"; }
uint32_t code_point() const {return cp;}
};
......@@ -50,7 +62,7 @@ namespace vtk_utf8
uint8_t u8;
public:
invalid_utf8 (uint8_t u) : u8(u) {}
virtual const char* what() const throw() { return "Invalid UTF-8"; }
virtual const char* what() const VTKUTF8_NOEXCEPT { return "Invalid UTF-8"; }
uint8_t utf8_octet() const {return u8;}
};
......@@ -58,13 +70,13 @@ namespace vtk_utf8
uint16_t u16;
public:
invalid_utf16 (uint16_t u) : u16(u) {}
virtual const char* what() const throw() { return "Invalid UTF-16"; }
virtual const char* what() const VTKUTF8_NOEXCEPT { return "Invalid UTF-16"; }
uint16_t utf16_word() const {return u16;}
};
class not_enough_room : public exception {
public:
virtual const char* what() const throw() { return "Not enough space"; }
virtual const char* what() const VTKUTF8_NOEXCEPT { return "Not enough space"; }
};
/// The library API - functions intended to be called by the users
......
......@@ -79,7 +79,7 @@ public:
PyRun_SimpleString(const_cast<char*>(code));
// Now get the reference to __vtkConsole and save the pointer.
PyObject* main_module = PyImport_AddModule((char*)"__main__");
PyObject* main_module = PyImport_AddModule("__main__");
PyObject* global_dict = PyModule_GetDict(main_module);
this->InteractiveConsole = PyDict_GetItemString(global_dict, "__vtkConsole");
this->InteractiveConsoleLocals = PyDict_GetItemString(global_dict, "__vtkConsoleLocals");
......@@ -193,7 +193,7 @@ bool vtkPythonInteractiveInterpreter::Push(const char* const code)
if (res)
{
int status = 0;
if (PyArg_Parse(res, (char*)"i", &status))
if (PyArg_Parse(res, "i", &status))
{
ret_value = (status > 0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment