]> git.rkrishnan.org Git - tahoe-lafs/zfec.git/blobdiff - zfec/zfec/_fecmodule.c
narrow types of k and m from unsigned to unsigned short
[tahoe-lafs/zfec.git] / zfec / zfec / _fecmodule.c
index 34a29416c1ad90195edbcaae9b152cda09bb94f2..e9449c9f373eb502655190f2aec171f087e97d91 100644 (file)
@@ -30,8 +30,8 @@ typedef struct {
     PyObject_HEAD
 
     /* expose these */
-    short kk;
-    short mm;
+    unsigned short kk;
+    unsigned short mm;
 
     /* internal */
     fec_t* fec_matrix;
@@ -78,8 +78,8 @@ Encoder_init(Encoder *self, PyObject *args, PyObject *kwdict) {
         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;
@@ -289,8 +289,8 @@ typedef struct {
     PyObject_HEAD
 
     /* expose these */
-    short kk;
-    short mm;
+    unsigned short kk;
+    unsigned short mm;
 
     /* internal */
     fec_t* fec_matrix;
@@ -338,8 +338,8 @@ Decoder_init(Encoder *self, PyObject *args, PyObject *kwdict) {
         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;