Skip to content

Commit c2dfd84

Browse files
committed
quad_math: fix or suppress cppcheck warnings
1 parent 32c60cd commit c2dfd84

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

sys/quad_math/muldi3.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ quad_t __muldi3(quad_t a, quad_t b)
9797
{
9898
union uu u, v, low, prod;
9999
u_int high, mid, udiff, vdiff;
100-
int negall, negmid;
100+
int negall;
101101
#define u1 u.ul[H]
102102
#define u0 u.ul[L]
103103
#define v1 v.ul[H]
@@ -131,6 +131,7 @@ quad_t __muldi3(quad_t a, quad_t b)
131131
prod.q = __lmulq(u0, v0);
132132
}
133133
else {
134+
int negmid;
134135
/*
135136
* Compute the three intermediate products, remembering
136137
* whether the middle term is negative. We can discard

sys/quad_math/qdivrem.c

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ __qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq)
7878
/* divide by zero. */
7979
static volatile const unsigned int zero = 0;
8080

81+
/* cppcheck-suppress zerodiv
82+
* Divission by zero is on purpose here */
8183
tmp.ul[H] = tmp.ul[L] = 1 / zero;
8284

8385
if (arq) {

0 commit comments

Comments
 (0)