Author: martin.v.loewis
Date: Sat Jul 21 20:47:48 2007
New Revision: 56484

Modified:
   python/branches/py3k-struni/Include/bytesobject.h
   python/branches/py3k-struni/Include/stringobject.h
   python/branches/py3k-struni/Modules/_ctypes/_ctypes.c
   python/branches/py3k-struni/Modules/arraymodule.c
   python/branches/py3k-struni/Modules/datetimemodule.c
   python/branches/py3k-struni/Objects/bytesobject.c
   python/branches/py3k-struni/Objects/setobject.c
   python/branches/py3k-struni/Objects/stringobject.c
   python/branches/py3k-struni/Objects/unicodeobject.c
Log:
Fix merge breakage.


Modified: python/branches/py3k-struni/Include/bytesobject.h
==============================================================================
--- python/branches/py3k-struni/Include/bytesobject.h   (original)
+++ python/branches/py3k-struni/Include/bytesobject.h   Sat Jul 21 20:47:48 2007
@@ -42,7 +42,7 @@
 
 /* Macros, trading safety for speed */
 #define PyBytes_AS_STRING(self) (assert(PyBytes_Check(self)),((PyBytesObject 
*)(self))->ob_bytes)
-#define PyBytes_GET_SIZE(self)  (assert(PyBytes_Check(self)),((PyBytesObject 
*)(self))->ob_size)
+#define PyBytes_GET_SIZE(self)  (assert(PyBytes_Check(self)),Py_Size(self))
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-struni/Include/stringobject.h
==============================================================================
--- python/branches/py3k-struni/Include/stringobject.h  (original)
+++ python/branches/py3k-struni/Include/stringobject.h  Sat Jul 21 20:47:48 2007
@@ -85,7 +85,7 @@
 
 /* Macro, trading safety for speed */
 #define PyString_AS_STRING(op) (assert(PyString_Check(op)),(((PyStringObject 
*)(op))->ob_sval))
-#define PyString_GET_SIZE(op)  (assert(PyString_Check(op)),(((PyStringObject 
*)(op))->ob_size))
+#define PyString_GET_SIZE(op)  (assert(PyString_Check(op)),Py_Size(op))
 
 /* _PyString_Join(sep, x) is like sep.join(x).  sep must be PyStringObject*,
    x must be an iterable object. */

Modified: python/branches/py3k-struni/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/branches/py3k-struni/Modules/_ctypes/_ctypes.c       (original)
+++ python/branches/py3k-struni/Modules/_ctypes/_ctypes.c       Sat Jul 21 
20:47:48 2007
@@ -4041,7 +4041,7 @@
        if (val == NULL)
                return NULL;
 
