Browse Source

quad_math: fix or suppress cppcheck warnings

master
Oleg Hahm 6 years ago
parent
commit
c2dfd8439c
  1. 3
      sys/quad_math/muldi3.c
  2. 2
      sys/quad_math/qdivrem.c

3
sys/quad_math/muldi3.c

@ -97,7 +97,7 @@ quad_t __muldi3(quad_t a, quad_t b)
{
union uu u, v, low, prod;
u_int high, mid, udiff, vdiff;
int negall, negmid;
int negall;
#define u1 u.ul[H]
#define u0 u.ul[L]
#define v1 v.ul[H]
@ -131,6 +131,7 @@ quad_t __muldi3(quad_t a, quad_t b)
prod.q = __lmulq(u0, v0);
}
else {
int negmid;
/*
* Compute the three intermediate products, remembering
* whether the middle term is negative. We can discard

2
sys/quad_math/qdivrem.c

@ -78,6 +78,8 @@ __qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq)
/* divide by zero. */
static volatile const unsigned int zero = 0;
/* cppcheck-suppress zerodiv
* Divission by zero is on purpose here */
tmp.ul[H] = tmp.ul[L] = 1 / zero;
if (arq) {

Loading…
Cancel
Save