PyObject_HEAD
/* expose these */
- short kk;
- short mm;
+ unsigned short kk;
+ unsigned short mm;
/* internal */
fec_t* fec_matrix;
PyErr_Format(py_fec_error, "Precondition violation: first argument is required to be less than or equal to the second argument, but they were %d and %d respectively", ink, inm);
return -1;
}
- self->kk = (short)ink;
- self->mm = (short)inm;
+ self->kk = (unsigned short)ink;
+ self->mm = (unsigned short)inm;
self->fec_matrix = fec_new(self->kk, self->mm);
return 0;
PyObject_HEAD
/* expose these */
- short kk;
- short mm;
+ unsigned short kk;
+ unsigned short mm;
/* internal */
fec_t* fec_matrix;
PyErr_Format(py_fec_error, "Precondition violation: first argument is required to be less than or equal to the second argument, but they were %d and %d respectively", ink, inm);
return -1;
}
- self->kk = (short)ink;
- self->mm = (short)inm;
+ self->kk = (unsigned short)ink;
+ self->mm = (unsigned short)inm;
self->fec_matrix = fec_new(self->kk, self->mm);
return 0;
typedef struct {
unsigned long magic;
- unsigned k, n; /* parameters of the code */
+ unsigned short k, n; /* parameters of the code */
gf* enc_matrix;
} fec_t;
* param k the number of blocks required to reconstruct
* param m the total number of blocks created
*/
-fec_t* fec_new(unsigned k, unsigned m);
+fec_t* fec_new(unsigned short k, unsigned short m);
void fec_free(fec_t* p);
/**