Remove unused variable, fix (80, 'Other error') exceptions from ldb python bindings
authorJelmer Vernooij <jelmer@samba.org>
Sat, 1 Mar 2008 20:18:12 +0000 (21:18 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 1 Mar 2008 20:18:12 +0000 (21:18 +0100)
(This used to be commit 2303063cbd2e65580618124ef8ecf42867d2b952)

source4/lib/ldb/ldb.i
source4/lib/ldb/ldb_wrap.c

index 2c04662f255ab5e5420dfc9cd481fd778361f3be..da4c52f77831583ee794cd9f5a6ba4cbff413933 100644 (file)
@@ -548,7 +548,6 @@ PyObject *PyExc_LdbError;
 };
 
 %typemap(in,numinputs=1) ldb_msg *add_msg {
-    ldb_error ret;
     int dict_pos, msg_pos;
     PyObject *key, *value;
     ldb_msg_element *msgel;
@@ -559,7 +558,8 @@ PyObject *PyExc_LdbError;
         msg_pos = dict_pos = 0;
         while (PyDict_Next($input, &dict_pos, &key, &value)) {
             if (!strcmp(PyString_AsString(key), "dn")) {
-                if (ldb_dn_from_pyobject($1, value, $self, &$1->dn) != 0) {
+                /* using argp0 (magic SWIG value) here is a hack */
+                if (ldb_dn_from_pyobject($1, value, argp1, &$1->dn) != 0) {
                     SWIG_exception(SWIG_TypeError, "unable to import dn object");
                 }
             } else {
index 937cb7e47cb85c606a1811b83345873ad8487572..7886778b3a79238b535aa122af35a9cabcdd24fc 100644 (file)
@@ -4707,7 +4707,6 @@ SWIGINTERN PyObject *_wrap_Ldb_add(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
   }
   arg1 = (ldb *)(argp1);
   {
-    ldb_error ret;
     int dict_pos, msg_pos;
     PyObject *key, *value;
     ldb_msg_element *msgel;
@@ -4718,7 +4717,8 @@ SWIGINTERN PyObject *_wrap_Ldb_add(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
       msg_pos = dict_pos = 0;
       while (PyDict_Next(obj1, &dict_pos, &key, &value)) {
         if (!strcmp(PyString_AsString(key), "dn")) {
-          if (ldb_dn_from_pyobject(arg2, value, obj0, &arg2->dn) != 0) {
+          /* using argp0 (magic SWIG value) here is a hack */
+          if (ldb_dn_from_pyobject(arg2, value, argp1, &arg2->dn) != 0) {
             SWIG_exception(SWIG_TypeError, "unable to import dn object");
           }
         } else {