Skip to content

Commit

Permalink
fix pedandit flaws
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jul 29, 2011
1 parent d89ead9 commit 5c03825
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/tk/vec.c
Expand Up @@ -235,7 +235,7 @@ void vec_setbit(unsigned b,vec_t v)
#ifdef DEBUG
if (!(v && b < vec_numbits(v)))
printf("vec_setbit(v = %p,b = %d): numbits = %d dim = %d\n",
v,b,vec_numbits(v),vec_dim(v));
v,b,v ? vec_numbits(v) : 0, v ? vec_dim(v) : 0);
#endif
assert(v && b < vec_numbits(v));
*(v + (b >> VECSHIFT)) |= MASK(b);
Expand Down Expand Up @@ -300,7 +300,6 @@ int vec_testbit(unsigned b,vec_t v)
if (b >= vec_numbits(v))
{ printf("vec_testbit(v = %p,b = %d): numbits = %d dim = %d\n",
v,b,vec_numbits(v),vec_dim(v));
b = *(unsigned *)0; // generate GP fault
b = (unsigned)-1;
}
#endif
Expand Down Expand Up @@ -584,7 +583,7 @@ void vec_copy(vec_t to,vec_t from)
#ifdef DEBUG
if (!(to && from && vec_numbits(to) == vec_numbits(from)))
printf("to = x%lx, from = x%lx, numbits(to) = %d, numbits(from) = %d\n",
(long)to,(long)from,vec_numbits(to),vec_numbits(from));
(long)to,(long)from,to ? vec_numbits(to) : 0, from ? vec_numbits(from): 0);
#endif
assert(to && from && vec_numbits(to) == vec_numbits(from));
memcpy(to,from,sizeof(to[0]) * vec_dim(to));
Expand Down

0 comments on commit 5c03825

Please sign in to comment.