Since there can only be one -m, base cannot be set by -m COMPOSITE and
then deallocated on the second -m if it is bugous. The second -m will
exit on error at _gf_errno = GF_E_TWOMULT;.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
The 'm2' variable in gf_w64_clm_multiply_region_from_single_2() isn't
used except for calculations on 'm2' which are not used later in the code.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Due to man page of malloc the behaviour in case of allocation size of
0 bytes is undefined: "If size was equal to 0, either NULL or a
pointer suitable to be passed to free() is returned"
Fix for clang scan-build report:
Unix API Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)
210 poly = (gf_general_t *) malloc(sizeof(gf_general_t)*(n+1));
9 Call to 'malloc' has an allocation size of 0 bytes
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Free all with malloc allocated memory before exit. Change
if checks against 'w' to be a if-else check to prevent checking
after already matched.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for coverity issue from Ceph project:
CID 1193093 (#1 of 1): Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: "return gf_w4_double_table_i...".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Remove identical expression, reorganize code in gf_error_check()
to be identical handled trough all checks. Removed (raltmap && arg1 != 4)
check - this is dead code (arg1 is always 4 in this code path).
Fix for coverity issue from Ceph project:
CID 1193071 (#1 of 1): Same on both sides (CONSTANT_EXPRESSION_RESULT)
pointless_expression: The expression (arg1 == 4 && arg2 == 32) ||
(arg1 == 4 && arg2 == 32) does not accomplish anything because it
evaluates to either of its identical operands, arg1 == 4 && arg2 == 32.
Did you intend the operands to be different?
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Since there is no comment indicating fallthrough on purpose added a
break in switch value 5 and 6.
Fix for coverity issue from Ceph project:
CID 1193084 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: This case (value 5) is not terminated by a 'break'
statement.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Since there is no comment indicating fallthrough on purpose added a
break in switch value 5 and 6.
Fix for coverity issue from Ceph project:
CID 1193082 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: This case (value 5) is not terminated by a 'break'
statement.
CID 1193083 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: This case (value 6) is not terminated by a 'break'
statement.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Since there is no comment indicating fallthrough on purpose added a
break in switch value 3 and 5/before default.
Fix for coverity issue from Ceph project:
CID 1193080 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: This case (value 3) is not terminated by a 'break'
statement.
CID 1193081 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: This case (value 5) is not terminated by a 'break'
statement.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Since there is no comment indicating fallthrough on purpose added a
break in switch value 5/before default.
Fix for coverity issue from Ceph project:
CID 1193079 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: This case (value 5) is not terminated by a 'break'
statement.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Instead of checking w128[0] twice check for w128[0] and w128[1].
Fix for coverity issue from Ceph project:
CID 1193072 (#1 of 1): Same on both sides (CONSTANT_EXPRESSION_RESULT)
pointless_expression: The expression v1->w128[0] == v2->w128[0] &&
v1->w128[0] == v2->w128[0] does not accomplish anything because it
evaluates to either of its identical operands, v1->w128[0] == v2->w128[0].
Did you intend the operands to be different?
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
To conveniently run tests as
$ make check
============================================================================
Testsuite summary for gf-complete 1.0
============================================================================
# TOTAL: 1
# PASS: 1
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
The run-tests.sh script loops over gf_methods and is introduced because
autotools does not allow tests to have parameters in the Makefile.am
Signed-off-by: Loic Dachary <loic@dachary.org>
Acknowledge that gf_w128_split_4_128_multiply_region and
gf_w128_split_4_128_sse_multiply_region are only used when the
INTEL_SSE4 flag is present, even though they only need INTEL_SSSE3
It suppresses a compilation warning complaining about them not being
used if INTEL_SSE4 is absent and INTEL_SSSE3 is present.
Signed-off-by: Loic Dachary <loic@dachary.org>