Browse Source

[1258] pass unsigned int* to PyArg_ParseTuple instead of ParseOptions*.
that would be a bit type safer.

JINMEI Tatuya 13 years ago
parent
commit
aba10a01b7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/lib/dns/python/message_python.cc

+ 3 - 2
src/lib/dns/python/message_python.cc

@@ -646,7 +646,7 @@ Message_fromWire(PyObject* const pyself, PyObject* args) {
     s_Message* self = static_cast<s_Message*>(pyself);
     const char* b;
     Py_ssize_t len;
-    Message::ParseOptions options = Message::PARSE_DEFAULT;
+    unsigned int options = Message::PARSE_DEFAULT;
     if (PyArg_ParseTuple(args, "y#", &b, &len) ||
         PyArg_ParseTuple(args, "y#I", &b, &len, &options)) {
         // We need to clear the error in case the first call to ParseTuple
@@ -655,7 +655,8 @@ Message_fromWire(PyObject* const pyself, PyObject* args) {
 
         InputBuffer inbuf(b, len);
         try {
-            self->cppobj->fromWire(inbuf, options);
+            self->cppobj->fromWire(
+                inbuf, static_cast<Message::ParseOptions>(options));
             Py_RETURN_NONE;
         } catch (const InvalidMessageOperation& imo) {
             PyErr_SetString(po_InvalidMessageOperation, imo.what());