diff options
| author | Christoph Berg <myon@debian.org> | 2021-09-09 22:49:00 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2021-09-09 22:49:00 +0200 |
| commit | 85895feeaf88bcde26bbfc71e8f6b2047c0f5f41 (patch) | |
| tree | 79807e00771e4af4ce279e368262f2222806102f /lib/init_rs.c | |
| parent | 2f095a04ed69d9aa14b47dc4acde6b3225b2d65e (diff) | |
New upstream version 2.5.0~rc6+repackupstream/2.5.0_rc6+repack
Diffstat (limited to 'lib/init_rs.c')
| -rw-r--r-- | lib/init_rs.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/init_rs.c b/lib/init_rs.c index a8052365..876819f8 100644 --- a/lib/init_rs.c +++ b/lib/init_rs.c @@ -28,10 +28,9 @@ void FREE_RS(void *p){ * fcr = first root of RS code generator polynomial, index form * prim = primitive element to generate polynomial roots * nroots = RS code generator polynomial degree (number of roots) - * pad = padding bytes at front of shortened block */ -void *INIT_RS(int symsize,int gfpoly,int fcr,int prim, - int nroots,int pad){ +void *INIT_RS(unsigned int symsize,unsigned int gfpoly,unsigned fcr,unsigned prim, + unsigned int nroots){ struct rs *rs; int i, j, sr,root,iprim; @@ -39,19 +38,16 @@ void *INIT_RS(int symsize,int gfpoly,int fcr,int prim, if(symsize < 0 || symsize > (int)(8*sizeof(DTYPE))) return NULL; /* Need version with ints rather than chars */ - if(fcr < 0 || fcr >= (1<<symsize)) + if(fcr >= (1<<symsize)) return NULL; - if(prim <= 0 || prim >= (1<<symsize)) + if(prim == 0 || prim >= (1<<symsize)) return NULL; - if(nroots < 0 || nroots >= (1<<symsize)) + if(nroots >= (1<<symsize)) return NULL; /* Can't have more roots than symbol values! */ - if(pad < 0 || pad >= ((1<<symsize) -1 - nroots)) - return NULL; /* Too much padding */ rs = (struct rs *)calloc(1,sizeof(struct rs)); rs->mm = symsize; rs->nn = (1<<symsize)-1; - rs->pad = pad; rs->alpha_to = (DTYPE *)malloc(sizeof(DTYPE)*(rs->nn+1)); if(rs->alpha_to == NULL){ |
