[Zope-Checkins] CVS: Zope2 - ExtensionClass.c:1.42.4.2

Brian Lloyd brian@digiciool.com
Wed, 14 Mar 2001 13:54:04 -0500 (EST)


Update of /cvs-repository/Zope2/lib/Components/ExtensionClass/src
In directory korak:/home/brian/temp/zope-23-branch/lib/Components/ExtensionClass/src

Modified Files:
      Tag: zope-2_3-branch
	ExtensionClass.c 
Log Message:
merged EC warning fixes from head



--- Updated File ExtensionClass.c in package Zope2 --
--- ExtensionClass.c	2001/01/25 21:30:40	1.42.4.1
+++ ExtensionClass.c	2001/03/14 18:54:04	1.42.4.2
@@ -184,7 +184,7 @@
   if (! args && PyErr_Occurred()) return NULL;
   UNLESS(name=PyObject_GetAttr(self,name)) return NULL;
   ASSIGN(name,PyEval_CallObjectWithKeywords(name,args,kw));
-  if (args) Py_DECREF(args);
+  if (args) { Py_DECREF(args); }
   return name;
 }
 
@@ -607,11 +607,12 @@
 	{
 	  ASSIGN(r, PyObject_GetAttr(r, oname));
 
-	  if (r)
+	  if (r) {
 	    if (UnboundCMethod_Check(r))
 	      ASSIGN(r, (PyObject*)bindCMethod((CMethod*)r, self->self));
 	    else if (UnboundPMethod_Check(r))
 	      ASSIGN(r, bindPMethod((PMethod*)r, self->self));
+	  }
 	}
       Py_DECREF(oname);
       return r;
@@ -921,11 +922,12 @@
 	    {
 	      ASSIGN(r, PyObject_GetAttr(r, oname));
       
-	      if (r)
+	      if (r) {
 		if (UnboundCMethod_Check(r))
 		  ASSIGN(r, (PyObject*)bindCMethod((CMethod*)r, self->self));
 		else if (UnboundPMethod_Check(r))
 		  ASSIGN(r, bindPMethod((PMethod*)r, self->self));
+	      }
 	    }
 	  Py_DECREF(oname);
 	  return r;
@@ -1080,7 +1082,6 @@
 delsetattr_by_name(PyObject *self, PyObject *args, PyTypeObject *ob_type)
 {
   char *name;
-  PyObject *v;
   UNLESS(PyArg_ParseTuple(args,"s",&name)) return NULL;
   UNLESS(-1 != ob_type->tp_setattr(self,name,NULL)) return NULL;
   Py_INCREF(Py_None);
@@ -1110,7 +1111,6 @@
 delsetattro_by_name(PyObject *self, PyObject *args, PyTypeObject *ob_type)
 {
   PyObject *name;
-  PyObject *v;
   UNLESS(PyArg_ParseTuple(args,"O",&name)) return NULL;
   UNLESS(-1 != ob_type->tp_setattro(self,name,NULL)) return NULL;
   Py_INCREF(Py_None);
@@ -1661,7 +1661,9 @@
       
       Py_DECREF(self->bases);
     }
-  if (((PyExtensionClass*)self->ob_type) != self) Py_XDECREF(self->ob_type);
+  if (((PyExtensionClass*)self->ob_type) != self) {
+      Py_XDECREF(self->ob_type);
+  }
   PyMem_DEL(self);
 }
   
@@ -3066,7 +3068,9 @@
       return; /* we added a reference; don't delete now */
     }
   
-  if (HasInstDict(self)) Py_XDECREF(INSTANCE_DICT(self));
+  if (HasInstDict(self)) {
+      Py_XDECREF(INSTANCE_DICT(self));
+  }
 
   /* See if there was a dealloc handler in a (C) base class.
      If there was, then it deallocates the object and we
@@ -3340,8 +3344,6 @@
 	 That means that we simply copy the base class 
 	 get/setattr.
       */
-      PyObject *r;
-
       copy_member(tp_getattr);
       copy_member(tp_getattro);
       copy_member(tp_setattr);