-       name = PyUnicode_FromString(self->ob_type->tp_name);
+       name = PyUnicode_FromString(Py_Type(self)->tp_name);
        if (name == NULL) {
                Py_DECREF(val);
                return NULL;

Modified: python/branches/py3k-struni/Modules/arraymodule.c
==============================================================================
--- python/branches/py3k-struni/Modules/arraymodule.c   (original)
+++ python/branches/py3k-struni/Modules/arraymodule.c   Sat Jul 21 20:47:48 2007
@@ -1235,7 +1235,7 @@
 static PyObject *
 array_tofile(arrayobject *self, PyObject *f)
 {
-       Py_ssize_t nbytes = self->ob_size * self->ob_descr->itemsize;
+       Py_ssize_t nbytes = Py_Size(self) * self->ob_descr->itemsize;
        /* Write 64K blocks at a time */
        /* XXX Make the block size settable */
        int BLOCKSIZE = 64*1024;
@@ -1383,7 +1383,7 @@
 array_tostring(arrayobject *self, PyObject *unused)
 {
        return PyBytes_FromStringAndSize(self->ob_item,
-                                         self->ob_size * 
self->ob_descr->itemsize);
+                                         Py_Size(self) * 
self->ob_descr->itemsize);
 }
 
 PyDoc_STRVAR(tostring_doc,

Modified: python/branches/py3k-struni/Modules/datetimemodule.c
==============================================================================
--- python/branches/py3k-struni/Modules/datetimemodule.c        (original)
+++ python/branches/py3k-struni/Modules/datetimemodule.c        Sat Jul 21 
20:47:48 2007
@@ -950,7 +950,7 @@
                if (!PyString_Check(result) && !PyUnicode_Check(result)) {
                        PyErr_Format(PyExc_TypeError, "tzinfo.tzname() must "
                                     "return None or a string, not '%s'",
-                                    result->ob_type->tp_name);
+                                    Py_Type(result)->tp_name);
                        Py_DECREF(result);
                        result = NULL;
                }
@@ -1969,18 +1969,18 @@
 {
        if (GET_TD_MICROSECONDS(self) != 0)
                return PyUnicode_FromFormat("%s(%d, %d, %d)",
-                                           self->ob_type->tp_name,
+                                           Py_Type(self)->tp_name,
                                            GET_TD_DAYS(self),
                                            GET_TD_SECONDS(self),
                                            GET_TD_MICROSECONDS(self));
        if (GET_TD_SECONDS(self) != 0)
                return PyUnicode_FromFormat("%s(%d, %d)",
-                                           self->ob_type->tp_name,
+                                           Py_Type(self)->tp_name,
                                            GET_TD_DAYS(self),
                                            GET_TD_SECONDS(self));
 
        return PyUnicode_FromFormat("%s(%d)",
-                                   self->ob_type->tp_name,
+                                   Py_Type(self)->tp_name,
                                    GET_TD_DAYS(self));
 }
 
@@ -2381,7 +2381,7 @@
 date_repr(PyDateTime_Date *self)
 {
        return PyUnicode_FromFormat("%s(%d, %d, %d)",
-                                   self->ob_type->tp_name,
+                                   Py_Type(self)->tp_name,
                                    GET_YEAR(self), GET_MONTH(self), 
GET_DAY(self));
 }
 
@@ -2557,7 +2557,7 @@
 static PyObject *
 date_reduce(PyDateTime_Date *self, PyObject *arg)
 {
-       return Py_BuildValue("(ON)", self->ob_type, date_getstate(self, 0));
+       return Py_BuildValue("(ON)", Py_Type(self), date_getstate(self, 0));
 }
 
 static PyMethodDef date_methods[] = {

Modified: python/branches/py3k-struni/Objects/bytesobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/bytesobject.c   (original)
+++ python/branches/py3k-struni/Objects/bytesobject.c   Sat Jul 21 20:47:48 2007
@@ -102,7 +102,7 @@
             memcpy(new->ob_bytes, bytes, size);
         new->ob_bytes[size] = '\0';  /* Trailing null byte */
     }
-    new->ob_size = size;
+    Py_Size(new) = size;
     new->ob_alloc = alloc;
 
     return (PyObject *)new;
@@ -232,7 +232,7 @@
         return PyErr_NoMemory();
     if (size < self->ob_alloc) {
         Py_Size(self) = size;
-       self->ob_bytes[self->ob_size] = '\0'; /* Trailing null byte */
+       self->ob_bytes[Py_Size(self)] = '\0'; /* Trailing null byte */
     }
     else if (PyBytes_Resize((PyObject *)self, size) < 0)
         return NULL;
@@ -281,7 +281,7 @@
         return PyErr_NoMemory();
     if (size < self->ob_alloc) {
         Py_Size(self) = size;
-       self->ob_bytes[self->ob_size] = '\0'; /* Trailing null byte */
+       self->ob_bytes[Py_Size(self)] = '\0'; /* Trailing null byte */
     }
     else if (PyBytes_Resize((PyObject *)self, size) < 0)
         return NULL;
@@ -816,7 +816,7 @@
 bytes_repr(PyBytesObject *self)
 {
     static const char *hexdigits = "0123456789abcdef";
-    size_t newsize = 3 + 4 * self->ob_size;
+    size_t newsize = 3 + 4 * Py_Size(self);
     PyObject *v;
     if (newsize > PY_SSIZE_T_MAX || newsize / 4 != Py_Size(self)) {
         PyErr_SetString(PyExc_OverflowError,
@@ -2594,7 +2594,7 @@
 bytes_join(PyBytesObject *self, PyObject *it)
 {
     PyObject *seq;
-    Py_ssize_t mysize = self->ob_size;
+    Py_ssize_t mysize = Py_Size(self);
     Py_ssize_t i;
     Py_ssize_t n;
     PyObject **items;
@@ -2727,7 +2727,7 @@
     return Py_BuildValue("(O(s#s))",
                          Py_Type(self),
                          self->ob_bytes == NULL ? "" : self->ob_bytes,
-                         self->ob_size,
+                         Py_Size(self),
                          "latin-1");
 }
 

Modified: python/branches/py3k-struni/Objects/setobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/setobject.c     (original)
+++ python/branches/py3k-struni/Objects/setobject.c     Sat Jul 21 20:47:48 2007
@@ -619,21 +619,21 @@
        if (status != 0) {
                if (status < 0)
                        return NULL;
-               return PyUnicode_FromFormat("%s(...)", so->ob_type->tp_name);
+               return PyUnicode_FromFormat("%s(...)", Py_Type(so)->tp_name);
        }
 
        /* shortcut for the empty set */
        if (!so->used) {
                Py_ReprLeave((PyObject*)so);
-               return PyUnicode_FromFormat("%s()", so->ob_type->tp_name);
+               return PyUnicode_FromFormat("%s()", Py_Type(so)->tp_name);
        }
 
        keys = PySequence_List((PyObject *)so);
        if (keys == NULL)
                goto done;
 
-       if (so->ob_type != &PySet_Type) {
-               result = PyUnicode_FromFormat("%s(%R)", so->ob_type->tp_name, 
keys);
+       if (Py_Type(so) != &PySet_Type) {
+               result = PyUnicode_FromFormat("%s(%R)", Py_Type(so)->tp_name, 
keys);
                Py_DECREF(keys);
        }
        else {

Modified: python/branches/py3k-struni/Objects/stringobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/stringobject.c  (original)
+++ python/branches/py3k-struni/Objects/stringobject.c  Sat Jul 21 20:47:48 2007
@@ -835,7 +835,7 @@
        static const char *hexdigits = "0123456789abcdef";
        register PyStringObject* op = (PyStringObject*) obj;
        Py_ssize_t length = PyString_GET_SIZE(op);
-       size_t newsize = 3 + 4 * op->ob_size;
+       size_t newsize = 3 + 4 * Py_Size(op);
        PyObject *v;
        if (newsize > PY_SSIZE_T_MAX || newsize / 4 != Py_Size(op)) {
                PyErr_SetString(PyExc_OverflowError,

Modified: python/branches/py3k-struni/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/unicodeobject.c (original)
+++ python/branches/py3k-struni/Objects/unicodeobject.c Sat Jul 21 20:47:48 2007
@@ -305,7 +305,7 @@
 
         case SSTATE_INTERNED_MORTAL:
             /* revive dead object temporarily for DelItem */
-            unicode->ob_refcnt = 3;
+            Py_Refcnt(unicode) = 3;
             if (PyDict_DelItem(interned, (PyObject *)unicode) != 0)
                 Py_FatalError(
                     "deletion of interned unicode string failed");
@@ -8758,7 +8758,7 @@
        PyThreadState_GET()->recursion_critical = 0;
        /* The two references in interned are not counted by refcnt.
           The deallocator will take care of this */
-       s->ob_refcnt -= 2;
+       Py_Refcnt(s) -= 2;
        PyUnicode_CHECK_INTERNED(s) = SSTATE_INTERNED_MORTAL;
 }
 
@@ -8812,11 +8812,11 @@
                        /* XXX Shouldn't happen */
                        break;
                case SSTATE_INTERNED_IMMORTAL:
-                       s->ob_refcnt += 1;
+                       Py_Refcnt(s) += 1;
                        immortal_size += s->length;
                        break;
                case SSTATE_INTERNED_MORTAL:
-                       s->ob_refcnt += 2;
+                       Py_Refcnt(s) += 2;
                        mortal_size += s->length;
                        break;
                default:
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to