]> sigrok.org Git - libsigrok.git/commitdiff
python: Fix PyObject_CallMethod() arguments
authorDaniel Elstner <redacted>
Sat, 10 Oct 2015 02:45:13 +0000 (04:45 +0200)
committerDaniel Elstner <redacted>
Sat, 17 Oct 2015 15:40:42 +0000 (17:40 +0200)
Pass nullptr instead of the empty string for format, and remove
the excess varargs argument. Also, avoid NULL in favor of nullptr.

bindings/python/sigrok/core/classes.i

index be4df153080d5149b897b574cb1c5c0c109e38bd..347a7e220c4dfb23cf8588ae9cb65a0c1c19c9d5 100644 (file)
@@ -74,7 +74,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 +94,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);
 }