chiark / gitweb /
*.c: Declare `PY_SSIZE_T_CLEAN'.
[catacomb-python] / bytestring.c
index d6bd9002ee913954e293c00f90649c53403339eb..b78ec1451510ffb35febc757771db4d309cde63e 100644 (file)
@@ -1,6 +1,4 @@
 /* -*-c-*-
- *
- * $Id$
  *
  * Byte strings
  *
@@ -56,7 +54,7 @@ static PyObject *bytestring_pynew(PyTypeObject *ty,
                                  PyObject *arg, PyObject *kw)
 {
   const char *p;
-  int n;
+  Py_ssize_t n;
   static char *kwlist[] = { "data", 0 };
   if (!PyArg_ParseTupleAndKeywords(arg, kw, "s#:new", kwlist, &p, &n))
     return (0);
@@ -68,7 +66,7 @@ static PyObject *bytestring_pynew(PyTypeObject *ty,
     const void *xv, *yv;                                               \
     const unsigned char *xp, *yp;                                      \
     unsigned char *zp;                                                 \
-    int xsz, ysz;                                                      \
+    Py_ssize_t xsz, ysz;                                               \
     int i;                                                             \
     PyObject *rc = 0;                                                  \
     if (PyObject_AsReadBuffer(x, &xv, &xsz) ||                         \
@@ -90,7 +88,7 @@ BINOP(xor, ^)
     const void *xv;                                                    \
     const unsigned char *xp;                                           \
     unsigned char *zp;                                                 \
-    int xsz;                                                           \
+    Py_ssize_t xsz;                                                    \
     int i;                                                             \
     PyObject *rc = 0;                                                  \
     if (PyObject_AsReadBuffer(x, &xv, &xsz)) goto end;                 \
@@ -132,7 +130,7 @@ static PyBufferProcs bytestring_pybuffer;
 
 static PyTypeObject bytestring_pytype_skel = {
   PyObject_HEAD_INIT(0) 0,             /* Header */
-  "catacomb.ByteString",               /* @tp_name@ */
+  "ByteString",                                /* @tp_name@ */
   0,                                   /* @tp_basicsize@ */
   0,                                   /* @tp_itemsize@ */