summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Hubbard <bhubbard@redhat.com>2017-04-10 17:47:45 +1000
committerBrad Hubbard <bhubbard@redhat.com>2017-04-10 17:47:45 +1000
commit31cd20f7f318c13604bbd5add532003358e469eb (patch)
treefb98f85c548038a5ff294141f89603dda70dd423
parent414c96ef2b9934953b6facb31d803d79b1dd1405 (diff)
downloadjerasure-31cd20f7f318c13604bbd5add532003358e469eb.tar.gz
Resolve cppcheck Signed integer overflow error
The type of expression '1<<31' is signed int and this causes cppcheck to issue the following warning. src/gf_w32.c:681]: (error) Signed integer overflow for expression '1<<31'. Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
-rw-r--r--src/reed_sol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reed_sol.c b/src/reed_sol.c
index 82edacb..72cbff8 100644
--- a/src/reed_sol.c
+++ b/src/reed_sol.c
@@ -136,7 +136,7 @@ static gf_t GF32;
void reed_sol_galois_w32_region_multby_2(char *region, int nbytes)
{
if (prim32 == -1) {
- prim32 = galois_single_multiply((1 << 31), 2, 32);
+ prim32 = galois_single_multiply(((gf_val_32_t)1 << 31), 2, 32);
if (!gf_init_hard(&GF32, 32, GF_MULT_BYTWO_b, GF_REGION_DEFAULT, GF_DIVIDE_DEFAULT,
prim32, 0, 0, NULL, NULL)) {
fprintf(stderr, "Error: Can't initialize the GF for reed_sol_galois_w32_region_multby_2\n");