]> git.rkrishnan.org Git - tahoe-lafs/zfec.git/blobdiff - zfec/zfec/_fecmodule.c
finally figured out what the C compiler was trying to tell me about prototypes and...
[tahoe-lafs/zfec.git] / zfec / zfec / _fecmodule.c
index d42e635e766c97a7546101f95c972d506def060f..38645bcd710b5c52c392afc321eedde7120e482d 100644 (file)
@@ -58,7 +58,7 @@ Encoder_init(Encoder *self, PyObject *args, PyObject *kwdict) {
         NULL
     };
     int ink, inm;
-    if (!PyArg_ParseTupleAndKeywords(args, kwdict, "ii", kwlist, &ink, &inm))
+    if (!PyArg_ParseTupleAndKeywords(args, kwdict, "ii:Encoder.__init__", kwlist, &ink, &inm))
         return -1;
 
     if (ink < 1) {
@@ -113,7 +113,7 @@ Encoder_encode(Encoder *self, PyObject *args) {
     Py_ssize_t sz, oldsz = 0;
     unsigned char check_block_index = 0; /* index into the check_blocks_produced and (parallel) pystrs_produced arrays */
 
-    if (!PyArg_ParseTuple(args, "O|O", &inblocks, &desired_blocks_nums))
+    if (!PyArg_ParseTuple(args, "O|O:Encoder.encode", &inblocks, &desired_blocks_nums))
         return NULL;
 
     for (i=0; i<self->mm - self->kk; i++)
@@ -317,7 +317,7 @@ Decoder_init(Encoder *self, PyObject *args, PyObject *kwdict) {
     };
 
     int ink, inm;
-    if (!PyArg_ParseTupleAndKeywords(args, kwdict, "ii", kwlist, &ink, &inm))
+    if (!PyArg_ParseTupleAndKeywords(args, kwdict, "ii:Decoder.__init__", kwlist, &ink, &inm))
         return -1;
 
     if (ink < 1) {
@@ -373,7 +373,7 @@ Decoder_decode(Decoder *self, PyObject *args) {
     long tmpl;
     unsigned nextrecoveredix=0;
 
-    if (!PyArg_ParseTuple(args, "OO", &blocks, &blocknums))
+    if (!PyArg_ParseTuple(args, "OO:Decoder.decode", &blocks, &blocknums))
         return NULL;
 
     for (i=0; i<self->kk; i++)
@@ -555,8 +555,9 @@ _hexwrite(unsigned char*s, size_t l) {
     printf("%.2x", s[i]);
 }
 
+
 PyObject*
-test_from_agl() {
+test_from_agl(PyObject* self, PyObject* args) {
   unsigned char b0c[8], b1c[8];
   unsigned char b0[8], b1[8], b2[8], b3[8], b4[8];
   memset(b0, 1, 8);
@@ -600,7 +601,7 @@ test_from_agl() {
 }
 
 static PyMethodDef fec_functions[] = { 
-  {"test_from_agl", test_from_agl, METH_NOARGS, NULL},
+    {"test_from_agl", test_from_agl, METH_NOARGS, NULL},
     {NULL} 
 };