*.c: Make all of the type-definition tables read-only.
[catacomb-python] / share.c
diff --git a/share.c b/share.c
index 342144e..16d376e 100644 (file)
--- a/share.c
+++ b/share.c
@@ -53,7 +53,7 @@ static PyObject *gfsget_threshold(PyObject *me, void *hunoz)
 static PyObject *gfsget_size(PyObject *me, void *hunoz)
   { return (PyInt_FromLong(GFSHARE_S(me)->sz)); }
 
-static PyGetSetDef gfshare_pygetset[]= {
+static const PyGetSetDef gfshare_pygetset[]= {
 #define GETSETNAME(op, name) gfs##op##_##name
   GET  (threshold,     "S.threshold -> THRESHOLD")
   GET  (size,          "S.size -> SECRETSZ")
@@ -96,7 +96,7 @@ static PyTypeObject gfshare_pytype_skel = {
   0,                                   /* @tp_iternext@ */
   0,                                   /* @tp_methods@ */
   0,                                   /* @tp_members@ */
-  gfshare_pygetset,                    /* @tp_getset@ */
+  PYGETSET(gfshare),                   /* @tp_getset@ */
   0,                                   /* @tp_base@ */
   0,                                   /* @tp_dict@ */
   0,                                   /* @tp_descr_get@ */
@@ -142,7 +142,7 @@ end:
   return (rc);
 }
 
-static PyMethodDef gfsharesplit_pymethods[] = {
+static const PyMethodDef gfsharesplit_pymethods[] = {
 #define METHNAME(name) gfsmeth_##name
   METH (get,           "S.get(I) -> SHARE")
 #undef METHNAME
@@ -183,7 +183,7 @@ static PyTypeObject gfsharesplit_pytype_skel = {
   0,                                   /* @tp_weaklistoffset@ */
   0,                                   /* @tp_iter@ */
   0,                                   /* @tp_iternext@ */
-  gfsharesplit_pymethods,              /* @tp_methods@ */
+  PYMETHODS(gfsharesplit),             /* @tp_methods@ */
   0,                                   /* @tp_members@ */
   0,                                   /* @tp_getset@ */
   0,                                   /* @tp_base@ */
@@ -252,7 +252,7 @@ end:
   return (rc);
 }
 
-static PyMethodDef gfsharejoin_pymethods[] = {
+static const PyMethodDef gfsharejoin_pymethods[] = {
 #define METHNAME(name) gfsmeth_##name
   METH (addedp,        "S.addedp(I) -> BOOL")
   METH (add,           "S.add(I, SHARE) -> REMAIN")
@@ -264,7 +264,7 @@ static PyMethodDef gfsharejoin_pymethods[] = {
 static PyObject *gfsget_remain(PyObject *me, void *hunoz)
   { return (PyInt_FromLong(GFSHARE_S(me)->t - GFSHARE_S(me)->i)); }
 
-static PyGetSetDef gfsharejoin_pygetset[]= {
+static const PyGetSetDef gfsharejoin_pygetset[]= {
 #define GETSETNAME(op, name) gfs##op##_##name
   GET  (remain,        "S.remain -> REMAIN")
 #undef GETSETNAME
@@ -305,9 +305,9 @@ static PyTypeObject gfsharejoin_pytype_skel = {
   0,                                   /* @tp_weaklistoffset@ */
   0,                                   /* @tp_iter@ */
   0,                                   /* @tp_iternext@ */
-  gfsharejoin_pymethods,               /* @tp_methods@ */
+  PYMETHODS(gfsharejoin),              /* @tp_methods@ */
   0,                                   /* @tp_members@ */
-  gfsharejoin_pygetset,                        /* @tp_getset@ */
+  PYGETSET(gfsharejoin),               /* @tp_getset@ */
   0,                                   /* @tp_base@ */
   0,                                   /* @tp_dict@ */
   0,                                   /* @tp_descr_get@ */
@@ -345,7 +345,7 @@ static PyObject *sget_threshold(PyObject *me, void *hunoz)
 static PyObject *sget_modulus(PyObject *me, void *hunoz)
   { return (mp_pywrap(SHARE_S(me)->p)); }
 
-static PyGetSetDef share_pygetset[]= {
+static const PyGetSetDef share_pygetset[]= {
 #define GETSETNAME(op, name) s##op##_##name
   GET  (threshold,     "S.threshold -> THRESHOLD")
   GET  (modulus,       "S.modulus -> MODULUS")
@@ -388,7 +388,7 @@ static PyTypeObject share_pytype_skel = {
   0,                                   /* @tp_iternext@ */
   0,                                   /* @tp_methods@ */
   0,                                   /* @tp_members@ */
-  share_pygetset,                      /* @tp_getset@ */
+  PYGETSET(share),                     /* @tp_getset@ */
   0,                                   /* @tp_base@ */
   0,                                   /* @tp_dict@ */
   0,                                   /* @tp_descr_get@ */
@@ -439,7 +439,7 @@ end:
   return (rc);
 }
 
-static PyMethodDef sharesplit_pymethods[] = {
+static const PyMethodDef sharesplit_pymethods[] = {
 #define METHNAME(name) smeth_##name
   METH (get,           "S.get(I) -> SHARE")
 #undef METHNAME
@@ -480,7 +480,7 @@ static PyTypeObject sharesplit_pytype_skel = {
   0,                                   /* @tp_weaklistoffset@ */
   0,                                   /* @tp_iter@ */
   0,                                   /* @tp_iternext@ */
-  sharesplit_pymethods,                        /* @tp_methods@ */
+  PYMETHODS(sharesplit),               /* @tp_methods@ */
   0,                                   /* @tp_members@ */
   0,                                   /* @tp_getset@ */
   0,                                   /* @tp_base@ */
@@ -551,7 +551,7 @@ end:
   return (rc);
 }
 
-static PyMethodDef sharejoin_pymethods[] = {
+static const PyMethodDef sharejoin_pymethods[] = {
 #define METHNAME(name) smeth_##name
   METH (addedp,        "S.addedp(I) -> BOOL")
   METH (add,           "S.add(I, SHARE) -> REMAIN")
@@ -563,7 +563,7 @@ static PyMethodDef sharejoin_pymethods[] = {
 static PyObject *sget_remain(PyObject *me, void *hunoz)
   { return (PyInt_FromLong(SHARE_S(me)->t - SHARE_S(me)->i)); }
 
-static PyGetSetDef sharejoin_pygetset[]= {
+static const PyGetSetDef sharejoin_pygetset[]= {
 #define GETSETNAME(op, name) s##op##_##name
   GET  (remain,        "S.remain -> REMAIN")
 #undef GETSETNAME
@@ -604,9 +604,9 @@ static PyTypeObject sharejoin_pytype_skel = {
   0,                                   /* @tp_weaklistoffset@ */
   0,                                   /* @tp_iter@ */
   0,                                   /* @tp_iternext@ */
-  sharejoin_pymethods,                 /* @tp_methods@ */
+  PYMETHODS(sharejoin),                        /* @tp_methods@ */
   0,                                   /* @tp_members@ */
-  sharejoin_pygetset,                  /* @tp_getset@ */
+  PYGETSET(sharejoin),                 /* @tp_getset@ */
   0,                                   /* @tp_base@ */
   0,                                   /* @tp_dict@ */
   0,                                   /* @tp_descr_get@ */