s4:pycredentials: PyArg_ParseTuple("i") requires an 'int' argument.
authorStefan Metzmacher <metze@samba.org>
Mon, 8 Aug 2011 12:21:42 +0000 (14:21 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 8 Aug 2011 14:45:27 +0000 (16:45 +0200)
If we pass variable references we don't get implicit casting!

metze

source4/auth/credentials/pycredentials.c

index 5083174ba13f6b2d7455a57bfa1c3651a0538820..b77d476bb80c2dfebc31a19f45ef53c3b56ddf1a 100644 (file)
@@ -60,8 +60,12 @@ static PyObject *py_creds_set_username(py_talloc_Object *self, PyObject *args)
 {
        char *newval;
        enum credentials_obtained obt = CRED_SPECIFIED;
-       if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+       int _obt = obt;
+
+       if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
                return NULL;
+       }
+       obt = _obt;
 
        return PyBool_FromLong(cli_credentials_set_username(PyCredentials_AsCliCredentials(self), newval, obt));
 }
@@ -76,8 +80,12 @@ static PyObject *py_creds_set_password(py_talloc_Object *self, PyObject *args)
 {
        char *newval;
        enum credentials_obtained obt = CRED_SPECIFIED;
-       if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+       int _obt = obt;
+
+       if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
                return NULL;
+       }
+       obt = _obt;
 
        return PyBool_FromLong(cli_credentials_set_password(PyCredentials_AsCliCredentials(self), newval, obt));
 }
@@ -91,8 +99,12 @@ static PyObject *py_creds_set_domain(py_talloc_Object *self, PyObject *args)
 {
        char *newval;
        enum credentials_obtained obt = CRED_SPECIFIED;
-       if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+       int _obt = obt;
+
+       if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
                return NULL;
+       }
+       obt = _obt;
 
        return PyBool_FromLong(cli_credentials_set_domain(PyCredentials_AsCliCredentials(self), newval, obt));
 }
@@ -106,8 +118,12 @@ static PyObject *py_creds_set_realm(py_talloc_Object *self, PyObject *args)
 {
        char *newval;
        enum credentials_obtained obt = CRED_SPECIFIED;
-       if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+       int _obt = obt;
+
+       if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
                return NULL;
+       }
+       obt = _obt;
 
        return PyBool_FromLong(cli_credentials_set_realm(PyCredentials_AsCliCredentials(self), newval, obt));
 }
@@ -135,8 +151,12 @@ static PyObject *py_creds_set_workstation(py_talloc_Object *self, PyObject *args
 {
        char *newval;
        enum credentials_obtained obt = CRED_SPECIFIED;
-       if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+       int _obt = obt;
+
+       if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
                return NULL;
+       }
+       obt = _obt;
 
        return PyBool_FromLong(cli_credentials_set_workstation(PyCredentials_AsCliCredentials(self), newval, obt));
 }
@@ -171,8 +191,12 @@ static PyObject *py_creds_parse_string(py_talloc_Object *self, PyObject *args)
 {
        char *newval;
        enum credentials_obtained obt = CRED_SPECIFIED;
-       if (!PyArg_ParseTuple(args, "s|i", &newval, &obt))
+       int _obt = obt;
+
+       if (!PyArg_ParseTuple(args, "s|i", &newval, &_obt)) {
                return NULL;
+       }
+       obt = _obt;
 
        cli_credentials_parse_string(PyCredentials_AsCliCredentials(self), newval, obt);
        Py_RETURN_NONE;