]> sigrok.org Git - libsigrok.git/blobdiff - bindings/python/sigrok/core/classes.i
bindings: Use SR_DF_ANALOG, drop SR_DF_ANALOG_OLD support.
[libsigrok.git] / bindings / python / sigrok / core / classes.i
index be4df153080d5149b897b574cb1c5c0c109e38bd..49cfba98791443e48c7b0f4fe8d7eec246d7a873 100644 (file)
@@ -47,6 +47,7 @@ which provides access to the error code and description."
 %{
 #include <stdio.h>
 #include <pygobject.h>
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
 #include <numpy/arrayobject.h>
 
 PyObject *PyGObject_lib;
@@ -74,7 +75,7 @@ typedef guint pyg_flags_type;
     if (!GLib) {
         fprintf(stderr, "Import of gi.repository.GLib failed.\n");
 #if PY_VERSION_HEX >= 0x03000000
-        return NULL;
+        return nullptr;
 #else
         return;
 #endif
@@ -94,8 +95,7 @@ typedef guint pyg_flags_type;
     g_value_set_variant(value, $1.gobj());
     PyObject *variant = pyg_value_as_pyobject(value, true);
     $result = PyObject_CallMethod(variant,
-        const_cast<char *>("unpack"),
-        const_cast<char *>(""), NULL);
+        const_cast<char *>("unpack"), nullptr);
     Py_XDECREF(variant);
     g_free(value);
 }