Commit 982055e6 authored by Jeremy Hylton's avatar Jeremy Hylton

Consistent formatting.

parent 4a6f51c1
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
static char cPersistence_doc_string[] = static char cPersistence_doc_string[] =
"Defines Persistent mixin class for persistent objects.\n" "Defines Persistent mixin class for persistent objects.\n"
"\n" "\n"
"$Id: cPersistence.c,v 1.79 2004/03/02 20:22:16 jeremy Exp $\n"; "$Id: cPersistence.c,v 1.80 2004/03/13 07:42:06 jeremy Exp $\n";
#include "cPersistence.h" #include "cPersistence.h"
#include "structmember.h" #include "structmember.h"
...@@ -648,7 +648,7 @@ Per_getattro(cPersistentObject *self, PyObject *name) ...@@ -648,7 +648,7 @@ Per_getattro(cPersistentObject *self, PyObject *name)
goto Done; goto Done;
s = PyString_AS_STRING(name); s = PyString_AS_STRING(name);
if (*s != '_' || unghost_getattr(s)) { if (unghost_getattr(s)) {
if (unghostify(self) < 0) if (unghostify(self) < 0)
goto Done; goto Done;
accessed(self); accessed(self);
...@@ -672,15 +672,14 @@ Per__p_getattr(cPersistentObject *self, PyObject *name) ...@@ -672,15 +672,14 @@ Per__p_getattr(cPersistentObject *self, PyObject *name)
goto Done; goto Done;
s = PyString_AS_STRING(name); s = PyString_AS_STRING(name);
if (*s != '_' || unghost_getattr(s)) if (*s != '_' || unghost_getattr(s)) {
{
if (unghostify(self) < 0) if (unghostify(self) < 0)
goto Done; goto Done;
accessed(self); accessed(self);
result = Py_False; result = Py_False;
} }
else else
result = Py_True; result = Py_True;
Py_INCREF(result); Py_INCREF(result);
...@@ -733,20 +732,18 @@ Per_p_set_or_delattro(cPersistentObject *self, PyObject *name, PyObject *v) ...@@ -733,20 +732,18 @@ Per_p_set_or_delattro(cPersistentObject *self, PyObject *name, PyObject *v)
goto Done; goto Done;
s = PyString_AS_STRING(name); s = PyString_AS_STRING(name);
if (strncmp(s, "_p_", 3) != 0) if (strncmp(s, "_p_", 3)) {
{
if (unghostify(self) < 0) if (unghostify(self) < 0)
goto Done; goto Done;
accessed(self); accessed(self);
result = 0; result = 0;
} }
else else {
{
if (PyObject_GenericSetAttr((PyObject *)self, name, v) < 0) if (PyObject_GenericSetAttr((PyObject *)self, name, v) < 0)
goto Done; goto Done;
result = 1; result = 1;
} }
Done: Done:
Py_XDECREF(name); Py_XDECREF(name);
...@@ -756,34 +753,34 @@ Per_p_set_or_delattro(cPersistentObject *self, PyObject *name, PyObject *v) ...@@ -756,34 +753,34 @@ Per_p_set_or_delattro(cPersistentObject *self, PyObject *name, PyObject *v)
static PyObject * static PyObject *
Per__p_setattr(cPersistentObject *self, PyObject *args) Per__p_setattr(cPersistentObject *self, PyObject *args)
{ {
PyObject *name, *v, *result; PyObject *name, *v, *result;
int r; int r;
if (! PyArg_ParseTuple(args, "OO:_p_setattr", &name, &v)) if (!PyArg_ParseTuple(args, "OO:_p_setattr", &name, &v))
return NULL; return NULL;
r = Per_p_set_or_delattro(self, name, v); r = Per_p_set_or_delattro(self, name, v);
if (r < 0) if (r < 0)
return NULL; return NULL;
result = r ? Py_True : Py_False; result = r ? Py_True : Py_False;
Py_INCREF(result); Py_INCREF(result);
return result; return result;
} }
static PyObject * static PyObject *
Per__p_delattr(cPersistentObject *self, PyObject *name) Per__p_delattr(cPersistentObject *self, PyObject *name)
{ {
int r; int r;
PyObject *result; PyObject *result;
r = Per_p_set_or_delattro(self, name, NULL); r = Per_p_set_or_delattro(self, name, NULL);
if (r < 0) if (r < 0)
return NULL; return NULL;
result = r ? Py_True : Py_False; result = r ? Py_True : Py_False;
Py_INCREF(result); Py_INCREF(result);
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment